From 8dfb37b10ffb2fcb41c85b3fa266d1ef2874aebc Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期四, 30 十一月 2023 08:53:27 +0800
Subject: [PATCH] 修改电气管理PLC通讯逻辑

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 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 08e7f66..0399888 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
@@ -73,18 +73,18 @@
       } catch (InterruptedException e) {
         e.printStackTrace();
       }
-      this.readValue();
-      String PlcAddress = this.name;
-      Integer Plccount = this.count;
+//      this.readValue();
+//      String PlcAddress = this.name;
+//      Integer Plccount = this.count;
 
       // System.out.println(stt);
-      // List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
-      // List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
-      Short[] values1 = { 1231, 1, 1, 1, 1, 1, 2, 33, 2, 3, 4, 5 };
-      List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
+      List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 72);
+     List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
+//      Short[] values1 = { 1231, 1, 1, 1, 1, 1, 2, 33, 2, 3, 4, 5 ,1231, 1, 1, 1, 1, 1, 2, 33, 2, 3, 4, 5 };
+//      List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
 
-      Short[] values2 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-      List<Short> state = new ArrayList<>(Arrays.asList(values2));
+//      Short[] values2 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+//      List<Short> state = new ArrayList<>(Arrays.asList(values2));
 
       // Boolean[] values = { false, true, true, true, true, true, true, true, true,
       // true, true, true, true, true, true, true, true, true, true, true, true, true,
@@ -137,7 +137,7 @@
           }
 
           // 灏嗘秷鎭�煎啓鍏� PLC
-          // S7control.getinstance().WriteWord(addressList, messageValues);
+       S7control.getinstance().WriteWord(addressList, messageValues);
           System.out.println("messageValues锛�" + messageValues);
           System.out.println("addressList锛�" + addressList);
           // 娓呯┖娑堟伅鍒楄〃

--
Gitblit v1.8.0