From 70d4832d2d0f3d484dce6769beac3b4806e783a7 Mon Sep 17 00:00:00 2001
From: zhangyong <517047165@qq.com>
Date: 星期五, 15 九月 2023 16:58:58 +0800
Subject: [PATCH] 修复读取word类型时,地址后面多一个.0的bug
---
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
index ee35614..ba512ab 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
@@ -11,7 +11,7 @@
public void run() {
while (this != null) {
try {
- Thread.sleep(1000);
+ Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
@@ -21,8 +21,8 @@
// JSONObject jsonObject = new JSONObject();
// jsonObject.append("params", new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0});
- List<Boolean> paramlist = S7control.getinstance().ReadBits("DB100.DBW", 12);
-// Boolean[] values = {false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true};
+ List<Boolean> paramlist = S7control.getinstance().ReadBits("DB2.0.0", 26);
+// Boolean[] values = {true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,false, true};
// List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values));
if (paramlist == null) {
@@ -47,7 +47,7 @@
List<String> messages = webSocketServer.getMessages();
- String addressList = "DB100.DBW0";
+ String addressList = "DB2.0.0";
if (!messages.isEmpty()) {
// 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
--
Gitblit v1.8.0