From b454340c14d789c5fe41350d092ea2f14d6454b3 Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期一, 06 五月 2024 10:21:45 +0800 Subject: [PATCH] 添加plc连接不上时报警,主界面后端推送数据超时提示 --- springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java b/springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java index da7aa1c..544ba9d 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java @@ -14,6 +14,7 @@ import java.util.List; public class InitUtil { + //鍒濆鍖杦ord 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; } - + //鍒濆鍖朾it 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, -- Gitblit v1.8.0