wuyouming666
2024-05-11 7dfc5501decb84bce7fe0563956eae705844a2f2
springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java
@@ -14,6 +14,7 @@
import java.util.List;
public class InitUtil {
    //初始化word
    public static PlcParameterObject initword(String jsonFilePath) {
        try {
            FileReader fileReader = new FileReader(jsonFilePath);
@@ -47,8 +48,8 @@
                plcParameterObject.addPlcParameter(plcParameterInfo);
            }
           // byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02};
            byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
            plcParameterObject.setPlcParameterList(getplcvlues);
           // byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
           // plcParameterObject.setPlcParameterList(getplcvlues);
            return plcParameterObject;
        } catch (IOException e) {
@@ -57,7 +58,7 @@
        return null;
    }
    //初始化bit
    public static PlcBitObject initbit(String jsonFilePath) {
        PlcBitObject plcBitObject = new PlcBitObject();
@@ -103,7 +104,7 @@
        return plcBitObject;
    }
//
    public static void readAndUpdateBitValues(PlcBitObject plcBitObject) {
//        Boolean[] values1 = { false, true, true, true, false, false, true, false,