From 5465a833a00ee1ab59774398ced083d88bc0027d Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 17 六月 2024 16:58:41 +0800
Subject: [PATCH] 添加中英文显示

---
 springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java |   34 +++++++++++++---------------------
 1 files changed, 13 insertions(+), 21 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 8329678..de8e415 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
@@ -14,6 +14,14 @@
 import java.util.Arrays;
 
 public class Plcsign extends Thread {
+
+  // 鐢ㄤ簬瀛樺偍搴旂敤绋嬪簭鐨勯厤缃俊鎭�
+  private Configuration config;
+
+    public Plcsign() throws IOException {
+        config = new Configuration("config.properties");
+    }
+
   String name = "";
   Integer count = 0;
 
@@ -60,30 +68,14 @@
   public void run() {
     while (this != null) {
       try {
-        Thread.sleep(1000);
+        Thread.sleep(100);
       } catch (InterruptedException e) {
         e.printStackTrace();
       }
-
-//      this.readValue();
-//      String PlcAddress = this.name;
-//      Integer Plccount = this.count;
-      // System.out.println(PlcAddress);
-
-//      List<Boolean> plclist = S7control.getinstance().ReadBits(PlcAddress, Plccount);
-       List<Boolean> plclist = S7control.getinstance().ReadBits("DB102.0.0", 112);
-
-//       Boolean[] values = { true, true, true, true, true, false, true, false,
-//       true, false, true, false, true, false,
-//       true, false, true, false, true, false, true, false, true, false, true, false,
-//       true, false, true, false, true,
-//       false, true, false, true, false,
-//       true, false, true, false, true, false, true, false, null,
-//       true, false,
-//       true, false, true, false, true, false,
-//       true, false, true, false, true, };
-//       List<Boolean> plclist = new ArrayList<>(Arrays.asList(values));
-
+       List<String> addressList21 = Arrays.asList(config.getProperty("PlcIO.State").split(","));
+       List<Boolean> plclist = S7control.getinstance().readBits(addressList21);
+      //  System.out.println("鎬ュ仠"+S7control.getinstance().ReadBits("DB10.0.5", 1));
+      
       if (plclist != null) {
         // 灏嗚幏鍙栫殑甯冨皵绫诲瀷杞崲涓烘暣鏁扮被鍨�
         List<Integer> Intlist = new ArrayList<>();

--
Gitblit v1.8.0