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
Related to TranslateBrowsePathToNodeID method
June 13, 2019
19:59, EEST
Avatar
Rakshan
Member
Members
Forum Posts: 30
Member Since:
June 2, 2019
sp_UserOfflineSmall Offline

Hi,
Went through the tutorials of OPCUA. Not very clear with the above method and its outcome.

If i have a tree of Root>Objects>Crane>XX>YY, , with YY being the final leaf node, what will TranslateBrowsePathToNodeID give me if i put it in a below mentioned way?

BrowsePath [] results = client.getAddressSpace().translateBrowsePathToNodeId(Identifiers.ObjectsFolder,
new RelativePathElement(Identifiers.HierarchicalReferences,false,true,
new QualifiedName(client.getAddressSpace().getNamespaceTable().getIndex(url),”XX”)),
new RelativePathElement(
Identifiers.HierarchicalReferences,
false, true, new QualifiedName(
client.getAddressSpace().getNamespaceTable().getIndex(url), “YY”)));
Looking forward for a supportive response

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

Hi,

It will give the NodeIds that matched the request. You can look at the extact logic given in the OPC UA Specification 1.04 Part 4 section 5.8.4 TranslateBrowsePathsToNodeIds (https://opcfoundation.org/developer-tools/specifications-unified-architecture).

June 14, 2019
15:55, EEST
Avatar
Rakshan
Member
Members
Forum Posts: 30
Member Since:
June 2, 2019
sp_UserOfflineSmall Offline

Just to add on, Is the sequence given above correct? I am not able to figure out what will the return be?
The nodeid’s of Objects,crane,XX,YY?

I am not clear with the understanding. Even the material provided has not made it clear for me. Sorry

June 17, 2019
10:03, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Exactly like that it would not compile as the return type would be BrowsePathTarget[]. Also you are missing the “Crane” step so you would not get results.

Assuming you’ll fix it to something like this, and the url is the equivalent namespaceuri for the QualifiedNames of the nodes, it will return all possible targets having that path (assuming you have only a single YY node below XX, it would return one result):

BrowsePathTarget[] results = client.getAddressSpace().translateBrowsePathToNodeId(Identifiers.ObjectsFolder,

new RelativePathElement(Identifiers.HierarchicalReferences, false, true,
new QualifiedName(client.getAddressSpace().getNamespaceTable().getIndex(url), "Crane")),

new RelativePathElement(Identifiers.HierarchicalReferences, false, true,
new QualifiedName(client.getAddressSpace().getNamespaceTable().getIndex(url), "XX")),

new RelativePathElement(Identifiers.HierarchicalReferences, false, true,
new QualifiedName(client.getAddressSpace().getNamespaceTable().getIndex(url), "YY")));
ExpandedNodeId target = results[0].getTargetId();

Most of the time working with the JavaSDK, you shouldn’t need to use that method often. Most likely normally you would know the NodeId of the Crane node in this case, and you could use e.g. (Assuming XX is attached via HasComponent Reference to the Crane node and YY via HasProperty to the XX, and the idx would be the correct namespaceindex for the namespace in which they are):

UaNode objects = client.getAddressSpace().getNode(craneNodeId);
UaNode xx = objects.getComponent(new QualifiedName(idx, "XX"));
UaNode yy = objects.getProperty(new QualifiedName(idx, "YY"));

And then operate on the UaNode objects.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
30 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: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6260

Newest Members:

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

Moderators: Jouni Aro: 1009, 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