From 204d4f97eb72d58b2145873c12eefd1c4fa8b448 Mon Sep 17 00:00:00 2001
From: zhangchao <zc857179121@qq.com>
Date: 星期四, 29 八月 2024 13:50:18 +0800
Subject: [PATCH] 配置

---
 src/main/java/com/zy/core/thread/SiemensCrnThread.java |   43 ++++++++++++++++++++++++++++---------------
 1 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index 76682f4..2da9ed0 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -149,7 +149,7 @@
      */
     private void readStatus(){
         try {
-            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 56);
+            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 66);
             if (result.IsSuccess) {
                 if (null == crnProtocol) {
                     crnProtocol = new CrnProtocol();
@@ -174,11 +174,16 @@
                 crnProtocol.setWalkPos(siemensNet.getByteTransform().TransInt16(result.Content, 26));
                 crnProtocol.setWalkPosTwo(siemensNet.getByteTransform().TransInt16(result.Content, 28));
                 crnProtocol.setLiftPos(siemensNet.getByteTransform().TransInt16(result.Content, 30));
-                crnProtocol.setError1(siemensNet.getByteTransform().TransInt16(result.Content, 32));
+                crnProtocol.setAlarm(siemensNet.getByteTransform().TransInt16(result.Content, 32));
                 crnProtocol.setxSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 34));
                 crnProtocol.setySpeed(siemensNet.getByteTransform().TransInt16(result.Content, 38));
-                crnProtocol.setxSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 42));
-                crnProtocol.setySpeed(siemensNet.getByteTransform().TransInt16(result.Content, 52));
+                crnProtocol.setzSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 42));
+                crnProtocol.setzSpeedTwo(siemensNet.getByteTransform().TransInt16(result.Content, 46));
+                crnProtocol.setxDistance(siemensNet.getByteTransform().TransInt16(result.Content, 50));
+                crnProtocol.setyDistance(siemensNet.getByteTransform().TransInt16(result.Content, 54));
+                crnProtocol.setxDuration(siemensNet.getByteTransform().TransInt16(result.Content, 58));
+                crnProtocol.setyDuration(siemensNet.getByteTransform().TransInt16(result.Content, 62));
+
 
                 OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
 
@@ -239,19 +244,27 @@
         }
 //        convertRow(command);
         command.setCrnNo(slave.getId());
-        short[] array = new short[10];
-        array[0] = command.getAckFinish();
-        array[1] = command.getTaskNo();
-        array[2] = command.getTaskMode();
-        array[3] = command.getSourcePosX();
-        array[4] = command.getSourcePosY();
-        array[5] = command.getSourcePosZ();
-        array[6] = command.getDestinationPosX();
-        array[7] = command.getDestinationPosY();
-        array[8] = command.getDestinationPosZ();
+        short[] array = new short[17];
+        array[0] = command.getTaskNo();
+        array[1] = command.getTaskMode();
+        array[2] = command.getSourcePosX();
+        array[3] = command.getSourcePosY();
+        array[4] = command.getSourcePosZ();
+        array[5] = command.getDestinationPosX();
+        array[6] = command.getDestinationPosY();
+        array[7] = command.getDestinationPosZ();
+        array[8] = command.getSourcePosXTwo();
+        array[9] = command.getSourcePosYTwo();
+        array[10] = command.getSourcePosZTwo();
+        array[11] = command.getDestinationPosXTwo();
+        array[12] = command.getDestinationPosYTwo();
+        array[13] = command.getDestinationPosZTwo();
+        array[14] = command.getCommand();
+        array[15] = command.getAckFinish();
+
 //        array[9] = command.getSourceStaNo();
 //        array[10] = command.getDestinationStaNo();
-        array[9] = command.getCommand();
+        //array[9] = command.getCommand();
         OperateResult result = siemensNet.Write("DB100.0", array);
 
         if (command.getAckFinish() == 0) {

--
Gitblit v1.9.1