From 7cff9ed1e47866e923727456fdf84559a607ec5e Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期二, 09 五月 2023 11:06:00 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/SiemensDevpThread.java | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java index 7808402..83ced6c 100644 --- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java +++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java @@ -149,22 +149,22 @@ } } Thread.sleep(200); - OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) (staNoSize*2)); - if (result0.IsSuccess) { - for (int i = 0; i < staNoSize; i++) { - Integer siteId = staNos.get(i); // 绔欑偣缂栧彿 - StaProtocol staProtocol = station.get(siteId); - if (null == staProtocol) { - staProtocol = new StaProtocol(); - staProtocol.setSiteId(siteId); - station.put(siteId, staProtocol); - } - staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result0.Content, i*2)); // 鐩爣绔� - } - } - Thread.sleep(200); +// OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) (staNoSize*2)); +// if (result0.IsSuccess) { +// for (int i = 0; i < staNoSize; i++) { +// Integer siteId = staNos.get(i); // 绔欑偣缂栧彿 +// StaProtocol staProtocol = station.get(siteId); +// if (null == staProtocol) { +// staProtocol = new StaProtocol(); +// staProtocol.setSiteId(siteId); +// station.put(siteId, staProtocol); +// } +// staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result0.Content, i*2)); // 鐩爣绔� +// } +// } +// Thread.sleep(200); OperateResultExOne<byte[]> result1 = null; - result1 = siemensS7Net.Read("DB101.1", (short) (staNoSize * 2)); + result1 = siemensS7Net.Read("DB100.100", (short) (staNoSize * 2)); if (result1.IsSuccess) { for (int i = 0; i < staNoSize; i++) { Integer siteId = staNos.get(i); // 绔欑偣缂栧彿 @@ -281,13 +281,13 @@ // 鏇存柊鍏ュ嚭搴撴ā寮� private void updateIoMode() throws InterruptedException { if (slave.getId() == 1 && this.ioModeOf1F1 != IoModeType.NONE) { - if (!siemensS7Net.Write("DB100.300", this.ioModeOf1F1.id).IsSuccess) { + if (!siemensS7Net.Write("DB100.120", this.ioModeOf1F1.id).IsSuccess) { OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆戝啓鍏ヨ緭閫佺嚎1F1鍏ュ嚭搴撴ā寮忓け璐ャ�傝緭閫佺嚎plc缂栧彿={1}", slave.getId())); log.error("鍐欏叆杈撻�佺嚎1F1鍏ュ嚭搴撴ā寮忓け璐ャ�傝緭閫佺嚎plc缂栧彿={}", slave.getId()); } } if (slave.getId() == 1 && this.ioModeOf1F2 != IoModeType.NONE) { - if (!siemensS7Net.Write("DB100.302", this.ioModeOf1F2.id).IsSuccess) { + if (!siemensS7Net.Write("DB100.122", this.ioModeOf1F2.id).IsSuccess) { OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆戝啓鍏ヨ緭閫佺嚎1F2鍏ュ嚭搴撴ā寮忓け璐ャ�傝緭閫佺嚎plc缂栧彿={1}", slave.getId())); log.error("鍐欏叆杈撻�佺嚎1F2鍏ュ嚭搴撴ā寮忓け璐ャ�傝緭閫佺嚎plc缂栧彿={}", slave.getId()); } -- Gitblit v1.9.1