diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index adabd10..462db8d 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -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));//如果两次的值相等,不走下面的代码