![sp_Feed](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_Feed.png)
![sp_TopicIcon](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_TopicIcon.png)
8:30, EEST
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/defaults/moderatordefault.png)
Moderators
February 11, 2020
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
Hello,
There is no example of reading all NodeIds, Values or Attributes of a Server. This is not a typical thing that a Client application would need to do and it can take a lot of time depending on the number of Nodes on the Server’s AddressSpace. What is your use case for reading all this information from a Server?
To read from all Nodes of a Server, you need to browse its AddressSpace recursively starting from the Root Node. You can get a list of ReferenceDescriptions by calling client.getAddressSpace().browse(ExpandedNodeId nodeId) where client is an instance of UaClient class and nodeId is the ExpandedNodeId of the Node you wish to browse for References. You can then get the ExpandedNodeId of the Referenced Node by calling reference.getNodeId() where reference is a ReferenceDescription returned by the browse method previously. You can now use that ExpandedNodeId in readAttribute and readValue methods of UaClient class to read Attributes and Value of the Node and to browse the Node for more ReferenceDescriptions. You can repeat this recursion until browse returns no ReferenceDescriptions.
When implementing a recursion to read an entire AddressSpace, it is important to keep in mind that there can be multiple BrowsePaths leading to same Nodes. The recursion could get stuck in an infinite loop so it is important to keep a list of Nodes that have already been processed to avoid processing them again. Nodes are uniquely identified by their NodeIds so you can keep a list of NodeIds of Nodes that have been processed.
Also note, that only Nodes of Variable and VariableType NodeClasses have Value Attribute. You can check the NodeClass of the Node from a ReferenceDescription by calling reference.getNodeClass().
Most Users Ever Online: 518
Currently Online:
8 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 142
pramanj: 86
rocket science: 85
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 724
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1495
Posts: 6352
Newest Members:
armandovarley, dole, rustyhammer, braydenaquino6, blaircleveland0, maribelkeeler7, Nicky, rickymeade2, niamhtoussaint0, adamq0505309Moderators: Jouni Aro: 1017, Pyry: 1, Petri: 0, Bjarne Boström: 1003, Jimmy Ni: 26, Matti Siponen: 337, Lusetti: 0
Administrators: admin: 1