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
How to get node parent in uaServer
August 26, 2021
16:12, EEST
Avatar
Sabari
Member
Members
Forum Posts: 30
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hi,
Does the sdk provide a method to get a node’s parent in uaServer ?

Thanks

August 27, 2021
9:20, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 151
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

First of all, OPC UA doesn’t have a strict parent-child hierarchy for Nodes. While you could say that a Node that targets another Node with a forward (non-inverse) Reference is the parent of the targeted Node, there could be other Nodes that also target the same Node making it possible for a Node to have multiple parents. And since there are multiple ReferenceTypes, the hierarchy of Nodes could look completely different for two different ReferenceTypes depending on the semantics of the used ReferenceTypes.

OPC UA Information Models use ParentNodeIds to express parent-child relationships between Nodes. However, the specification states (in https://reference.opcfoundation.org/Core/docs/Part6/F.7/) that “this information does not appear in the AddressSpace and is intended for use by design tools”, which is why there is no method that could be used to get this NodeId.

You could use UaNode.getReferences(NodeId referenceTypeId, boolean isInverse) where you specify a ReferenceType, e.g. HasComponent, with its NodeId, or use null for all ReferenceTypes, and set isInverse to true to get inverse References. Note, that the Prosys OPC UA SDK for Java handles all References internally as non-inverse References, which means that the UaNode that called the method is the target Node of the returned UaReferences! You could consider the source Nodes of the returned UaReferences as the parents of the UaNode.

October 12, 2021
14:44, EEST
Avatar
Sabari
Member
Members
Forum Posts: 30
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,

Thank you for your relply

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 111

pramanj: 86

ibrahim: 74

kapsl: 57

gjevremovic: 49

TimK: 41

fred: 41

Xavier: 40

Fransua33: 39

rocket science: 36

Member Stats:

Guest Posters: 0

Members: 1458

Moderators: 17

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1178

Posts: 4983

Newest Members:

ThomasM, louiecrews, wyattcutler005, kristin3354, augustawalpole3, everettpulver, arron51869, roseannagoldschm, moosm, islamaddox

Moderators: Jouni Aro: 906, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 684, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 24, Teppo Uimonen: 21, Markus Johansson: 36, Niklas Nurminen: 0, Matti Siponen: 151, Lusetti: 0

Administrators: admin: 1