|
@ -112,6 +112,7 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
|
|
|
|
|
|
label97: |
|
|
label97: |
|
|
while (DeviceOpcSynchronizeAutoRun.isRun) { |
|
|
while (DeviceOpcSynchronizeAutoRun.isRun) { |
|
|
|
|
|
log.info("label97_123"); |
|
|
long begin = System.currentTimeMillis(); |
|
|
long begin = System.currentTimeMillis(); |
|
|
Map<Item, ItemState> itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0])); |
|
|
Map<Item, ItemState> itemStatus = group.read(true, (Item[]) itemsMap.values().toArray(new Item[0])); |
|
|
long end = System.currentTimeMillis(); |
|
|
long end = System.currentTimeMillis(); |
|
@ -168,9 +169,10 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
} else { |
|
|
} else { |
|
|
this.all_null = 0; |
|
|
this.all_null = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
log.info("label97"); |
|
|
continue label97; |
|
|
continue label97; |
|
|
} |
|
|
} |
|
|
|
|
|
log.info("label97A----"); |
|
|
item = (Item) var18.next(); |
|
|
item = (Item) var18.next(); |
|
|
ItemState itemState = (ItemState) itemStatus.get(item); |
|
|
ItemState itemState = (ItemState) itemStatus.get(item); |
|
|
value = OpcUtl.getValue(item, itemState); |
|
|
value = OpcUtl.getValue(item, itemState); |
|
@ -183,6 +185,7 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
if (!ObjectUtil.equal(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) { |
|
|
if (!ObjectUtil.equal(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) { |
|
|
log.warn("opc 值不健康 item: {}, 状态: {}", item.getId(), itemState.getQuality()); |
|
|
log.warn("opc 值不健康 item: {}, 状态: {}", item.getId(), itemState.getQuality()); |
|
|
} |
|
|
} |
|
|
|
|
|
log.info("label97bbb----value{},his{},equals{}",value,his,ObjectUtil.equal(value, his)); |
|
|
} while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码
|
|
|
} while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码
|
|
|
|
|
|
|
|
|
log.info("如果两次的值相等,不走下面的代码"); |
|
|
log.info("如果两次的值相等,不走下面的代码"); |
|
@ -204,6 +207,7 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
log.info("信号{}变更从{}->{};信号快照:{}", new Object[]{item.getId(), his, value, sb}); |
|
|
log.info("信号{}变更从{}->{};信号快照:{}", new Object[]{item.getId(), his, value, sb}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
log.info("设置值"); |
|
|
//设置值
|
|
|
//设置值
|
|
|
accessor_value.setValue(item.getId(), value); |
|
|
accessor_value.setValue(item.getId(), value); |
|
|
} |
|
|
} |
|
|