0:09, EEST
June 21, 2017
I may be missing something but I’d like to read nodes in as their hierarchical path rather than their name (some have the same name). Is there an easy way to do this from just browsing the address space? I know each node has the attribute “OrganizedBy” of “ComponentOf” but I want to read the path all the way to the top such as “Objects.MyObjects.MyDevice” or something along those lines. Thanks!
11:06, EEST
April 3, 2012
Hi,
The unique identifier for a node is the NodeId Attribute. I’m not exactly sure what you mean reading by “their name” as you do not operate on names. Nodes have the BrowseName and DisplayName Attributes, which is usually displayed instead of the NodeId in e.g. UIs as a Tree view, however all the operations are done based on the NodeId attribute (i.e. BrowseNames and DisplayNames are not unique, NodeId is). You can read OPC UA Specification (v.1.03) Part 3 for the address space concepts.
Every node is a target of a Hierarchical Reference from another node, with the top being the Root node, with numeric Id 84 of the standard namespace, under which e.g. the Objects folder is (usually the Root is not displayed). If you know nothing about the server beforehand, that is all you can expect, however usually in a client application you know the NodeIds directly based on e.g. a configuration file or e.g. have the NodeId under which the relevant nodes are which you can then Browse.
Assuming you know the starting point and a set of BrowseNames you can use the TranslateBrowsePathsToNodeIds service call to get the NodeIds relative to other NodeId. You can call this in the SDK via client.getAddressSpace().translateBrowsePathsToNodeIds(…). Please note that the like NodeIds, the BrowseNames do have a namespace index, which must be correct in order the call to work. For more information read the javadoc of the SDK method and UA Specification (v.1.03) Part 4 section 5.8.4.
– Bjarne
Most Users Ever Online: 1919
Currently Online:
21 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 729
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25ZofModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1