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: 1026
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: 1026
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: 1919

Currently Online:
53 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: 726

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1525

Posts: 6456

Newest Members:

forrestdilke5, ernestoportus31, martin123, rickie5305, shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rust

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1028, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1