From 2bf59e175d9b3960e6e98b91b763697a8c837f2e Mon Sep 17 00:00:00 2001
From: clll <1320612696@qq.com>
Date: 星期四, 14 九月 2023 17:02:49 +0800
Subject: [PATCH] 修改PLC地址
---
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
index d416822..865c95f 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
@@ -15,11 +15,13 @@
e.printStackTrace();
}
- List<Short> paramlist = S7control.getinstance().ReadWord("DB100.DBW", 12);
+ List<Short> arraylist = S7control.getinstance().ReadWord("DB100.DBW0", 12);
List<Short> state = S7control.getinstance().ReadWord("DB103.DBW0", 10);
JSONObject jsonObject = new JSONObject();
- jsonObject.append("params", new short[]{1111,121, 3232, 0, 1, 0, 1, 0, 1, 0, 1, 0});
- jsonObject.append("state", new short[]{0, 1, 0, 0, 0, 0, 0,0, 0, 0});
+// new short[]{65545,65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545,65545, 65545, 65545}
+ // new short[]{65545,65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545}
+ jsonObject.append("params", arraylist );
+ jsonObject.append("state", state);
WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter");
if (sendwServer != null) {
sendwServer.sendMessage(jsonObject.toString());
--
Gitblit v1.8.0