Is there any API to fetch all nodes/tags present in the OPCUA server. #645
Replies: 1 comment 2 replies
-
There is a method called: But are you realy sure you want to fetch ALL nodes with ALL Attributes they have of the server? Even all types, server specific nodes etc? Or just the ones you need? Do you want to aggregate a server? Btw. I found in the examples a small strip of code, you might be interessted in: It's not exactly what you are looking for, but you may use some lines of that. |
Beta Was this translation helpful? Give feedback.
-
Hi,
My requirement is to fetch all the node/stags present in the OPCUA server. For that, currently I am traversing recursively using the following code. However, I wanted to know if there is any API to do the same.
async def browse_recursive(self, node):
nodes = await node.get_children()
for childId in nodes:
ch = self._opcua_client.get_node(childId)
node_class = await ch.read_node_class()
if node_class == ua.NodeClass.Object:
await self.browse_recursive(ch)
elif node_class == ua.NodeClass.Variable:
try:
bn = await ch.read_browse_name()
dn = await ch.read_display_name()
val= str( await ch.get_value())
print(str(childId.nodeid))
except Exception as e:
print (e)
pass
else:
pass
Beta Was this translation helpful? Give feedback.
All reactions