From 0bb9ea08c62cc463203def30429fec3b66f9513d Mon Sep 17 00:00:00 2001
From: clll <1320612696@qq.com>
Date: 星期一, 11 九月 2023 17:42:30 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.150:10101/r/CanadaMes
---
springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
index b641602..c7f169c 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
@@ -16,19 +16,22 @@
}
List<Boolean> plclist = S7control.getinstance().ReadBits("DB102.DBX0.0", 58);
+ if (plclist == null) {
- JSONObject jsonObject = new JSONObject();
- // jsonObject3.append("sig",
- // new short[] { 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
- // 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
- // 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
- // });
- jsonObject.append("sig", plclist);
- WebSocketServer sendwServer3 = WebSocketServer.sessionMap.get("Sign");
- if (sendwServer3 != null) {
- sendwServer3.sendMessage(jsonObject.toString());
+ } else {
+ JSONObject jsonObject = new JSONObject();
+ // jsonObject3.append("sig",
+ // new short[] { 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+ // 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
+ // 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+ // });
+ jsonObject.append("sig", plclist);
+ WebSocketServer sendwServer3 = WebSocketServer.sessionMap.get("Sign");
+ if (sendwServer3 != null) {
+ sendwServer3.sendMessage(jsonObject.toString());
+ }
+
}
-
}
}
}
--
Gitblit v1.8.0