Browse Source

更新

master
gengby 2 years ago
parent
commit
b428f0686e
  1. 9
      acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java

9
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<Item, ItemState> 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<Item> items = itemStatus.keySet();
log.info("items值为:", items);
Iterator var18 = items.iterator();
while (true) {
@ -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());
}

Loading…
Cancel
Save