From 7f1ee24bca80d28851a95ee2019ea6faeb70d81c Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期一, 29 十二月 2025 17:34:39 +0800
Subject: [PATCH] 1.新增agv状态反馈

---
 src/main/java/com/zy/core/thread/SiemensDevpThread.java |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index 6896818..1c6ae47 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -131,6 +131,9 @@
                     case 2:
                         write((StaProtocol)task.getData());
                         break;
+                    case 3:
+                        write1((StaProtocol)task.getData());
+                        break;
                     default:
                         break;
                 }
@@ -340,6 +343,29 @@
         }
     }
 
+    /**
+     * 鎵爜鍣ㄨЕ鍙�
+     */
+    private void write1(StaProtocol staProtocol) throws InterruptedException {
+        if (null == staProtocol) {
+            return;
+        }
+        ArrayList<Integer> staNos = getStaNo();
+        int index = staNos.indexOf(staProtocol.getSiteId());
+        if(staProtocol.getSiteId() == 307){
+            index = 0;
+        }
+        OperateResult writeResult1 = siemensS7Net.Write("DB100.500" + index,  1);    // 鎵爜鍣ㄨЕ鍙�
+        if (!writeResult1.IsSuccess) {
+
+            OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆戝啓鍏ヨ緭閫佺嚎绔欑偣鏁版嵁澶辫触銆傝緭閫佺嚎plc缂栧彿={1}锛岀珯鐐规暟鎹�={2}", slave.getId(), JSON.toJSON(staProtocol)));
+            log.error("鍐欏叆杈撻�佺嚎绔欑偣鏁版嵁澶辫触銆傝緭閫佺嚎plc缂栧彿={}锛岀珯鐐规暟鎹�={}", slave.getId(), JSON.toJSON(staProtocol));
+        } else {
+            OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆� 杈撻�佺嚎鍛戒护涓嬪彂 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
+            log.info("杈撻�佺嚎鍛戒护涓嬪彂 [id:{}] >>>>> 鍛戒护涓嬪彂锛� {}",  slave.getId(), JSON.toJSON(staProtocol));
+        }
+    }
+
     // 鏇存柊鍏ュ嚭搴撴ā寮�
     private void updateIoMode() throws InterruptedException {
         if (this.ioModeOf2F != IoModeType.NONE) {

--
Gitblit v1.9.1