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, EET
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, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 801
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

The correct ID is Identifiers.RootFolder

October 9, 2017
16:13, EET
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, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 230
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: 78

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

pramanj: 86

hbrackel: 74

ibrahim: 65

kapsl: 57

gjevremovic: 49

TimK: 41

fred: 36

Fransua33: 35

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 652

Moderators: 10

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 685

Posts: 2953

Newest Members:

Ravish Roshan, Max Braun, Predixer, LorraineXu, FF, Jonas, HA198273465, RaeHoffman, susandaigle23, m.scaglioni

Moderators: Jouni Aro: 801, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 230, Heikki Tahvanainen: 270, Jukka Asikainen: 1

Administrators: admin: 0