From b428f0686e3c6bd8f976d97e000ca00075874fa2 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Fri, 6 Jan 2023 23:25:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/acs/opc/DeviceOpcProtocolRunable.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index e5000bf..0b9190f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -115,6 +115,7 @@ public class DeviceOpcProtocolRunable implements Runnable { log.info("label97_123"); long begin = System.currentTimeMillis(); Map itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0])); + log.info("{}读取到的itemStatus结果为:", itemStatus); long end = System.currentTimeMillis(); log.info("{} 开始记时{}", tag, DateUtil.now()); long duration = end - begin; @@ -130,6 +131,7 @@ public class DeviceOpcProtocolRunable implements Runnable { } boolean valueAllNotNull = false; Set items = itemStatus.keySet(); + log.info("items值为:", items); Iterator var18 = items.iterator(); while (true) { @@ -153,16 +155,16 @@ public class DeviceOpcProtocolRunable implements Runnable { random *= 1000; if (this.all_null < 3) { log.warn("{} 所有内容都为空,暂定{}s", tag, 5000 + random); - ThreadUtl.sleep((long)(5000 + random)); + ThreadUtl.sleep((long) (5000 + random)); } else if (this.all_null < 6) { log.warn("{} 所有内容都为空,暂定{}s", tag, 30000 + random); - ThreadUtl.sleep((long)(30000 + random)); + ThreadUtl.sleep((long) (30000 + random)); } else if (this.all_null < 12) { log.warn("{} 所有内容都为空,暂定{}ms", tag, '\uea60' + random); - ThreadUtl.sleep((long)('\uea60' + random)); + ThreadUtl.sleep((long) ('\uea60' + random)); } else { log.warn("{} 所有内容都为空,暂定{}ms", tag, 120000 + random); - ThreadUtl.sleep((long)(120000 + random)); + ThreadUtl.sleep((long) (120000 + random)); } ++this.all_null; @@ -174,14 +176,17 @@ public class DeviceOpcProtocolRunable implements Runnable { } log.info("label97A----"); item = (Item) var18.next(); + log.info("读取到item:{}", item); ItemState itemState = (ItemState) itemStatus.get(item); + log.info("读取到itemState:{}", itemState); + log.info("开始根据item,itemState读取信号值:{},{}", item, itemState); value = OpcUtl.getValue(item, itemState); - + log.info("根据item,itemState读取到信号值为:{}", value); if (value != null) { valueAllNotNull = true; } - his = accessor_value.getValue(item.getId()); + log.info("读取到旧的信号值:{}", his); if (!ObjectUtil.equal(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) { log.warn("opc 值不健康 item: {}, 状态: {}", item.getId(), itemState.getQuality()); }