From 82fb5546663c49cafff20e5db4005a7fb25158b4 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 25 九月 2020 13:59:41 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/DevpThread.java | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/zy/core/thread/DevpThread.java b/src/main/java/com/zy/core/thread/DevpThread.java index 9ed86e6..55be879 100644 --- a/src/main/java/com/zy/core/thread/DevpThread.java +++ b/src/main/java/com/zy/core/thread/DevpThread.java @@ -138,6 +138,16 @@ } } } + // 鍙拌溅浣嶇疆 + OperateResultExOne<Integer> result2 = siemensS7Net.ReadInt32("DB100.48"); + if (result2.IsSuccess) { + StaProtocol staProtocol = station.get(8); + staProtocol.setPosition(result2.Content); + } else { + OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆�8鍙峰彴杞﹁幏鍙栧疄鏃朵綅缃け璐ワ紒锛侊紒", DateUtils.convert(new Date()))); + log.error("8鍙峰彴杞﹁幏鍙栧疄鏃朵綅缃け璐ワ紒锛侊紒"); + } + if (result.IsSuccess && result1.IsSuccess) { OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId())); @@ -172,7 +182,7 @@ return; } OperateResult write = siemensS7Net.Write("DB100." + (staProtocol.getSiteId() - 1) * 2, staProtocol.getWorkNo()); // 宸ヤ綔鍙� - Thread.sleep(100); + Thread.sleep(300); OperateResult write1 = siemensS7Net.Write("DB100." + ((staProtocol.getSiteId() - 1) * 2 + 20), staProtocol.getStaNo()); // 鐩爣绔� // boolean[] status = new boolean[8]; // status[0] = staProtocol.isAutoing(); -- Gitblit v1.9.1