rev opc读写共用一个server

This commit is contained in:
wangs
2023-08-25 13:47:41 +08:00
parent 909766d20e
commit fe98a98ae0

View File

@@ -96,10 +96,11 @@ 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());
// 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.getOpcServer().getOpc_code());
List<String> itemsString = new ArrayList();
Iterator var3 = this.protocols.iterator();