# Azure IOT Edge OPC Publisher

**URL:** <https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434>\
**Category:** Ignition\
**Created:** [June 13, 2018, 12:04am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434 "2018-06-13T00:04:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [June 13, 2018, 12:04am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/1 "2018-06-13T00:04:45Z")

</div>

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

> **[Azure/iot-edge-opc-publisher](https://github.com/Azure/iot-edge-opc-publisher)**
>
> Microsoft OPC Publisher. Contribute to Azure/iot-edge-opc-publisher development by creating an account on GitHub.

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](http://opcfoundation.org/UA/)  
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](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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 13, 2018, 12:21am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/2 "2018-06-13T00:21:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [June 13, 2018, 12:23am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/3 "2018-06-13T00:23:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [June 14, 2018, 12:02am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/4 "2018-06-14T00:02:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 14, 2018, 12:34am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/5 "2018-06-14T00:34:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 14, 2018, 1:11am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/6 "2018-06-14T01:11:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [June 14, 2018, 5:34pm UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/7 "2018-06-14T17:34:29Z")

</div>

> [@Kevin.Herron](#):
>
> calls you end up using to read or subscribe to data all send NodeIds to the server

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.

---

<div class="post-metadata">

**Author:** ![polpuca](https://avatars.discourse-cdn.com/v4/letter/p/c6cbf5/32.png) [@polpuca](https://forum.inductiveautomation.com/u/polpuca)\
**Post date:** [July 26, 2018, 2:23pm UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/8 "2018-07-26T14:23:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [July 27, 2018, 3:15am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/9 "2018-07-27T03:15:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![polpuca](https://avatars.discourse-cdn.com/v4/letter/p/c6cbf5/32.png) [@polpuca](https://forum.inductiveautomation.com/u/polpuca)\
**Post date:** [July 31, 2018, 9:02am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/10 "2018-07-31T09:02:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [August 9, 2018, 12:22am UTC](https://forum.inductiveautomation.com/t/azure-iot-edge-opc-publisher/18434/11 "2018-08-09T00:22:16Z")

</div>

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

I have not tried the write function.
