Azure IOT Edge OPC Publisher

I am attempting to connect to Ignition OPC UA server using Microsoft’s OPC Publisher.

Has anyone done this?

My client successfully creates a session, and then retrieves the namespaces.
This read is successful:
// fetch the namespace array and cache it. it will not change as long the session exists.
DataValue namespaceArrayNodeValue = OpcUaClientSession.ReadValue(VariableIds.Server_NamespaceArray);

The next step fails to retrieve minimum supported sampling interval.
This read fails:
// fetch the minimum supported item sampling interval from the server.
DataValue minSupportedSamplingInterval =
OpcUaClientSession.ReadValue(VariableIds.Server_ServerCapabilities_MinSupportedSampleRate);

Here’s log output from the Publisher code:
06/12/2018 23:33:02: Connect and monitor session and nodes on endpoint ‘opc.tcp://172.18.0.1:4096/iaopcua/None’.
06/12/2018 23:33:03: Create unsecured session for endpoint URI ‘opc.tcp://172.18.0.1:4096/iaopcua/None’ with timeout of 10000 ms.
06/12/2018 23:33:04: Certificate ‘CN=Ignition OPC-UA Server, OU=Inductive Automation, O=Inductive Automation, L=Sacramento, S=California, C=US’ will be trusted, since the autotrustservercerts options was specified.
06/12/2018 23:33:04: Session successfully created with Id ns=1;i=3.
06/12/2018 23:33:04: The session to endpoint ‘opc.tcp://172.18.0.1:4096/iaopcua/None’ has 3 entries in its namespace array:
06/12/2018 23:33:04: Namespace index 0: UA Companion Specifications - OPC Foundation
06/12/2018 23:33:04: Namespace index 1: uri://127.0.0.1/Ignition%20OPC-UA%20Server
06/12/2018 23:33:04: Namespace index 2: uri://127.0.0.1/Ignition%20OPC-UA%20Server/exposed-tags
06/12/2018 23:33:04: Error in ConnectSessions.
06/12/2018 23:33:04: BadOutOfService
06/12/2018 23:33:04: at Opc.Ua.Client.Session.ReadValue(NodeId nodeId)
at OpcPublisher.OpcSession.d__24.MoveNext() in /build/src/OpcSession.cs:line 562

Note, the method that fails is from the OPC foundation UA-.NETStandard
https://github.com/OPCFoundation/UA-.NETStandard/blob/master/SampleApplications/SDK/Opc.Ua.Client

Is Server_ServerCapabilities_MinSupportedSampleRate a valid NodeId?

Any help you can provide would be greatly appreciated.

1 Like

It’s valid, yes, but it’s not present in our server’s address space (along with a bunch of other nodes).

It probably should be there, but the sample code you’re using shouldn’t be so fragile that it can’t handle it not being there. It’s common, especially for Nano profile embedded servers, to be missing all but the most essential nodes.

Thanks for the quick reply. This was my guess.

Luckily its open source, and I’m in the process of making it less fragile.

Cheers.

1 Like

I’m getting data into IOT hub now, which is pretty exciting.

I have one more question concerning expanded node ids vs node ids.

In the following configuration, the first node works, but the second does not.
“OpcNodes”: [
{
“ExpandedNodeId”: “nsu=http://opcfoundation.org/UA/;i=2258”
},
{
“ExpandedNodeId”: “nsu=uri://127.0.0.1/Ignition OPC-UA Server;s=[sim]_Meta:Ramp/Ramp2”
}

I can configure expanded node ids in ns=0, but not in ns=1.

I can configure Node IDs in ns=1, but according to the documentation this approach is deprecated.
{
“EndpointUrl”: “opc.tcp://172.18.0.1:4096/iaopcua/None”,
“UseSecurity”: false,
“NodeId”: {
“Identifier”: “ns=1;s=[sim]_Meta:Sine/Sine3”
}
},

Does the Ignition OPC UA server support the expandaed node Id format?

Whatever is happening in that configuration with NodeId vs ExpandedNodeId is specific to the sample you’re using; the service calls you end up using to read or subscribe to data all send NodeIds to the server.

1 Like

Try using uri://127.0.0.1/Ignition%20OPC-UA%20Client as the URI… worth a shot.

Thanks. That makes sense. I have a feeling that is has something to do with the the parsing of the spaces in the uri string. Probably a bug in the code.

Hello heybales,
I am also working with OPC Publisher from azure and I have succesfully connected over the cloud and OPC Server in which right now I am trying to adapt nsu or ns nodes which I would like to understand to use, did you success with Kevin answer?

Hey polpuca,

glad to hear that others are looking at this.

I did not resolve the issue with the expanded node ids. I used the deprecated configuration. For my pilot, this was acceptable.

Hello again Heybales,
I have been able to retreive the data from the OPC server and now I would like tro try to be able to modify its values of the Server with the client configuration do you know how to do it?
i am getting this:
31.07.2018 14:12:32> Device: [xxx], Data:[[{“EndpointUrl”:“xxxx/”,“Value”:{“Value”:false}}]]
Do you know how to clean up the Device: and Data to just have json format?

sorry for slow reply. I’ve been swamped with multiple projects.

I have not tried the write function.