Today we open source and ship the AIT OPC Publisher edge module as a late christmas present. The AIT OPC Publisher is an Azure IoT Edge module forked from the Microsoft OPC Publisher which is now part of the Azure Industrial IoT solution. It extends the existing module by additional features like OPC UA event, method and IoT Central settings, properties and commands support.
The AIT OPC Publisher extends the existing module by the following features.
Cloud-to-device updates of nodes
It is now possible to update the value of published OPC UA nodes by changing them via the desired properties in the OPC Publisher module twin.
"properties": {
"desired": {
"i=2253": {
"value": 333
}
}
}
The result of the update will be published via the reported properties in the OPC Publisher module twin.
Cloud-to-device direct method invocation of OPC UA methods
The published nodes can now reference an OPC UA method. If the OPC UA node is a method it can be invoked by executing a direct method where the method name equals the node id. The arguments of the OPC UA method can be specified in the JSON payload.
"OpcNodes": [{
"Id": "i=11492",
"OpcSamplingInterval": 2000,
"OpcPublishingInterval": 5000,
"IotCentralItemPublishMode": "Command"
}]
Invoke direct method i=11492 with payload
{
"String Argument": "Test",
"Int32 Argument": 32
}
The published nodes can contain OPC UA events which can then be published as simple messages (telemetry), IoT Central events or IoT Central properties. The OPC UA events can reference a specific server event node, select multiple data inside the event and can even be filtered.
"OpcEvents": [{
"Id": "i=2253",
"DisplayName": "SimpleEventServerEvents",
"SelectClauses": [ { "TypeId": "i=2041", "BrowsePaths": ["EventId"] } ],
"WhereClause": [ { "Operator": "OfType", "Operands": [ { "Literal": "ns=2;i=235" } ] } ]
}]
IoT Central settings, properties and events
The AIT OPC Publisher can send value changes as simple telemetry, settings, properties or events.
"OpcNodes": [{
"Id": "i=2267",
"OpcSamplingInterval": 2000,
"OpcPublishingInterval": 5000,
"IotCentralItemPublishMode": "Setting"
}]
While events are messages formatted in a specific way, settings and properties are exchanged via the device twin. This can be used not only by IoT Central but also other IoT Hubs which know about that format.
Offline mode: Preserve receive timestamp to guarantee correct message order
The timestamp when the OPC UA node change was received by the OPC Publisher is saved in the message to guarantee a correct message order in an offline mode scenario. This guarantees that the data is displayed at the correct time and not at the time the connection is established again.
Message properties for message schema type (aggregated, flat) and endpoint id
The message properties sent by the OPC Publisher contain a property for the message schema type (flat list of properties or nested object) and a property for the endpoint id. The property for the endpoint id can then be used to specify which OPC UA server sent the specific changes.
We are happy to announce this release and hope you like it. If you find any issues or have additional feature requests, feel free to create a issue on
GitHub. We are also open to pull request.