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
NodeIds
February 20, 2014
19:54, EET
Avatar
yh@ti
Member
Members
Forum Posts: 4
Member Since:
February 20, 2014
sp_UserOfflineSmall Offline

We are evaluating the Prosys SDK at the moment. I was able to modify the browse function fom the SampleConsoleClient to get a list of all the nodes with their node Ids. From the example, all the rest of the function depends on the NodeId such as read, write, subscribe.
For our client application, we would like to display a list of the nodes in a tree like format, and the user can right click on the selected node and either read the value or subscribe to it. When building the tree, each node is uniquely identitfied by the nodeId.

How do I create a NodeId object from just the nodeId (string type) such as “ns=1;s=[Device_1]_Meta:Ramp”?

I do not see the UaClient.getNamespaceTable() available as described in the follwoing thread.
http://www.prosysopc.com/blog/forum/opc-ua-java-sdk/nodeid-questions/

Thanks and Regards,
RC

February 21, 2014
8:09, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 960
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

NodeId nodeId = new NodeId(namespaceIndex, identifier);

getNamespaceTable() is not static – so you use it as

UaClient client = …;
client.getNamespaceTable()…

I think you have in mind a similar tree view that we have in the Java Client application.

February 27, 2014
22:23, EET
Avatar
yh@ti
Member
Members
Forum Posts: 4
Member Since:
February 20, 2014
sp_UserOfflineSmall Offline

Thank you for the post. I am able to get the nodeId by the id value “ns=1;s=[Device_1]_Meta:Ramp” . I have another followup question.

From your previous post, I know that the namespaceindex differs each time the server starts. And we should store the namespaceUri instead of the namespaceindex. Will you share an example of how to get the namespaceUri for a node? (the reference link on the NodeId questons is broken) We would like to know if we just store the path/ID part for each node, how can we find out the namespaceIndex and create a NodeId object .

February 28, 2014
8:20, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 960
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

String uri = client.getNamespaceTable().getUri(index);

and

int index = client.getNamespaceTable().getIndex(uri);

You can also use toExpandedNodeId() and toNodeId() to convert between these types.

Note, however, that the ExpandedNodeId is not guaranteed to contain the NamespaceUri, but may contain the index instead (if you get the value from somewhere else).

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 124

pramanj: 86

ibrahim: 74

rocket science: 65

kapsl: 57

Sabari: 51

gjevremovic: 49

Xavier: 43

fred: 41

TimK: 41

Member Stats:

Guest Posters: 0

Members: 1749

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1323

Posts: 5649

Newest Members:

WalterFOUNC, datafastproxiespx01, LenkaLok, seoninet, justinevillanuev, namtrott5457, DonaldWibip, AlfredoEthix, andreidla, everangel7021

Moderators: Jouni Aro: 960, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 860, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 25, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 222, Lusetti: 0

Administrators: admin: 1