wuyouming666
2024-01-26 0d3f741da10c048bc4eb25c4b46b842759f54905
增加测试位 ,标志位,报警 DB区
10个文件已修改
8个文件已添加
1928 ■■■■■ 已修改文件
springboot-vue3/src/main/java/com/example/springboot/component/ExcelToJsonConverter.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview2.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJog.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJogReview.java 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcManualonePositionReview.java 247 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcalarmReview.java 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcBitInfo.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcBitObject.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/PlcAlarm.json 371 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/PlcSign.json 452 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/PlcTest.json 375 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/alarm.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/sign.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/test.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/ExcelToJsonConverter.java
@@ -18,15 +18,15 @@
public class ExcelToJsonConverter {
    public static void main(String[] args) {
        String excelFilePath = "JsonFile/state.xlsx";
        String excelFilePath = "src/main/resources/JsonFile/alarm.xlsx";
        String sheetName = "Sheet1";
        int addressColumnIndex = 0;
        int nameColumnIndex = 1;
        int unitColumnIndex = 2;
        String outputFilePath = "JsonFile/state.json";
        //int unitColumnIndex = 2;
        String outputFilePath = "src/main/resources/JsonFile/PlcAlarm.json";
        try (Workbook workbook = new HSSFWorkbook(new FileInputStream(excelFilePath))) {
        try (Workbook workbook = new XSSFWorkbook(new FileInputStream(excelFilePath))) {
            Sheet sheet = workbook.getSheet(sheetName);
            List<LinkedHashMap<String, Object>> jsonList = new ArrayList<>();
@@ -38,19 +38,19 @@
            }
            int plcAddressLength = 0; // 记录所有 addressLenght 的和
            int addressIndex = 0; // 自增的地址索引
            while (rowIterator.hasNext()) {
                Row row = rowIterator.next();
                Cell nameCell = row.getCell(nameColumnIndex);
                Cell addressCell = row.getCell(addressColumnIndex);
                Cell unitCell = row.getCell(unitColumnIndex);
              //  Cell unitCell = row.getCell(unitColumnIndex);
                String name = nameCell.getStringCellValue();
                String address = addressCell.getStringCellValue();
                String unit = unitCell.getStringCellValue();
               // String unit = unitCell.getStringCellValue();
                String addressIndex = extractAddressIndex(address);
              //  String addressIndex = extractAddressIndex(address);
                LinkedHashMap<String, Object> jsonObject = new LinkedHashMap<>();
                jsonObject.put("codeId", name);
@@ -62,19 +62,21 @@
                } else {
                    addressLength = 2;
                }
                jsonObject.put("addressLenght", String.valueOf(addressLength));
               // jsonObject.put("addressLenght", String.valueOf(addressLength));
                jsonObject.put("unit", unit);
                //jsonObject.put("unit", unit);
                plcAddressLength += addressLength;
                jsonList.add(jsonObject);
                addressIndex++;
            }
            LinkedHashMap<String, Object> resultObject = new LinkedHashMap<>();
            resultObject.put("plcAddressBegin", "DB100.0");
            resultObject.put("plcAddressLenght", String.valueOf(plcAddressLength));
            resultObject.put("dataType", "word");
           // resultObject.put("dataType", "word");
            resultObject.put("dataType", "bit");
            resultObject.put("parameteInfor", jsonList);
            Gson gson = new Gson();
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,
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview2.java
@@ -5,6 +5,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.example.springboot.component.InitUtil.readAndUpdateBitValues;
@@ -35,6 +36,17 @@
        return instance;
    }
    String jsonFilePath = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath();
    String jsonFilePath2 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath();
    String jsonFilePath4 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath();
    //System.out.println(jsonFilePath4);
    // 调用initword方法
    PlcParameterObject plcParameterObject = initUtil.initword(jsonFilePath);
    PlcParameterObject plcStateObject = initUtil.initword(jsonFilePath4);
    // 调用initbit方法
    PlcBitObject plcBitObject = initUtil.initbit(jsonFilePath2);
    @Override
    public void run() {
        while (this != null) {
@@ -45,48 +57,55 @@
                e.printStackTrace();
            }
            String jsonFilePath = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath();
            String jsonFilePath2 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath();
            String jsonFilePath4 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath();
           //System.out.println(jsonFilePath4);
          //  int index3 = plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddressIndex();
           // System.out.println(index3);
           // System.out.println(plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddress(index3));
            // 调用initword方法
          PlcParameterObject plcParameterObject = initUtil.initword(jsonFilePath);
            PlcParameterObject plcStateObject = initUtil.initword(jsonFilePath4);
//            readAndUpdateBitValues(plcBitObject);
//            readAndUpdateWordValues(plcParameterObject);
//            readAndUpdateWordValues(plcStateObject);
            // 调用initbit方法
            PlcBitObject plcBitObject = initUtil.initbit(jsonFilePath2);
            readAndUpdateBitValues(plcBitObject);
            readAndUpdateWordValues(plcParameterObject);
            readAndUpdateWordValues(plcStateObject);
                 List<String> addresses = new ArrayList<>();
      addresses.add("conveyorVelocity(AutoFAST)");
      addresses.add("A02ID");
            addresses.add("conveyorVelocity(Manual)");
            List<String> address =  plcParameterObject.getAddressListByCodeId(addresses);
            System.out.println(address);
           // int index = plcParameterObject.getPlcParameter("A01turnAngle1").getAddressIndex();
           // List<Short> arraylist = S7control.getinstance().ReadWord(plcParameterObject.getPlcParameter("A01turnAngle1").getAddress(index), 8);
//            List<Boolean> getplcvlues = S7control.getinstance().ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength());
//            plcBitObject.setPlcBitList(getplcvlues);
           // int index = plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddressIndex();
         //   System.out.println(index);
           // plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddress(index);
            // System.out.println(plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddress(index));
            // plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddress(index);
          //
            // S7control.getinstance().WriteWord(plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddress(index), (short) 100);
//     List<String> addresses = new ArrayList<>();
//      addresses.add("conveyorVelocity(AutoFAST)");
//      addresses.add("A02ID");
//System.out.println(plcParameterObject.getPlcParameterValues(addresses));
            List<String> addresses2 = new ArrayList<>();
            addresses2.add("D01.SRdec");
            addresses2.add("D01.SRinpos");
            addresses2.add("D05.SRinpos");
            System.out.println(plcBitObject.getPlcBitValues(addresses2));
           int index2 = plcBitObject.getPlcBit("D05.SRinpos").getAddressIndex();
            System.out.println(index2);
           plcBitObject.getPlcBit("D05.SRinpos").getAddress(index2);
           System.out.println(plcBitObject.getPlcBit("D05.SRinpos").getAddress(index2));
//            List<String> addresses2 = new ArrayList<>();
//            addresses2.add("D01.SRdec");
//            addresses2.add("D01.SRinpos");
//            addresses2.add("D05.SRinpos");
//
//
//
//
//            System.out.println(plcBitObject.getPlcBitValues(addresses2));
//
//           int index2 = plcBitObject.getPlcBit("D05.SRinpos").getAddressIndex();
//            System.out.println(index2);
//
//           plcBitObject.getPlcBit("D05.SRinpos").getAddress(index2);
//           System.out.println(plcBitObject.getPlcBit("D05.SRinpos").getAddress(index2));
//
//
//            List<String> addresses3 = new ArrayList<>();
springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJog.java
@@ -44,9 +44,6 @@
       List<Boolean> arraylist = S7control.getinstance().readBits(addressList21);
            JSONObject jsonObject = new JSONObject();
            short[] params = new short[arraylist.size()];
@@ -57,11 +54,6 @@
          //  System.out.println("messageValue:"+ arraylist  );
            jsonObject.append("params", params);
//      System.out.println("messageValue:" + arraylist +"messageValue2:" + arraylist2 );
//      WebSocketServer sendwServer = WebSocketServer.sessionMap.get("ManualJog");
//      if (sendwServer != null) {
//        sendwServer.sendMessage(jsonObject.toString());
//      }
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("ManualJog");
            if (sendwServer != null) {
springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJogReview.java
New file
@@ -0,0 +1,157 @@
package com.example.springboot.component;
import cn.hutool.json.JSONObject;
import com.example.springboot.entity.device.PlcBitObject;
import static com.example.springboot.component.InitUtil.readAndUpdateBitValues;
import static com.example.springboot.component.InitUtil.readAndUpdateWordValues;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class PLCManualJogReview extends Thread {
    // 用于存储应用程序的配置信息
    private Configuration config;
    private static InitUtil initUtil;
    // 创建一个自定义的 S7 控制器消息处理器对象
    MessageHandler customS7Control = new MessageHandler();
    // 单例实例
    private static PLCManualJogReview instance;
    public PLCManualJogReview() throws IOException {
        config = new Configuration("config.properties");
        initUtil = new InitUtil();
    }
    // 获取单例实例
    public static synchronized PLCManualJogReview getInstance() throws IOException {
        if (instance == null) {
            instance = new PLCManualJogReview();
        }
        return instance;
    }
    String jsonFilePath = PLCManualJogReview.class.getResource("/JsonFile/PlcTest.json").getPath();
    PlcBitObject plcTestObject = initUtil.initbit(jsonFilePath);
    @Override
    public void run() {
        while (this != null) {
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
         //  List<String> addressList21 = Arrays.asList(config.getProperty("PLCManualJog.button").split(","));
      // List<Boolean> arraylist = S7control.getinstance().readBits(addressList21);
            readAndUpdateBitValues(plcTestObject);
            List<String> codeidlist = Arrays.asList(
                    "D01VFDconveyor", "D02VFDconveyor", "D03VFDconveyor", "D04VFDconveyor",
                    "D05VFDconveyor", "D06VFDconveyor","A01VFDconveyor", "A01VFDconveyorreverse", "A01SERVETRAVEL",
                    "A01SERVETURN", "A01oilpump", "A02VFDconveyor", "A02VFDconveyorreverse",
                    "A02SERVETRAVEL", "A02SERVETURN", "A02oilpump", "B01VFDconveyor", "B01SERVETRAVEL",
                    "B01YVTURN", "B01YVUPDOWN", "B01YVGassing", "B02VFDconveyor", "B02SERVETRAVEL",
                    "B02YVTURN", "B02YVUPDOWN", "B02YVGassing", "A01SERVETRAVELhome", "A02SERVETRAVELhome"
            );
//PLCManualJog.button=DB101.0.0,DB101.0.1,DB101.0.2,DB101.0.3,DB101.0.4,DB101.0.5,DB101.0.6,DB101.3.4,DB101.1.4,DB101.1.2,DB101.5.2,DB101.0.7,DB101.3.5,DB101.1.5,DB101.1.3,DB101.5.3,DB101.1.0,DB101.1.6,DB101.2.6,DB101.2.7,DB101.3.2,DB101.1.1,DB101.1.7,DB101.3.0,DB101.3.1,DB101.3.3,DB101.10.5,DB101.10.6
            List<String> address =  plcTestObject.getAddressListByCodeId(codeidlist);
         System.out.println(address);
//
//            int index2 = plcTestObject.getPlcBit("B01YVUPDOWN").getAddressIndex();
//            System.out.println(index2);
//
//            System.out.println(plcTestObject.getPlcBit("B01YVUPDOWN").getAddress(index2));
            List<Boolean> arraylist = plcTestObject.getPlcBitValues(codeidlist);
            JSONObject jsonObject = new JSONObject();
            short[] params = new short[arraylist.size()];
            for (int i = 0; i < arraylist.size(); i++) {
                boolean value = arraylist.get(i);
                params[i] = value ? (short) 1 : (short) 0;
            }
            jsonObject.append("params", params);
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("ManualJog");
            if (sendwServer != null) {
                for (WebSocketServer webserver : sendwServer) {
                    webserver.sendMessage(jsonObject.toString());
//      WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("ManualJog");
                    if (webserver != null) {
                        List<String> messages = webserver.getMessages();
                        if (!messages.isEmpty()) {
                            // 将最后一个消息转换为整数类型的列表
                            String lastMessage = messages.get(messages.size() - 1);
                            // System.out.println("messages:" + messages);
                            String[] parts = lastMessage.split(",");
                            List<Integer> messageValues = new ArrayList<>();
                            for (String part : parts) {
                                try {
                                    // 使用正则表达式清除非数字字符
                                    String cleanedPart = part.replaceAll("[^0-9-]", "");
                                    Integer value = Integer.parseInt(cleanedPart.trim());
                                    messageValues.add(value);
                                } catch (NumberFormatException e) {
                                    // 如果无法解析为整数类型,则忽略该部分
                                    // e.printStackTrace();
                                }
                            }
                            // 将消息值转换为布尔列表
                            List<Boolean> messageBooleans = new ArrayList<>();
                            for (Integer value : messageValues) {
                                messageBooleans.add(value == 1 ? true : false);
                            }
                            // System.out.println(messageBooleans);
                            List<Boolean> bolList = new ArrayList<>();
                            for (int i = 0; i < 28 && i < messageBooleans.size(); i++) {
                                bolList.add(messageBooleans.get(i));
                            }
                            if (!bolList.isEmpty()) {
                         S7control.getinstance().WriteBit(address, bolList);
//
                               System.out.println("messageValue:" + bolList + " written to PLC at address " + address);
                            }
                            webserver.clearMessages();
                        }
                    }
                }
            }
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/component/PlcManualonePositionReview.java
New file
@@ -0,0 +1,247 @@
package com.example.springboot.component;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class PlcManualonePositionReview extends Thread {
    private Configuration config;
    public PlcManualonePositionReview() throws IOException {
        config = new Configuration("config.properties");
    }
    // 创建一个自定义的 S7 控制器消息处理器对象
    MessageHandler customS7Control = new MessageHandler();
    public static class PLCBooleanConverter {
        public static short[] convertListsToBinaryShortArray(List<Boolean>... lists) {
            // 计算所有列表中元素的总数
            int totalSize = 0;
            for (List<Boolean> list : lists) {
                totalSize += list.size();
            }
            // 创建一个足够大的数组来存放所有的二进制值
            short[] binaryShortArray = new short[totalSize];
            // 当前数组填充位置指针
            int currentIndex = 0;
            // 遍历所有的列表
            for (List<Boolean> list : lists) {
                // 将每个布尔值转换为 0 或 1 并填入数组
                for (Boolean value : list) {
                    binaryShortArray[currentIndex++] = (short) (value ? 1 : 0);
                }
            }
            return binaryShortArray;
        }
    }
    @Override
    public void run() {
        while (this != null) {
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            // this.readValue();
            // String PlcAddress = this.name;
            // Integer Plccount = this.count;
            //B01组合中地址
           // String b01Address = config.getProperty("B01.address");
            List<String> addresses = Arrays.asList(config.getProperty("PlcManualonePosition.addresses").split(","));
            List<Short> arraylist = S7control.getinstance().readWords(addresses);
            // System.out.println(arraylist);
            List<String> addresses2 = Arrays.asList(config.getProperty("PlcManualonePosition.addresses2").split(","));
            List<Short> arraylist2 = S7control.getinstance().readWords(addresses2);
            List<String> addresses3 = Arrays.asList(config.getProperty("PlcManualonePosition.addresses3").split(","));
            List<Short> arraylist3 = S7control.getinstance().readWords(addresses3);
            List<String> addresses4 = Arrays.asList(config.getProperty("PlcManualonePosition.addresses4").split(","));
            List<Short> arraylist4 = S7control.getinstance().readWords(addresses4);
            List<Short> arraylist5 = S7control.getinstance().ReadWord("DB106.0", 1);
            List<Short> arraylist6 = S7control.getinstance().ReadWord("DB106.12", 1);
            List<Short> arraylist7 = S7control.getinstance().ReadWord("DB106.40", 1);
            List<Short> arraylist8 = S7control.getinstance().ReadWord("DB106.50", 1);
            //故障
            List<String> addresses9 = Arrays.asList(config.getProperty("PlcManualonePosition.fault").split(","));
            List<Boolean> arraylist9 = S7control.getinstance().readBits(addresses9);
           //未回零
            List<String> addresses10 = Arrays.asList(config.getProperty("PlcManualonePosition.Notzero").split(","));
            List<Boolean> arraylist10 = S7control.getinstance().readBits(addresses10);
            //A01启动地址
            List<String> A01start = Arrays.asList(config.getProperty("mlp.A01start"));
            //A02启动地址
            List<String> A02start = Arrays.asList(config.getProperty("mlp.A02start"));
            List<String> B01start = Arrays.asList(config.getProperty("mlp.B01start"));
            List<String> B02start = Arrays.asList(config.getProperty("mlp.B02start"));
            // 故障地址
            List<String> waddresses5 = Arrays.asList(config.getProperty("PlcManualonePosition.fault2").split(","));
            // 复位地址
            List<String> waddresses6 = Arrays.asList(config.getProperty("PlcManualonePosition.Reset").split(","));
            List<Boolean> readreast = S7control.getinstance().readBits(waddresses6);
            short[] reast6 = PLCBooleanConverter.convertListsToBinaryShortArray(readreast);
            // 回零地址
            List<String> waddresses7 = Arrays.asList(config.getProperty("PlcManualonePosition.Zero").split(","));
            List<Boolean> readhuiling = S7control.getinstance().readBits(waddresses7);
            short[] huiling7 = PLCBooleanConverter.convertListsToBinaryShortArray(readhuiling);
            List<Boolean> A01readstart = S7control.getinstance().readBits(A01start);
            List<Boolean> A02readstart = S7control.getinstance().readBits(A02start);
            List<Boolean> B01readstart = S7control.getinstance().readBits(B01start);
            List<Boolean> B02readstart = S7control.getinstance().readBits(B02start);
            short[] combinedBinaryShortArray = PLCBooleanConverter.convertListsToBinaryShortArray(
                    A01readstart, A02readstart, B01readstart, B02readstart
            );
            // Short[] values1 = { 1, 2, 3 };
            // List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
            // Short[] values2 = { 1, 2, 3 };
            // List<Short> arraylist2 = new ArrayList<>(Arrays.asList(values2));
            // Short[] values3 = { 1, 2, 3 };
            // List<Short> arraylist3 = new ArrayList<>(Arrays.asList(values3));
            // Short[] values4 = { 1, 2, 3 };
            // List<Short> arraylist4 = new ArrayList<>(Arrays.asList(values4));
            // Short[] values5 = { 5 };
            // List<Short> arraylist5 = new ArrayList<>(Arrays.asList(values5));
            // Short[] values6 = { 6 };
            // List<Short> arraylist6 = new ArrayList<>(Arrays.asList(values6));
            // Short[] values7 = { 7 };
            // List<Short> arraylist7 = new ArrayList<>(Arrays.asList(values7));
            // Short[] values8 = { 8 };
            // List<Short> arraylist8 = new ArrayList<>(Arrays.asList(values8));
            // Boolean[] values9 = { false, false, true, true };
            // List<Boolean> arraylist9 = new ArrayList<>(Arrays.asList(values9));
            short[] params2 = new short[arraylist9.size()];
            for (int i = 0; i < arraylist9.size(); i++) {
                boolean value = arraylist9.get(i);
                params2[i] = value ? (short) 1 : (short) 0;
            }
            // Boolean[] values10 = { false, false, true, true };
            // List<Boolean> arraylist10 = new ArrayList<>(Arrays.asList(values10));
            short[] params3 = new short[arraylist10.size()];
            for (int i = 0; i < arraylist10.size(); i++) {
                boolean value = arraylist10.get(i);
                params3[i] = value ? (short) 1 : (short) 0;
            }
            // List<Short> arraylist9 = S7control.getinstance().readWords(addresses9);
            arraylist5.addAll(arraylist6);
            arraylist5.addAll(arraylist7);
            arraylist5.addAll(arraylist8);
            JSONObject jsonObject = new JSONObject();
            // System.out.println(arraylist6);
            jsonObject.append("zuhe1", arraylist);
            jsonObject.append("zuhe2", arraylist2);
            jsonObject.append("zuhe3", arraylist3);
            jsonObject.append("zuhe4", arraylist4);
            jsonObject.append("shishi1", arraylist5);
            jsonObject.append("guzhang", params2);
            jsonObject.append("weihuiling", params3);
            jsonObject.append("qidong", combinedBinaryShortArray);
            jsonObject.append("fuwei", reast6);
            jsonObject.append("huiling", huiling7);
//      WebSocketServer sendwServer = WebSocketServer.sessionMap.get("ManualonePosition");
//      if (sendwServer != null) {
//        sendwServer.sendMessage(jsonObject.toString());
//      }
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("ManualonePosition");
            if (sendwServer != null) {
                for (WebSocketServer webserver : sendwServer) {
                    webserver.sendMessage(jsonObject.toString());
//      WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("ManualonePosition");
                    if (webserver != null) {
                        List<String> messages = webserver.getMessages();
                        // System.out.println(messages.isEmpty());
                        if (!messages.isEmpty()) {
                            // 将最后一个消息转换为 short 类型的列表
                            String lastMessage = messages.get(messages.size() - 1);
                            // System.out.println("lastMessage:" + lastMessage);
                            JSONArray messageArray = new JSONArray(lastMessage);
                            // 写入A01
                            customS7Control.WriteWordToPLC(messageArray, addresses, 0);
                            // 写入A02
                            customS7Control.WriteWordToPLC(messageArray, addresses2, 1);
                            // 写入B01
                            customS7Control.WriteWordToPLC(messageArray, addresses3, 2);
                            // 写入B02
                            customS7Control.WriteWordToPLC(messageArray, addresses4, 3);
                            // 写入故障地址
                            customS7Control.writeBitToPLC(messageArray, waddresses5, 4);
                            // 写入复位地址
                            customS7Control.writeBitToPLC(messageArray, waddresses6, 5);
                            // 写入回零地址
                            customS7Control.writeBitToPLC(messageArray, waddresses7, 6);
                            //A01启动
                            customS7Control.writeBitToPLC(messageArray, A01start, 7);
                            //A02启动
                            customS7Control.writeBitToPLC(messageArray, A02start, 8);
                            //B01启动
                            customS7Control.writeBitToPLC(messageArray, B01start, 9);
                            //B02启动
                            customS7Control.writeBitToPLC(messageArray, B02start, 10);
                            // 清空消息列表
                            webserver.clearMessages();
                        }
                    }
                }
            }
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/component/PlcalarmReview.java
New file
@@ -0,0 +1,140 @@
package com.example.springboot.component;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.example.springboot.mapper.AlarmMapper;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class PlcalarmReview extends Thread {
  private AlarmMapper alarmMapper;
  String content = "";
  String name = "";
  Integer count = 0;
  public List<String> readValue() {
    String str = "";
    BufferedReader bufferedReader = null;
    FileInputStream fileInputStream;
    try {
      // 从文件中读取字节数据存入 fileInputStream
      fileInputStream = new FileInputStream("D:/canadames/Alarm.json");
      // 读取 fileInputStream 中字节并将其解码为字符
      InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
      // 提高读取效率,在 BufferedReader 内包装 InputStreamReader
      bufferedReader = new BufferedReader(inputStreamReader);
      String line = null;
      // 将 bufferedReader 内容一行一行赋值给str
      while ((line = bufferedReader.readLine()) != null) {
        str += line;
      }
      // 将str字符串格式转为json
      JSONObject jsonObject = new JSONObject(str);
      List<String> arraylistss = new ArrayList<>();
      // 获取json中报警信息的值
      JSONArray AlarmContent = jsonObject.getJSONArray("content");
      for (int i = 0; i < AlarmContent.size(); i++) {
        JSONObject ress = (JSONObject) AlarmContent.get(i);
        this.content = ress.getStr("name");
        arraylistss.add(content);
      }
      // 获取json中地址的值
      JSONArray address = jsonObject.getJSONArray("address");
      for (int i = 0; i < address.size(); i++) {
        JSONObject ress = (JSONObject) address.get(i);
        this.name = ress.getStr("name");
        this.count = ress.getInt("count");
      }
      return arraylistss;
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
  @Override
  public void run() {
    while (this != null) {
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      this.readValue();
      String PlcAddress = this.name;
      Integer Plccount = this.count;
      // 根据地址读取PCL数据
      List<Boolean> plclist = S7control.getinstance().ReadBits(PlcAddress, Plccount);
//      List<Boolean> plclist = S7control.getinstance().ReadBits(PlcAddress, Plccount);
      // System.out.println(plclist);
      // Boolean[] values = { false, false, true, false, true, false, true, false,
      // true, false, true, false, true, false,
      // true, false, true, false, true, false, true, false, true, false, true, false,
      // true, false, true, false, true,
      // false, true, false, true, false,
      // true, false, true, false };
      // List<Boolean> plclist = new ArrayList<>(Arrays.asList(values));
      if (plclist != null) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.append("params", plclist);
        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("alarm");
        if (sendwServer != null) {
          for (WebSocketServer webserver : sendwServer) {
            webserver.sendMessage(jsonObject.toString());
          }
        }
            // 将获取的布尔类型转换为整数类型
            List<Integer> Intlist = new ArrayList<>();
            for (Boolean value : plclist) {
              Intlist.add(value == true ? 1 : 0);
            }
            // 将Intlist转换为数组
//             System.out.println(Intlist);
//     System.out.println(Intlist.toArray().length);
            Integer[] shuzu1 = Intlist.toArray(new Integer[0]);
            // 定义的报警内容数组,获取json返回的集合
            List<String> myCollection;
            myCollection = readValue();
            String[] array1 = myCollection.toArray(new String[myCollection.size()]);
            //  System.out.println(array1.length);
            alarmMapper = WebSocketServer.applicationContext.getBean(AlarmMapper.class);
            for (short i = 0; i < array1.length; i++) {
              // 查询对应报警信息结束时间为null的条数
              short result = alarmMapper.selectnullti(array1[i]);
              // 读取到PLC的值为1并且对应报警信息结束时间为null的条数的条数为0
    //System.out.println(result);
              if (shuzu1[i] == 1 && result == 0) {
                // 填加一条报警信息,有开始时间
                alarmMapper.Insertalarm(array1[i]);
              } else if (shuzu1[i] == 0 && result > 0) {
                // 修改该条报警信息的结束时间
                alarmMapper.updatealarm(array1[i]);
              }
            }
          }
        }
      }
    }
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -29,7 +29,6 @@
         new PlcPositioning1().start();
         new PlcParameter2().start();
         new PLCAutomaticParameterSetting().start();
         new PlcManualonePosition().start();
@@ -40,6 +39,8 @@
         new PlcInteractionState().start();
        //new PlcParameter1Review().start();
       // new PLCAutomaticParameterSettingReview2().start();
        //new PLCAutomaticParameterSettingReview2().start();
    // new PLCManualJogReview().start();
    }
}
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcBitInfo.java
@@ -2,6 +2,9 @@
import com.example.springboot.component.S7control;
import java.util.ArrayList;
import java.util.List;
public  class PlcBitInfo {
        public PlcBitInfo(String startAddress) {
@@ -68,7 +71,10 @@
            return stringdatas[0]+"."+dbwindex+"."+bitindex;
        }
        public void setAddressIndex(int addressindex) {
    public void setAddressIndex(int addressindex) {
            this.addressIndex = addressindex;
        } 
    }
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcBitObject.java
@@ -93,6 +93,24 @@
        return arrayList;
    }
    public List<String> getAddressListByCodeId(List<String> codeIdList) {
        List<String> addressList = new ArrayList<>();
        for (String codeId : codeIdList) {
            for (PlcBitInfo plcBitInfo : plcBitList) {
                if (plcBitInfo.getCodeId().equals(codeId)) {
                    int index = plcBitInfo.getAddressIndex();
                    String address = plcBitInfo.getAddress(index);
                    if (address != null) {
                        addressList.add(address);
                    }
                }
            }
        }
        return addressList;
    }
    /**
     * 添加参数实例
     * 
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java
@@ -99,12 +99,22 @@
     */
    public String getAddress(int index) {
        String[] stringdatas = this.startAddress.trim().split("\\.");
        if (stringdatas.length < 2 )
        int addressLength=this.addressLength;
        if (addressLength < 2 ){
            return null;
        }
        int bitindex = index;
        if (addressLength == 2 ) {
            int wordindex = index;
        return stringdatas[0]+"."+bitindex;
            return stringdatas[0] + "." + wordindex;
        }
        if (addressLength == 14 ) {
            int wordindex = index;
            int newIndex = wordindex + 13;
            return stringdatas[0] + "." + wordindex +"-" + newIndex;
        }
        return null;
    }
    public int getPlcAddress() {
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java
@@ -97,6 +97,23 @@
    }
    public List<String> getAddressListByCodeId(List<String> codeIdList) {
        List<String> addressList = new ArrayList<>();
        for (String codeId : codeIdList) {
            for (PlcParameterInfo plcParameterInfo : plcParameterList) {
                if (plcParameterInfo.getCodeId().equals(codeId)) {
                    int index = plcParameterInfo.getAddressIndex();
                    String address = plcParameterInfo.getAddress(index);
                    if (address != null) {
                        addressList.add(address);
                    }
                }
            }
        }
        return addressList;
    }
springboot-vue3/src/main/resources/JsonFile/PlcAlarm.json
New file
@@ -0,0 +1,371 @@
{
  "plcAddressBegin": "DB104.0.0",
  "plcAddressLenght": "91",
  "dataType": "bit",
  "parameteInfor": [
    {
      "codeId": "D01VFDerror",
      "addressIndex": 0
    },
    {
      "codeId": "D02VFDerror",
      "addressIndex": 1
    },
    {
      "codeId": "D03VFDerror",
      "addressIndex": 2
    },
    {
      "codeId": "D04VFDerror",
      "addressIndex": 3
    },
    {
      "codeId": "D05VFDerror",
      "addressIndex": 4
    },
    {
      "codeId": "D06VFDerror",
      "addressIndex": 5
    },
    {
      "codeId": "B01VFDerror",
      "addressIndex": 6
    },
    {
      "codeId": "B02VFDerror",
      "addressIndex": 7
    },
    {
      "codeId": "A01VFDerror",
      "addressIndex": 8
    },
    {
      "codeId": "A02VFDerror",
      "addressIndex": 9
    },
    {
      "codeId": "A01servoturnerror",
      "addressIndex": 10
    },
    {
      "codeId": "A02servoturnerror",
      "addressIndex": 11
    },
    {
      "codeId": "A01servotravelerror",
      "addressIndex": 12
    },
    {
      "codeId": "A02servotravelerror",
      "addressIndex": 13
    },
    {
      "codeId": "B01servotravelerror",
      "addressIndex": 14
    },
    {
      "codeId": "B02servotravelerror",
      "addressIndex": 15
    },
    {
      "codeId": "D01DECerror",
      "addressIndex": 16
    },
    {
      "codeId": "D01poserror",
      "addressIndex": 17
    },
    {
      "codeId": "D02DECerror",
      "addressIndex": 18
    },
    {
      "codeId": "D02poserror",
      "addressIndex": 19
    },
    {
      "codeId": "D03DECerror",
      "addressIndex": 20
    },
    {
      "codeId": "D03poserror",
      "addressIndex": 21
    },
    {
      "codeId": "D04DECerror",
      "addressIndex": 22
    },
    {
      "codeId": "D04poserror",
      "addressIndex": 23
    },
    {
      "codeId": "D05DECerror",
      "addressIndex": 24
    },
    {
      "codeId": "D05poserror",
      "addressIndex": 25
    },
    {
      "codeId": "D06DECerror",
      "addressIndex": 26
    },
    {
      "codeId": "D06poserror",
      "addressIndex": 27
    },
    {
      "codeId": "A01DECerror",
      "addressIndex": 28
    },
    {
      "codeId": "A01poserror",
      "addressIndex": 29
    },
    {
      "codeId": "A02DECerror",
      "addressIndex": 30
    },
    {
      "codeId": "A02poserror",
      "addressIndex": 31
    },
    {
      "codeId": "B01INDECerror",
      "addressIndex": 32
    },
    {
      "codeId": "B01INposerror",
      "addressIndex": 33
    },
    {
      "codeId": "B01OUTDECerror",
      "addressIndex": 34
    },
    {
      "codeId": "B01OUTposerror",
      "addressIndex": 35
    },
    {
      "codeId": "B02INDECerror",
      "addressIndex": 36
    },
    {
      "codeId": "B02INposerror",
      "addressIndex": 37
    },
    {
      "codeId": "B02OUTDECerror",
      "addressIndex": 38
    },
    {
      "codeId": "B02OUTposerror",
      "addressIndex": 39
    },
    {
      "codeId": "D01Scanglassexceedinglimit",
      "addressIndex": 40
    },
    {
      "codeId": "emergencystopalarm",
      "addressIndex": 41
    },
    {
      "codeId": "Moreglassthanknown",
      "addressIndex": 42
    },
    {
      "codeId": "lessglassthanknown",
      "addressIndex": 43
    },
    {
      "codeId": "D01conveyortimeoutalarm",
      "addressIndex": 44
    },
    {
      "codeId": "D02conveyortimeoutalarm",
      "addressIndex": 45
    },
    {
      "codeId": "D03conveyortimeoutalarm",
      "addressIndex": 46
    },
    {
      "codeId": "D04conveyortimeoutalarm",
      "addressIndex": 47
    },
    {
      "codeId": "D05conveyortimeoutalarm",
      "addressIndex": 48
    },
    {
      "codeId": "D06conveyortimeoutalarm",
      "addressIndex": 49
    },
    {
      "codeId": "A01conveyortimeoutalarm",
      "addressIndex": 50
    },
    {
      "codeId": "A02conveyortimeoutalarm",
      "addressIndex": 51
    },
    {
      "codeId": "B01conveyortimeoutalarm",
      "addressIndex": 52
    },
    {
      "codeId": "B02conveyortimeoutalarm",
      "addressIndex": 53
    },
    {
      "codeId": "A01conveyorLeftsafetyalarm",
      "addressIndex": 54
    },
    {
      "codeId": "A01conveyorrightsafetyalarm",
      "addressIndex": 55
    },
    {
      "codeId": "A02conveyorLeftsafetyalarm",
      "addressIndex": 56
    },
    {
      "codeId": "A02conveyorrightsafetyalarm",
      "addressIndex": 57
    },
    {
      "codeId": "1#buffersafetyalarm",
      "addressIndex": 58
    },
    {
      "codeId": "2#buffersafetyalarm",
      "addressIndex": 59
    },
    {
      "codeId": "3#buffersafetyalarm",
      "addressIndex": 60
    },
    {
      "codeId": "4#buffersafetyalarm",
      "addressIndex": 61
    },
    {
      "codeId": "A01.SRrightinposerror",
      "addressIndex": 62
    },
    {
      "codeId": "A02.SRleftinposerror",
      "addressIndex": 63
    },
    {
      "codeId": "B01.SRleftinposerror",
      "addressIndex": 64
    },
    {
      "codeId": "B01.SRleftdecerror",
      "addressIndex": 65
    },
    {
      "codeId": "B01.SRrightdecerror",
      "addressIndex": 66
    },
    {
      "codeId": "B01.SRrightinposerror",
      "addressIndex": 67
    },
    {
      "codeId": "B02.SRleftinposerror",
      "addressIndex": 68
    },
    {
      "codeId": "B02.SRleftdecerror",
      "addressIndex": 69
    },
    {
      "codeId": "B02.SRrightdecerror",
      "addressIndex": 70
    },
    {
      "codeId": "B02.SRrightinposerror",
      "addressIndex": 71
    },
    {
      "codeId": "A01servoturnhomed",
      "addressIndex": 72
    },
    {
      "codeId": "A02servoturnhomed",
      "addressIndex": 73
    },
    {
      "codeId": "A01servotravelhomed",
      "addressIndex": 74
    },
    {
      "codeId": "A02servotravelhomed",
      "addressIndex": 75
    },
    {
      "codeId": "B01servotravelhomed",
      "addressIndex": 76
    },
    {
      "codeId": "B02servotravelhomed",
      "addressIndex": 77
    },
    {
      "codeId": "resetDelay",
      "addressIndex": 78
    },
    {
      "codeId": "A01travelNegativelimit",
      "addressIndex": 79
    },
    {
      "codeId": "A01travelPositivelimit",
      "addressIndex": 80
    },
    {
      "codeId": "A01turnuplimit",
      "addressIndex": 81
    },
    {
      "codeId": "A01turndownlimit",
      "addressIndex": 82
    },
    {
      "codeId": "A02travelNegativelimit",
      "addressIndex": 83
    },
    {
      "codeId": "A02travelPositivelimit",
      "addressIndex": 84
    },
    {
      "codeId": "A02turnuplimit",
      "addressIndex": 85
    },
    {
      "codeId": "A02turndownlimit",
      "addressIndex": 86
    },
    {
      "codeId": "B01travelNegativelimit",
      "addressIndex": 87
    },
    {
      "codeId": "B01travelPositivelimit",
      "addressIndex": 88
    },
    {
      "codeId": "B02travelNegativelimit",
      "addressIndex": 89
    },
    {
      "codeId": "B02travelPositivelimit",
      "addressIndex": 90
    }
  ]
}
springboot-vue3/src/main/resources/JsonFile/PlcSign.json
@@ -1,47 +1,455 @@
{
  "plcAddressBegin":"DB102.0.0",
  "plcAddressLenght":"11",
  "dataType":"bit",
  "parameteInfor":[
  "plcAddressBegin": "DB102.0.0",
  "plcAddressLenght": "112",
  "dataType": "bit",
  "parameteInfor": [
    {
      "codeId": "D01.SRdec",
      "addressIndex":"0"
      "addressIndex": 0
    },
    {
      "codeId": "D01.SRinpos",
      "addressIndex":"1"
      "addressIndex": 1
    },
    {
      "codeId": "conveyorVelocity(Manual)",
      "addressIndex":"2"
      "codeId": "D02.SRdec",
      "addressIndex": 2
    },
    {
      "codeId": "A01A02TURNJOGVelocity",
      "addressIndex":"3"
      "codeId": "D02.SRinpos",
      "addressIndex": 3
    },
    {
      "codeId": "A01A02TRAVELJOGVelocity",
      "addressIndex":"4"
      "codeId": "D03.SRinto",
      "addressIndex": 4
    },
    {
      "codeId": "B01B02TRAVELJOGVelocity",
      "addressIndex":"5"
      "codeId": "D03.SRdec",
      "addressIndex": 5
    },
    {
      "codeId": "A01A02TURNPOSVelocityAUTO",
      "addressIndex":"7"
      "codeId": "D03.SRinpos",
      "addressIndex": 6
    },
    {
      "codeId": "A01A02TURNPOSVelocitymanual",
      "addressIndex":"8"
      "codeId": "D04.SRdec",
      "addressIndex": 7
    },
    {
      "codeId": "A01A02TRAVELPOSVelocityAUTO",
      "addressIndex":"9"
      "codeId": "D04.SRinpos",
      "addressIndex": 8
    },
    {
      "codeId": "D05.SRdec",
      "addressIndex": 9
    },
    {
      "codeId": "D05.SRinpos",
      "addressIndex":"10"
      "addressIndex": 10
    },
    {
      "codeId": "D06.SRdec",
      "addressIndex": 11
    },
    {
      "codeId": "D06.SRinpos",
      "addressIndex": 12
    },
    {
      "codeId": "B01.SRindec",
      "addressIndex": 13
    },
    {
      "codeId": "B01.SRininpos",
      "addressIndex": 14
    },
    {
      "codeId": "B01.SRoutdec",
      "addressIndex": 15
    },
    {
      "codeId": "B01.SRoutinpos",
      "addressIndex": 16
    },
    {
      "codeId": "B01.SRturnon",
      "addressIndex": 17
    },
    {
      "codeId": "B01.SRturnoff",
      "addressIndex": 18
    },
    {
      "codeId": "B01.SRup",
      "addressIndex": 19
    },
    {
      "codeId": "B01.SRdown",
      "addressIndex": 20
    },
    {
      "codeId": "B02.SRoutdec",
      "addressIndex": 21
    },
    {
      "codeId": "B02.SRoutinpos",
      "addressIndex": 22
    },
    {
      "codeId": "B02.SRindec",
      "addressIndex": 23
    },
    {
      "codeId": "B02.SRininpos",
      "addressIndex": 24
    },
    {
      "codeId": "B02.SRturnon",
      "addressIndex": 25
    },
    {
      "codeId": "B02.SRturnoff",
      "addressIndex": 26
    },
    {
      "codeId": "B02.SRup",
      "addressIndex": 27
    },
    {
      "codeId": "B02.SRdown",
      "addressIndex": 28
    },
    {
      "codeId": "B01.SRinsafety",
      "addressIndex": 29
    },
    {
      "codeId": "B01.SRoutsafety",
      "addressIndex": 30
    },
    {
      "codeId": "B02.SRinsafety",
      "addressIndex": 31
    },
    {
      "codeId": "SB.start(+)",
      "addressIndex": 32
    },
    {
      "codeId": "SB.stop(-)",
      "addressIndex": 33
    },
    {
      "codeId": "SB.reset",
      "addressIndex": 34
    },
    {
      "codeId": "SB.auto/manul",
      "addressIndex": 35
    },
    {
      "codeId": "D01.SB.confirm",
      "addressIndex": 36
    },
    {
      "codeId": "SB.emg",
      "addressIndex": 37
    },
    {
      "codeId": "D01.SB.start",
      "addressIndex": 38
    },
    {
      "codeId": "D06.SB.start",
      "addressIndex": 39
    },
    {
      "codeId": "B02.SRoutsafety",
      "addressIndex": 40
    },
    {
      "codeId": "SafetyDoor.requset",
      "addressIndex": 41
    },
    {
      "codeId": "SafetyDoor.confirm",
      "addressIndex": 42
    },
    {
      "codeId": "SafetyDoor.reset",
      "addressIndex": 43
    },
    {
      "codeId": "Sspce",
      "addressIndex": 44
    },
    {
      "codeId": "Sspce",
      "addressIndex": 45
    },
    {
      "codeId": "Sspce",
      "addressIndex": 46
    },
    {
      "codeId": "Sspce",
      "addressIndex": 47
    },
    {
      "codeId": "A01.SRleftdec",
      "addressIndex": 48
    },
    {
      "codeId": "A01.SRleftinpos",
      "addressIndex": 49
    },
    {
      "codeId": "A01.SRleftsafety",
      "addressIndex": 50
    },
    {
      "codeId": "A01.SRrightdec",
      "addressIndex": 51
    },
    {
      "codeId": "A01.SRrightinpos",
      "addressIndex": 52
    },
    {
      "codeId": "A01.SRrightsafety",
      "addressIndex": 53
    },
    {
      "codeId": "A01.SRturnhome",
      "addressIndex": 54
    },
    {
      "codeId": "A01.SRturnup",
      "addressIndex": 55
    },
    {
      "codeId": "A01.SRturndown",
      "addressIndex": 56
    },
    {
      "codeId": "A01.SRtravelhome",
      "addressIndex": 57
    },
    {
      "codeId": "A01.SRtravelleftdec",
      "addressIndex": 58
    },
    {
      "codeId": "A01.SRtravelleftlimit",
      "addressIndex": 59
    },
    {
      "codeId": "A01.SRtravelrightdec",
      "addressIndex": 60
    },
    {
      "codeId": "A01.SRtravelrightlimit",
      "addressIndex": 61
    },
    {
      "codeId": "space",
      "addressIndex": 62
    },
    {
      "codeId": "space",
      "addressIndex": 63
    },
    {
      "codeId": "A02.SRleftdec",
      "addressIndex": 64
    },
    {
      "codeId": "A02.SRleftinpos",
      "addressIndex": 65
    },
    {
      "codeId": "A02.SRleftsafety",
      "addressIndex": 66
    },
    {
      "codeId": "A02.SRrightdec",
      "addressIndex": 67
    },
    {
      "codeId": "A02.SRrightinpos",
      "addressIndex": 68
    },
    {
      "codeId": "A02.SRrightsafety",
      "addressIndex": 69
    },
    {
      "codeId": "A02.SRturnhome",
      "addressIndex": 70
    },
    {
      "codeId": "A02.SRturnup",
      "addressIndex": 71
    },
    {
      "codeId": "A02.SRturndown",
      "addressIndex": 72
    },
    {
      "codeId": "A02.SRtravelhome",
      "addressIndex": 73
    },
    {
      "codeId": "A02.SRtravelleftdec",
      "addressIndex": 74
    },
    {
      "codeId": "A02.SRtravelleftlimit",
      "addressIndex": 75
    },
    {
      "codeId": "A02.SRtravelrightdec",
      "addressIndex": 76
    },
    {
      "codeId": "A02.SRtravelrightlimit",
      "addressIndex": 77
    },
    {
      "codeId": "space",
      "addressIndex": 78
    },
    {
      "codeId": "space",
      "addressIndex": 79
    },
    {
      "codeId": "B01.SRorigin",
      "addressIndex": 80
    },
    {
      "codeId": "B01.SRleftlimit",
      "addressIndex": 81
    },
    {
      "codeId": "B01.SRrightlimit",
      "addressIndex": 82
    },
    {
      "codeId": "B02.SRorigin",
      "addressIndex": 83
    },
    {
      "codeId": "B02.SRleftlimit",
      "addressIndex": 84
    },
    {
      "codeId": "B02.SRrightlimit",
      "addressIndex": 85
    },
    {
      "codeId": "space",
      "addressIndex": 86
    },
    {
      "codeId": "space",
      "addressIndex": 87
    },
    {
      "codeId": "LED.red",
      "addressIndex": 88
    },
    {
      "codeId": "LED.green",
      "addressIndex": 89
    },
    {
      "codeId": "LED.yellow",
      "addressIndex": 90
    },
    {
      "codeId": "D01.LED.green",
      "addressIndex": 91
    },
    {
      "codeId": "D06.LED.green",
      "addressIndex": 92
    },
    {
      "codeId": "B01.YV.turn",
      "addressIndex": 93
    },
    {
      "codeId": "B01.YV.updown",
      "addressIndex": 94
    },
    {
      "codeId": "B01.YV.gassing",
      "addressIndex": 95
    },
    {
      "codeId": "B02.YV.turn",
      "addressIndex": 96
    },
    {
      "codeId": "B02.YV.updown",
      "addressIndex": 97
    },
    {
      "codeId": "B02.YV.gassing",
      "addressIndex": 98
    },
    {
      "codeId": "SafetyDoor.Led",
      "addressIndex": 99
    },
    {
      "codeId": "SafetyDoor.open",
      "addressIndex": 100
    },
    {
      "codeId": "D01SB.confirm",
      "addressIndex": 101
    },
    {
      "codeId": "space",
      "addressIndex": 102
    },
    {
      "codeId": "space",
      "addressIndex": 103
    },
    {
      "codeId": "A01oilPump",
      "addressIndex": 104
    },
    {
      "codeId": "A01motorCtr",
      "addressIndex": 105
    },
    {
      "codeId": "space",
      "addressIndex": 106
    },
    {
      "codeId": "space",
      "addressIndex": 107
    },
    {
      "codeId": "A02oilPump",
      "addressIndex": 108
    },
    {
      "codeId": "A02motorCtr",
      "addressIndex": 109
    },
    {
      "codeId": "space",
      "addressIndex": 110
    },
    {
      "codeId": "space",
      "addressIndex": 111
    }
  ]
}
}
springboot-vue3/src/main/resources/JsonFile/PlcTest.json
New file
@@ -0,0 +1,375 @@
{
  "plcAddressBegin": "DB101.0.0",
  "plcAddressLenght": "92",
  "dataType": "bit",
  "parameteInfor": [
    {
      "codeId": "D01VFDconveyor",
      "addressIndex": 0
    },
    {
      "codeId": "D02VFDconveyor",
      "addressIndex": 1
    },
    {
      "codeId": "D03VFDconveyor",
      "addressIndex": 2
    },
    {
      "codeId": "D04VFDconveyor",
      "addressIndex": 3
    },
    {
      "codeId": "D05VFDconveyor",
      "addressIndex": 4
    },
    {
      "codeId": "D06VFDconveyor",
      "addressIndex": 5
    },
    {
      "codeId": "A01VFDconveyor",
      "addressIndex": 6
    },
    {
      "codeId": "A02VFDconveyor",
      "addressIndex": 7
    },
    {
      "codeId": "B01VFDconveyor",
      "addressIndex": 8
    },
    {
      "codeId": "B02VFDconveyor",
      "addressIndex": 9
    },
    {
      "codeId": "A01SERVETURN",
      "addressIndex": 10
    },
    {
      "codeId": "A02SERVETURN",
      "addressIndex": 11
    },
    {
      "codeId": "A01SERVETRAVEL",
      "addressIndex": 12
    },
    {
      "codeId": "A02SERVETRAVEL",
      "addressIndex": 13
    },
    {
      "codeId": "B01SERVETRAVEL",
      "addressIndex": 14
    },
    {
      "codeId": "B02SERVETRAVEL",
      "addressIndex": 15
    },
    {
      "codeId": "A01SERVETURNPOS",
      "addressIndex": 16
    },
    {
      "codeId": "A02SERVETURNPOS",
      "addressIndex": 17
    },
    {
      "codeId": "A01SERVETRAVELPOS",
      "addressIndex": 18
    },
    {
      "codeId": "A02SERVETRAVELPOS",
      "addressIndex": 19
    },
    {
      "codeId": "B01SERVETRAVELPOS",
      "addressIndex": 20
    },
    {
      "codeId": "B02SERVETRAVELPOS",
      "addressIndex": 21
    },
    {
      "codeId": "B01YVTURN",
      "addressIndex": 22
    },
    {
      "codeId": "B01YVUPDOWN",
      "addressIndex": 23
    },
    {
      "codeId": "B02YVTURN",
      "addressIndex": 24
    },
    {
      "codeId": "B02YVUPDOWN",
      "addressIndex": 25
    },
    {
      "codeId": "B01YVGassing",
      "addressIndex": 26
    },
    {
      "codeId": "B02YVGassing",
      "addressIndex": 27
    },
    {
      "codeId": "A01VFDconveyorreverse",
      "addressIndex": 28
    },
    {
      "codeId": "A02VFDconveyorreverse",
      "addressIndex": 29
    },
    {
      "codeId": "A01SERVETURNreset",
      "addressIndex": 30
    },
    {
      "codeId": "A01SERVETURNhome",
      "addressIndex": 31
    },
    {
      "codeId": "A01SERVETRAVELreset",
      "addressIndex": 32
    },
    {
      "codeId": "A02SERVETURNreset",
      "addressIndex": 33
    },
    {
      "codeId": "A02SERVETURNhome",
      "addressIndex": 34
    },
    {
      "codeId": "A02SERVETRAVELreset",
      "addressIndex": 35
    },
    {
      "codeId": "B01SERVETRAVELreset",
      "addressIndex": 36
    },
    {
      "codeId": "B01SERVETRAVELhome",
      "addressIndex": 37
    },
    {
      "codeId": "B02SERVETRAVELreset",
      "addressIndex": 38
    },
    {
      "codeId": "B02SERVETRAVELhome",
      "addressIndex": 39
    },
    {
      "codeId": "Manualstoragestartup",
      "addressIndex": 40
    },
    {
      "codeId": "Manualoutputstartup",
      "addressIndex": 41
    },
    {
      "codeId": "A01oilpump",
      "addressIndex": 42
    },
    {
      "codeId": "A02oilpump",
      "addressIndex": 43
    },
    {
      "codeId": "A01get1#gridaddress",
      "addressIndex": 44
    },
    {
      "codeId": "A01get22#gridaddress",
      "addressIndex": 45
    },
    {
      "codeId": "A01get43#gridaddress",
      "addressIndex": 46
    },
    {
      "codeId": "A01get64#gridaddress",
      "addressIndex": 47
    },
    {
      "codeId": "A01get85#gridaddress",
      "addressIndex": 48
    },
    {
      "codeId": "A01get106#gridaddress",
      "addressIndex": 49
    },
    {
      "codeId": "A01get127#gridaddress",
      "addressIndex": 50
    },
    {
      "codeId": "A01get148#gridaddress",
      "addressIndex": 51
    },
    {
      "codeId": "A01get169#gridaddress",
      "addressIndex": 52
    },
    {
      "codeId": "A02get190#gridaddress",
      "addressIndex": 53
    },
    {
      "codeId": "A02get1#gridaddress",
      "addressIndex": 54
    },
    {
      "codeId": "A02get22#gridaddress",
      "addressIndex": 55
    },
    {
      "codeId": "A02get43#gridaddress",
      "addressIndex": 56
    },
    {
      "codeId": "A02get64#gridaddress",
      "addressIndex": 57
    },
    {
      "codeId": "A02get85#gridaddress",
      "addressIndex": 58
    },
    {
      "codeId": "A02get106#gridaddress",
      "addressIndex": 59
    },
    {
      "codeId": "A02get127#gridaddress",
      "addressIndex": 60
    },
    {
      "codeId": "A02get148#gridaddress",
      "addressIndex": 61
    },
    {
      "codeId": "A02get169#gridaddress",
      "addressIndex": 62
    },
    {
      "codeId": "A02get190#gridaddress",
      "addressIndex": 63
    },
    {
      "codeId": "B01get1#gridaddress",
      "addressIndex": 64
    },
    {
      "codeId": "B01get22#gridaddress",
      "addressIndex": 65
    },
    {
      "codeId": "B01get43#gridaddress",
      "addressIndex": 66
    },
    {
      "codeId": "B01get64#gridaddress",
      "addressIndex": 67
    },
    {
      "codeId": "B01get85#gridaddress",
      "addressIndex": 68
    },
    {
      "codeId": "B02get106#gridaddress",
      "addressIndex": 69
    },
    {
      "codeId": "B02get127#gridaddress",
      "addressIndex": 70
    },
    {
      "codeId": "B02get148#gridaddress",
      "addressIndex": 71
    },
    {
      "codeId": "B02get169#gridaddress",
      "addressIndex": 72
    },
    {
      "codeId": "B02get190#gridaddress",
      "addressIndex": 73
    },
    {
      "codeId": "D01IDClean",
      "addressIndex": 74
    },
    {
      "codeId": "D02IDClean",
      "addressIndex": 75
    },
    {
      "codeId": "D03IDClean",
      "addressIndex": 76
    },
    {
      "codeId": "D04IDClean",
      "addressIndex": 77
    },
    {
      "codeId": "D05IDClean",
      "addressIndex": 78
    },
    {
      "codeId": "D06IDClean",
      "addressIndex": 79
    },
    {
      "codeId": "A01IDClean",
      "addressIndex": 80
    },
    {
      "codeId": "A02IDClean",
      "addressIndex": 81
    },
    {
      "codeId": "B01IDClean",
      "addressIndex": 82
    },
    {
      "codeId": "B02IDClean",
      "addressIndex": 83
    },
    {
      "codeId": "abort/resumeTasks",
      "addressIndex": 84
    },
    {
      "codeId": "A01SERVETRAVELhome",
      "addressIndex": 85
    },
    {
      "codeId": "A02SERVETRAVELhome",
      "addressIndex": 86
    },
    {
      "codeId": "A01A02travelHoming",
      "addressIndex": 87
    },
    {
      "codeId": "A01halfAutoSelect",
      "addressIndex": 88
    },
    {
      "codeId": "A02halfAutoSelect",
      "addressIndex": 89
    },
    {
      "codeId": "A02abortTasks",
      "addressIndex": 90
    },
    {
      "codeId": "emgHMI",
      "addressIndex": 91
    }
  ]
}
springboot-vue3/src/main/resources/JsonFile/alarm.xlsx
Binary files differ
springboot-vue3/src/main/resources/JsonFile/sign.xlsx
Binary files differ
springboot-vue3/src/main/resources/JsonFile/test.xlsx
Binary files differ