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

Currently Online:
17 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: 737

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6450

Newest Members:

fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley

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

Administrators: admin: 1