Skip to main content Skip to footer

Search Crosser Knowledge Base

Crosser + UNS - Publish OPC data to UNS

Connecting industrial equipment to the UNS requires publishing data using the correct data model and a well-defined MQTT topic structure. The example below demonstrates a straightforward approach to achieving this using OPC UA.

1. Connect to OPC UA Server

You can specify the NodeIds to subscribe to in one of three ways: manually through the module UI, by providing a resource file, or by sending a NodeId list from the OPC UA Browser.

For the first two approaches, you don’t need the MQTT Sub Client and OPC UA Browser module since you specify the tags directly.

The third approach allows you to trigger the browsing from external systems and also to send in the root NodeId from which to start the browsing. This will update all subscriptions on the OPC UA Subscriber module.

An end-to-end flow including the browsing capability could look like this.
Crosser Flow Example - UNS

2. Map data to your envisioned data model

The Message Template module can be used to map data from the incoming message using template syntax.

Crosser Example

3. Create MQTT topic based on ‘path’ in OPC UA

To create the MQTT topic you can use the Property Mapper, add a new property called ‘topic’ which is a concatenated string with a site-name ‘stockholm’ and the path from OPC UA.

Crosser Example

4. Publish data to UNS

The MQTT Publisher will now publish the messages in the defined data model to the dynamic MQTT topic.

Crosser Example

Note: When working with protocols like Modbus, S7, or others that lack a clear data structure, you can include the relevant topic information and other metadata directly in the resource file. Learn more about this.

About the author

David Nienhaus | Senior Solution Engineer

David is a Senior Solution Engineer at Crosser. He has over 15 years experience working with software integration and digitization projects for critical infrastructure.
His engineering background gives him the understanding and focus needed to solve customer use cases in the most efficient and successful way.