Skip to content
Snippets Groups Projects
Commit 09ed56d0 authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'master' into L2SS-358-darkrai-round-2

parents 879d111a ad72aa52
No related branches found
No related tags found
1 merge request!163L2SS-358: Update configuration for DarkRAI
...@@ -154,7 +154,7 @@ class attribute_wrapper(attribute): ...@@ -154,7 +154,7 @@ class attribute_wrapper(attribute):
try: try:
self.read_function, self.write_function = client.setup_attribute(self.comms_annotation, self) self.read_function, self.write_function = client.setup_attribute(self.comms_annotation, self)
except Exception as e: except Exception as e:
raise Exception("Exception while setting %s attribute with annotation: '%s'", client.__class__.__name__, self.comms_annotation) from e raise Exception(f"Exception while setting {client.__class__.__name__} attribute with annotation: {self.comms_annotation}") from e
async def async_set_comm_client(self, client): async def async_set_comm_client(self, client):
""" """
...@@ -163,7 +163,7 @@ class attribute_wrapper(attribute): ...@@ -163,7 +163,7 @@ class attribute_wrapper(attribute):
try: try:
self.read_function, self.write_function = await client.setup_attribute(self.comms_annotation, self) self.read_function, self.write_function = await client.setup_attribute(self.comms_annotation, self)
except Exception as e: except Exception as e:
raise Exception("Exception while setting %s attribute with annotation: '%s'", client.__class__.__name__, self.comms_annotation) from e raise Exception(f"Exception while setting {client.__class__.__name__} attribute with annotation: {self.comms_annotation}") from e
def set_pass_func(self): def set_pass_func(self):
def pass_func(value=None): def pass_func(value=None):
......
...@@ -86,7 +86,9 @@ class OPCUAConnection(AsyncCommClient): ...@@ -86,7 +86,9 @@ class OPCUAConnection(AsyncCommClient):
ping the client to make sure the connection with the client is still functional. ping the client to make sure the connection with the client is still functional.
""" """
try: try:
await self.client.send_hello() # do a cheap call. NOTE: send_hello is not allowed after establishing a connection,
# so cannot be used here. see https://reference.opcfoundation.org/v104/Core/docs/Part6/7.1.3/
_ = await self.client.get_namespace_array()
except Exception as e: except Exception as e:
raise IOError("Lost connection to server %s: %s", self._servername(), e) raise IOError("Lost connection to server %s: %s", self._servername(), e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment