badnodeidunknown error even if the NodeId is correct

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
RobFra
Full Member
Full Member
Posts: 5
Joined: 02 Feb 2023, 10:00

badnodeidunknown error even if the NodeId is correct

Post by RobFra »

Hi.
We are having a problem that is getting us mad.
We already made a connection with an OPC UA server that is supposed to be the same! But with this new one it is not working.
The OPC UA tag is an array.
The NodeID is exactly the same that we can see in the UA Expert.
We can write it going directly using UA Expert but we cannot read/write using our application because it gives BadNodeidUnknown.

The id is:

ns=6;s=::AsGlobalPV:OPCServerTag.Box_Code[0]

Any idea? Could it be a server's problem? And how can we find it out?
Other tags of the same OPC UA server are working, the only difference is that they are not arrays.

Thanks for your help.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3277
Joined: 18 Mar 2011, 15:09

Re: badnodeidunknown error even if the NodeId is correct

Post by Support Team »

Hi,
no, it can not be a server problem, if UaExpert can read/write it, it will be all fine in the Server. It sounds like a client problem.

You should check the NodeID again, it is most probably wrong. My educated guess is "...[0]" is probably indicating the first element within the array, but not the array. Therefore I doubt that the NodeID is displayed like that in UaExpert. You must browse to the Node in the tree, click it, and check the "AttributeWindow" for NodeID and other attributes (specially ValueRank) details.
Best regards
Unified Automation Support Team

RobFra
Full Member
Full Member
Posts: 5
Joined: 02 Feb 2023, 10:00

Re: badnodeidunknown error even if the NodeId is correct

Post by RobFra »

Hi Support Team,
thanks for your reply.
I can't understand why.
With the other OPC UA server it work, referring to the Node as
ns=6;s=::AsGlobalPV:OPCServerTag.Box_Code[0]

And they are supposed to be the same.
An apparently looking both with UA Expert they are exactly the same.
I didn't check ValueRank. But I will.

Thanks for the while. I'll be back soon

User avatar
Support Team
Hero Member
Hero Member
Posts: 3277
Joined: 18 Mar 2011, 15:09

Re: badnodeidunknown error even if the NodeId is correct

Post by Support Team »

Hi,

the UaExpert can write to an array, and UaExpert will obtain array dimensions on first receive of data for this array (typically when first time subscribing for the data) or by reading the attributes of the variable.

However, the NodeID (a tripple of information: Namespace, IdentifierType, Identifyer) does not give you the data type of the value. Your assumption that extending the string identifier by square brackets with "[123]" will give you the individual element of that array, is just an assumption, but has nothing to do with the OPC UA standard. Some servers may allow such (non-standard) textual extension for "read-only" operation on an individual array element, but that is serverspecific (old style) register addressing logic and definately does NOT work for writing.

In OPC UA the variable value is consistent over the type, hence you "must" write the whole array (or parts thereof via IndexRange, in case the server supports the IndexRange).
Best regards
Unified Automation Support Team

Post Reply