From 69bab6601692fd650b7e9f6f35b0e41d44d241f3 Mon Sep 17 00:00:00 2001 From: tqs <56479841@qq.com> Date: 星期六, 03 十二月 2022 16:04:37 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/SiemensCrnThread.java | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java index 31b9ff5..e0709ba 100644 --- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java +++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java @@ -151,6 +151,7 @@ if (result.IsSuccess) { if (null == crnProtocol) { crnProtocol = new CrnProtocol(); + crnProtocol.setCrnNo(slave.getId()); } crnProtocol.setMode(siemensNet.getByteTransform().TransInt16(result.Content, 0)); crnProtocol.setTaskNo(siemensNet.getByteTransform().TransInt16(result.Content, 2)); @@ -178,6 +179,8 @@ // 澶嶄綅淇″彿 if (crnProtocol.getStatusType().equals(CrnStatusType.WAITING)) { + log.error("-------------------------------------------绗竴姝ャ�乕鍫嗗灈鏈哄彿锛歿}, 宸ヤ綔鍙凤細{}, 杞借揣鍙�:{}]==>> 鐘舵�佷负10锛岀瓑寰呯‘璁わ紒锛�", + slave.getId(),crnProtocol.getTaskNo(), crnProtocol.getLoaded()==1 ? "鏈夌墿" : "鏃犵墿"); if (resetFlag) { if(crnProtocol.getTaskNo()==9999){ backHpFlag = false; @@ -231,9 +234,9 @@ log.error("鍫嗗灈鏈哄啓鍏ュ懡浠や负绌�"); return false; } - convertRow(command); +// convertRow(command); command.setCrnNo(slave.getId()); - short[] array = new short[12]; + short[] array = new short[10]; array[0] = command.getAckFinish(); array[1] = command.getTaskNo(); array[2] = command.getTaskMode(); @@ -243,14 +246,15 @@ array[6] = command.getDestinationPosX(); array[7] = command.getDestinationPosY(); array[8] = command.getDestinationPosZ(); - array[9] = command.getSourceStaNo(); - array[10] = command.getDestinationStaNo(); - array[11] = command.getCommand(); +// array[9] = command.getSourceStaNo(); +// array[10] = command.getDestinationStaNo(); + array[9] = command.getCommand(); OperateResult result = siemensNet.Write("DB100.0", array); if (command.getAckFinish() == 0) { short commandFinish = 1; - result = siemensNet.Write("DB100.22", commandFinish); + Thread.sleep(100L); + result = siemensNet.Write("DB100.18", commandFinish); } try { -- Gitblit v1.9.1