From 0878726a63970fe2a9b11c867a7ac78cf161b445 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 27 二月 2024 16:13:50 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/SiemensCrnThread.java | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index ac48c37..9587987 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -278,11 +278,15 @@
array[7] = command.getDestinationPosY(); // 鐩爣浣嶇疆鍒楀彿
array[8] = command.getDestinationPosZ(); // 鐩爣浣嶇疆灞傚彿
array[9] = command.getCommand();
-// array[10] = command.getLocType1(); //鏂板璐х墿绫诲瀷涓嬪彂
+// array[10] = 0; //澶囩敤1
+
+ boolean[] array2 = new boolean[1];
+ array2[0] = command.isTraySize();
OperateResult result = siemensNet.Write("DB100.0", array);
+ OperateResult result2 = siemensNet.Write("DB100.22", array2);
News.info("鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), array);
- if(!result.IsSuccess){
+ if(!result.IsSuccess || !result2.IsSuccess){
News.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触锛岄噸鏂版坊鍔犱换鍔″埌闃熷垪 ===>> [id:{}],{}", slave.getId(), JSON.toJSON(command));
MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, command));
Thread.sleep(100);
@@ -293,7 +297,7 @@
//鍫嗗灈鏈轰换鍔″啓鍏ュ悗锛屽洖璇讳竴娆★紝鐪嬫槸鍚︽垚鍔�
Thread.sleep(200);
try{
- OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 18);
+ OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 24);
if (resultRead.IsSuccess) {
CrnCommand one = new CrnCommand();
one.setTaskNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 2));
@@ -304,10 +308,12 @@
one.setDestinationPosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 12));
one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 14));
one.setDestinationPosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 16));
+ one.setTraySize(siemensNet.getByteTransform().TransBool(resultRead.Content, 22));
if (!command.getTaskNo().equals(one.getTaskNo()) || !command.getTaskMode().equals(one.getTaskMode())
|| !command.getSourcePosX().equals(one.getSourcePosX()) || !command.getSourcePosY().equals(one.getSourcePosY())
|| !command.getSourcePosZ().equals(one.getSourcePosZ()) || !command.getDestinationPosX().equals(one.getDestinationPosX())
|| !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ())
+ || !command.isTraySize() == one.isTraySize()
){
try{
News.error("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐id:{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one));
--
Gitblit v1.9.1