Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Way to get path of a node easily?
June 22, 2017
0:09, EEST
Avatar
jakeb
New Member
Members
Forum Posts: 1
Member Since:
June 22, 2017
sp_UserOfflineSmall Offline

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!

June 22, 2017
11:06, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
28 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1