Skip to content
Snippets Groups Projects
Commit 2fa3c4f5 authored by Taya Snijder's avatar Taya Snijder
Browse files

modified attribute wrapper read/write function exception

parent 0e016453
No related branches found
No related tags found
1 merge request!52021 03 22 branched from master attribute wrapper
...@@ -142,7 +142,6 @@ class OPCUAConnection(CommClient): ...@@ -142,7 +142,6 @@ class OPCUAConnection(CommClient):
MANDATORY function: is used by the attribute wrapper to get read/write functions. must return the read and write functions MANDATORY function: is used by the attribute wrapper to get read/write functions. must return the read and write functions
""" """
# process the annotation # process the annotation
node = self._setup_annotation(annotation) node = self._setup_annotation(annotation)
...@@ -202,7 +201,4 @@ class ProtocolAttribute: ...@@ -202,7 +201,4 @@ class ProtocolAttribute:
self.node.set_data_value(opcua.ua.uatypes.Variant(value=value, varianttype=self.ua_type)) self.node.set_data_value(opcua.ua.uatypes.Variant(value=value, varianttype=self.ua_type))
def pass_func(self, value=None):
pass
...@@ -130,12 +130,14 @@ class attribute_wrapper(attribute): ...@@ -130,12 +130,14 @@ 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: except Exception as e:
def pass_func(value=None): def pass_func(value=None):
pass pass
print("setting comm_client failed. using pass function instead") logger.error("setting comm_client failed. using pass function instead")
self.read_function = pass_func self.read_function = pass_func
self.write_function = pass_func self.write_function = pass_func
raise Exception("Exception while setting comm_client read/write functions. using pass function instead. %s") from e
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment