BadNodeIdInvalid while trying to read

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
naps
Jr. Member
Jr. Member
Posts: 1
Joined: 15 Nov 2018, 11:28

BadNodeIdInvalid while trying to read

Post by naps »

I´m really new in OPC.

I want to read a Value from Server with this code:

nodeToRead.create(1);
UaNodeId node(UaString("::Yasakawa_IM:YASAKAWA_MH5S.Engineering.General.Workspace"), 6);
node.copyTo(&nodeToRead[0].NodeId);
nodeToRead[0].AttributeId = OpcUa_Attributes_Value;
result = m_pSession->read(serviceSettings, 0, OpcUa_TimestampsToReturn_Both, nodeToRead, values, diagnosticInfos);

But everytime i run this code there´s a error called " BadNodeIdInvalid".

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

Re: BadNodeIdInvalid while trying to read

Post by Support Team »

Hello naps,

the error code BadNodeIdInvalid indicates that the NodeId you pass in does not match any NodeId on the server.
You can easily check the NodeId using UaExpert's attribute plugin (see http://documentation.unified-automation ... tes_window).
Best regards
Unified Automation Support Team

Post Reply