rev opc读取时不建立新连接

This commit is contained in:
wangs
2023-08-21 18:36:20 +08:00
parent 4ce0359d16
commit b4d06c541c

View File

@@ -83,6 +83,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
private void runOld() {
OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerService .class);
while (true) {
start:
try {
@@ -95,10 +96,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
server.disconnect();
log.trace("清理server...");
}
this.server = OpcServerUtl.getServerWithOutException(this.OpcServer.getOpc_host(), this.OpcServer.getCls_id(), this.OpcServer.getUser(), this.OpcServer.getPassword(), this.OpcServer.getDomain());
this.server.addStateListener(this);
group = this.server.addGroup();
// group =opcServerService.getServer(this.getOpcGroupID());
List<String> itemsString = new ArrayList();
Iterator var3 = this.protocols.iterator();