self.error_stream("Communication with the OPC-UA server %s:%d failed. Reconnecting. Trace: %s"%(self.OPC_Server_Name,self.OPC_Server_Port,traceback.format_exc()))
self.Fault()
self.opcua_connector.reconnect()
returnNone
returnopcua_error_wrapper
...
...
@@ -93,14 +91,15 @@ class BackgroundConnector(Thread):
self.connected=True
exceptsocket.errorase:
self.debug_stream("Could not connect: %s"%(e,))
finally:
self.connecting=False
defrun(self):
whilenotself.connectedandnotself.stopping:
self.try_connect()
ifnotself.connected:
time.sleep(self.try_interval)
try:
whilenotself.connectedandnotself.stopping:
self.try_connect()
ifnotself.connected:
time.sleep(self.try_interval)
finally:
self.connecting=False
defstop(self):
self.stopping=True
...
...
@@ -358,6 +357,7 @@ class RCUSCC(Device):
definit_device(self):
"""Initialises the attributes and properties of the RCUSCC."""
Device.init_device(self)
# PROTECTED REGION ID(RCUSCC.init_device) ENABLED START #