From 49c4073d36f632fc8b449b34c2eb345ffa71053b Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 22 五月 2024 12:36:35 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/SiemensDevpThread.java | 48 ++++++++++++++++++++++++++++++++++--------------
1 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index 78b31bf..01ae79e 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -388,28 +388,48 @@
}
}
+ if(slave.getId() != 2){
+ OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB13.2", (short) (staNoSize*4));
+ if (resultErr.IsSuccess) {
+ for (int i = 0; i < staNoSize; i++) {
+ Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
+ boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4, 1);
+ StaProtocol staProtocol = station.get(siteId);
+ staProtocol.setBreakerErr(status[0]);
+ staProtocol.setInfraredErr(status[1]);
+ staProtocol.setOutTimeErr(status[2]);
+ staProtocol.setSeizeSeatErr(status[3]);
+ staProtocol.setWrkYgoodsN(status[4]);
+ staProtocol.setInverterErr(status[5]);
+ staProtocol.setContactErr(status[6]);
+ staProtocol.setUpcontactErr(status[7]);
- OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB13.2", (short) (staNoSize*4));
- if (resultErr.IsSuccess) {
- for (int i = 0; i < staNoSize; i++) {
- Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
- boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4, 1);
- StaProtocol staProtocol = station.get(siteId);
- staProtocol.setBreakerErr(status[0]);
- staProtocol.setInfraredErr(status[1]);
- staProtocol.setOutTimeErr(status[2]);
- staProtocol.setSeizeSeatErr(status[3]);
- staProtocol.setWrkYgoodsN(status[4]);
- staProtocol.setInverterErr(status[5]);
- staProtocol.setContactErr(status[6]);
- staProtocol.setUpcontactErr(status[7]);
+ }
+ }
+ }else {
+ OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB1003.2", (short) (staNoSize*4));
+ if (resultErr.IsSuccess) {
+ for (int i = 0; i < staNoSize; i++) {
+ Integer siteId = staNos.get(i); // 绔欑偣缂栧彿
+ boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4, 1);
+ StaProtocol staProtocol = station.get(siteId);
+ staProtocol.setBreakerErr(status[0]);
+ staProtocol.setInfraredErr(status[1]);
+ staProtocol.setOutTimeErr(status[2]);
+ staProtocol.setSeizeSeatErr(status[3]);
+ staProtocol.setWrkYgoodsN(status[4]);
+ staProtocol.setInverterErr(status[5]);
+ staProtocol.setContactErr(status[6]);
+ staProtocol.setUpcontactErr(status[7]);
+ }
}
}
+
// //RGV鍙拌溅浣嶇疆
// Thread.sleep(200);
// OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.0",(short)4);
--
Gitblit v1.9.1