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
new to OPC UA Client
September 19, 2017
16:51, EEST
Avatar
axelyz
New Member
Members
Forum Posts: 2
Member Since:
September 19, 2017
sp_UserOfflineSmall Offline

Hello All,

I am new to the topic and i am trying to implement a simple Client in Android, which reads the value of an Attribute like NodeClass or Description.
I am using the following lines of code:


NodeId node = new NodeId(84, “Root”);
DataValue dv = client.readAttribute(node, Attributes.NodeClass)
….

I recieve an error message : Bad:NodeIdUnknown (0x80340000) “The node id refers to a node that does not exist in the server address space”
I guess, my defenition of the node is wrong : NodeId node = new NodeId(84, “Root”);

Thank you and Regards

September 19, 2017
18:06, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

The correct ID is Identifiers.RootFolder

October 9, 2017
16:13, EEST
Avatar
axelyz
New Member
Members
Forum Posts: 2
Member Since:
September 19, 2017
sp_UserOfflineSmall Offline

Hello,
Thank You very much, it helped me solve the problem.
I have implemented a subscription with the Prosys Test Server.
At the start I first define the Node i want to subscribe to and get the (changed) value of this node.

NodeId id = new NodeId(2,”MyLevel”);

However, on another Test server all Nodes have Namespaceindex of 0.
to define a NodeId should i enter:

NodeId id = new NodeId(2258, “0”) (for the node containing the current time) as an example

Thank you and Regards

October 10, 2017
12:48, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Please read the tutorials found in the ‘doc’ folder of the SDK package. After that please see the javadocs also found in the doc folder.
The javadocs for NodeId clearly state (for the int,int constructor):

Create new NodeId
Parameters:
namespaceIndex 0..65535
value the value should be a positive integer, as it is converted to an UnsignedInteger

And for the (int, String) constructor:

Create new NodeId
Parameters:
namespaceIndex 0..65535
value String or null

Also I suggest reading OPC UA specification Parts 1 and 3 for learning the basic concepts and the AddressSpace structure.

– Bjarne

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
11 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 677

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1

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