From 32877d296352896b17fed55f3a497cd969ee1545 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期一, 31 三月 2025 14:22:41 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/core/thread/SiemensCrnThread.java | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index b66082c..22989ef 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -392,6 +392,7 @@
// array[9] = command.getSourceStaNo();
// array[10] = command.getDestinationStaNo();
array[9] = command.getCommand();
+ OperateResult result18 = siemensNet.Write("DB100.18", (short)0);
OperateResult result = siemensNet.Write("DB100.0", array);
@@ -419,13 +420,28 @@
log.error("鍫嗗灈鏈哄懡浠ゅ湴鍧�鍐欏叆鍚庡洖璇诲け璐id:{}]>>>>閲嶅啓[{}] >>>>> 鍐欏叆[{}],===>>鍥炶[{}]", slave.getId(), i,JSON.toJSON(command),JSON.toJSON(one));
result = siemensNet.Write("DB100.0", array);
}else{
- result = siemensNet.Write("DB100.18", (short) 0);
- i=5;
+ short commandFinish = 1;
+ Thread.sleep(100L);
+ result = siemensNet.Write("DB100.18", commandFinish);
+ int signFinish = 1;
+ while (signFinish<5){
+ OperateResultExOne<byte[]> result10018 = siemensNet.Read("DB100.18", (short) 2);
+ short transInt16 = siemensNet.getByteTransform().TransInt16(result10018.Content, 0);
+ if (transInt16 != commandFinish){
+ log.info("涓嬪彂DB100.18 鍥炶澶辫触" + "commandFinish:"+commandFinish);
+ log.info("涓嬪彂DB100.18 鍥炶澶辫触" + "array:"+ JSON.toJSONString(array));
+ result = siemensNet.Write("DB100.18", commandFinish);
+ signFinish++;
+ }else {
+ log.info("涓嬪彂DB100.18" + "commandFinish:"+commandFinish);
+ log.info("涓嬪彂DB100.18" + "array:"+ JSON.toJSONString(array));
+ break;
+ }
+ }
+ break;
}
}
}while(i<5);
-
-
try {
// 鏃ュ織璁板綍
BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class);
--
Gitblit v1.9.1