更新值不健康时处理
This commit is contained in:
@@ -176,11 +176,11 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
||||
value = OpcUtl.getValue(item, itemState);
|
||||
his = accessor_value.getValue(item.getId());
|
||||
if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) {
|
||||
maxResartNum ++;
|
||||
log.warn("线程 {} opc 值不健康 maxResartNum:{} ", tag, maxResartNum);
|
||||
log.warn("opc 值不健康 item: {}, 状态: {},当前读取值:{}, 系统内存值{} ", item.getId(), itemState.getQuality(), value, his);
|
||||
flag = true;
|
||||
log.warn("线程 {} opc 值不健康 maxResartNum:{} ", tag);
|
||||
log.warn("线程 {} opc 值不健康 item: {}, 状态: {},当前读取值:{}, 系统内存值{} ", tag, item.getId(), itemState.getQuality(), value, his);
|
||||
}
|
||||
if(maxResartNum>10){
|
||||
if(flag){
|
||||
if (this.server != null) {
|
||||
try {
|
||||
this.server.disconnect();
|
||||
@@ -194,7 +194,6 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
||||
ExecutorService executorService = Executors.newCachedThreadPool();
|
||||
executorService.submit(runable);
|
||||
log.warn("opc 值不健康 item: {}, 重新创建连接,当前线程名:{}", item.getId(),tag);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
} while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码
|
||||
|
||||
Reference in New Issue
Block a user