OPC UA Client read fails from Staubli OPC Server

Good morning,

I’m having some issues reading a variable from a Staubli Robot CS9 Controller (emulated).
For this set-up the free library EasyUaClnt from B&R in Spain is utilized, which
creates a wrapper around the following AsOpcUac function blocks.

  • AsOpcUac:
    1. UA_Connect
    2. UA_GetNamespaceIndex
    3. UA_NodeGetHandle
    4. UA_Read
    5. UA_NodeReleaseHandle
  • UA_Disconnect
    1. EasyUaClint:EasyUa Read

The connection is established successfully, but then I receive the following Error:
BadNodeIdUnknown
0x80340000
2150891520
The node id refers to a node that does not exist in the server address space

The Staubli OPC UA Server is started and once the Program executes, the logger inside the Robot controller acknowledges the connection.

This is my Read program from the EasyUaClinet examples:

VarA;
EasyUaRead_0.ServerEndpointUrl := 'opc.tcp://172.16.138.10:853/Staubli';
EasyUaRead_0.NamespaceUri := 'urn:cs9/Staubli';
EasyUaRead_0.NodeID.NamespaceIndex := 1;
EasyUaRead_0.NodeID.Identifier := 'Robot/Applications/InputOutput/num/nCycleCount/nCycleCount';
EasyUaRead_0.NodeID.IdentifierType := UAIT_String;
EasyUaRead_0.Variable := '::Read:VarA[0]';
SessionConnectInfo.SecurityMsgMode := UASMM_BestAvailable;
SessionConnectInfo.SecurityPolicy := UASP_BestAvailable;
SessionConnectInfo.TransportProfile := UATP_UATcp;
SessionConnectInfo.UserIdentityToken.UserIdentityTokenType := UAUITT_Anonymous;
//SessionConnectInfo.UserIdentityToken.TokenParam1`` := 'admin'; //Username
//SessionConnectInfo.UserIdentityToken.TokenParam2`` := 'pass'; //Password
SessionConnectInfo.SessionTimeout := T#1m;
SessionConnectInfo.MonitorConnection := T#10s;

I have also tried to use, “:” as delimiter as can be seen in the UA Expert Screenshot, but this is the wrong syntax for Automation Studio, as AS expects “/” delimited Identifier

EasyUaRead_0.NodeID.Identifier := ‘Robot:Applications:InputOutput:num:nCycleCount:nCycleCount’;

And below are some screenshots from the Staubli Robot OPC UA Server, connected to via UaExpert.

UA Expert settings

Below is the NamespaceArray of the Staubli OPC UA Server as can be seen in UaExpert.

[0] UA Companion Specifications - OPC Foundation
[1] urn:cs9/Staubli
[2] ``http://opcfoundation.org/UA/Robotics/
[3] ``http://www.softing.com/OPCUA_Toolkit

And finally a screenshot of the Automation Studio Project, INIT of the Read program.

AS Program

The issue is most likely a simple syntax error, but I just can’t locate it. I know that:

The connection is established successfully
A Python OPC UA client can read the variables intended
The issue comes from the internal Step-Chain in Step 41, in which FB UA_NodeGetHandleList is called. From there it jumps into the error-handling.
I would be happy for any pointers in the right direction. Any feedback you can provide, maybe you have experience with a client connection from Automation Studio to a Staubli Robot and can provide some details of the implementation.

Thank you!

this same discussion like this one here, or not? EasyUaClnt a simplicity wrapper library based on AsOpcUac - #40 by AndrewCra

Since from the printscreen I cannot say where the problem could be, I would recommend recording a Wireshark trace and filtering out only OPC UA communication. This can provide you with details that can help you.

The UaExpert screenshot shows datatype Double, which would translate to B&R datatype LREAL. Try changing the datatype of VarA to LREAL.