From 09de5ee424b7bef24c159fdd4d5a449454a9fbb7 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期五, 15 九月 2023 17:09:40 +0800
Subject: [PATCH] 修改plc地址
---
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java | 10 +++++-----
1 files changed, 5 insertions(+), 5 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 5e4d59e..17b9d6d 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
@@ -21,9 +21,9 @@
// 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 = new ArrayList<>(Arrays.asList(values));
+ 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) {
} else {
@@ -47,7 +47,7 @@
List<String> messages = webSocketServer.getMessages();
- String addressList = "DB100.DBW0";
+ String addressList = "DB2.0.0";
if (!messages.isEmpty()) {
// 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
@@ -70,7 +70,7 @@
// 灏嗘秷鎭�艰浆鎹负甯冨皵鍒楄〃
List<Boolean> messageBooleans = new ArrayList<>();
for (Integer value : messageValues) {
- messageBooleans.add(value == 0 ? true : false);
+ messageBooleans.add(value == 1 ? true : false);
}
// 灏嗗竷灏斿垪琛ㄥ啓鍏� PLC
--
Gitblit v1.8.0