diff --git a/devices/clients/opcua_connection.py b/devices/clients/opcua_connection.py index 2fce811b35a40eb1265e0835741deb6d45870064..16ee124afc6f1742e7b1e6ceaadf8583ffd984c8 100644 --- a/devices/clients/opcua_connection.py +++ b/devices/clients/opcua_connection.py @@ -65,14 +65,6 @@ class OPCUAConnection(CommClient): self.obj = self.client.get_objects_node() - # for i in self.obj.get_children(): - # print(i.get_browse_name()) - # for j in i.get_children(): - # try: - # print(j.get_browse_name(), j.get_data_type_as_variant_type()) - # except: - # pass - def _servername(self): return self.client.server_url.geturl() @@ -91,6 +83,21 @@ class OPCUAConnection(CommClient): self.streams.error_stream("Could not connect to server %s: %s", self._servername(), e) raise Exception("Could not connect to server %s", self._servername()) from e + def check_nodes(self): + """ + function purely for debugging/development only. Simply lists all top level nodes and the nodes below that + """ + + for i in self.obj.get_children(): + print(i.get_browse_name()) + for j in i.get_children(): + try: + print(j.get_browse_name(), j.get_data_type_as_variant_type()) + except: + print(j.get_browse_name()) + finally: + pass + def disconnect(self): """