From 894c928ebbf5c0256b3ff92315b30db47cf8fd90 Mon Sep 17 00:00:00 2001 From: 1 <1@123> Date: 星期四, 08 五月 2025 17:34:12 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/RgvThread.java | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zy/core/thread/RgvThread.java b/src/main/java/com/zy/core/thread/RgvThread.java index 0258e1d..7ef797d 100644 --- a/src/main/java/com/zy/core/thread/RgvThread.java +++ b/src/main/java/com/zy/core/thread/RgvThread.java @@ -114,7 +114,7 @@ OperateResultExOne<byte[]> result = siemensNet.Read("DB100.12", (short) 1); boolean[] status = siemensNet.getByteTransform().TransBool(result.Content, 0, 1); if (status[0]){ - OperateResult result4 = siemensNet.Write("DB100.12.0", true); + OperateResult result4 = siemensNet.Write("DB100.12.0", false); } } catch (Exception e) { log.error("RGV鏁版嵁璇诲彇绾跨▼寮傚父锛侊紒锛�" + e.getMessage()); @@ -198,12 +198,22 @@ continue; } } - Thread.sleep(100); - TaskProtocol issued = new TaskProtocol(taskProtocol); - write(issued); - taskProtocol.setIsRunning(4); - taskProtocolCache.updateTaskProtocol(taskProtocol); - break; + if (taskProtocol.getTargetPosition()<=rgvProtocol.getRgvPos()+50 + && taskProtocol.getTargetPosition()>=rgvProtocol.getRgvPos()-50){ + Thread.sleep(100); + TaskProtocol issued = new TaskProtocol(taskProtocol); + write(issued); + taskProtocol.setIsRunning(4); + taskProtocolCache.updateTaskProtocol(taskProtocol); + break; + } else { + Thread.sleep(100); + TaskProtocol issued = new TaskProtocol(taskProtocol,true); + write(issued); +// taskProtocol.setIsRunning(4); +// taskProtocolCache.updateTaskProtocol(taskProtocol); + break; + } } } } catch (Exception e) { @@ -531,6 +541,8 @@ // convertRow(command); // taskProtocol.setRgvNo(slave.getId()); Long[] array = new Long[11]; + OperateResult result41 = siemensNet.Write("DB100.12.0", false); + // array[0] = taskProtocol.getAckFinish1(); // array[1] = taskProtocol.getTaskNo(); // array[2] = taskProtocol.getTaskMode(); -- Gitblit v1.9.1