How to convert Modbus RTU to OPC UA

How to Convert Modbus RTU to OPC UA

In the evolving landscape of industrial automation, seamless communication between legacy field devices and modern SCADA systems is essential. Modbus RTU, a long-standing serial communication protocol, remains prevalent in many industrial facilities. Meanwhile, OPC UA (Open Platform Communications Unified Architecture) has become the de facto standard for modern, secure, and interoperable data exchange. Converting Modbus RTU to OPC UA enables data integration across traditional and next-generation systems.

This guide explores the technical, architectural, and implementation aspects of converting Modbus RTU to OPC UA, enabling manufacturers and system integrators to modernize operations while leveraging existing investments.

nderstanding the Protocols

Modbus RTU Overview
Modbus RTU is a serial protocol developed by Modicon in 1979. It operates over RS-232 or RS-485 and is widely used due to its simplicity and reliability. Modbus RTU communicates in a master-slave format, where the master polls slaves for data.

Transmission Mode: Binary (RTU)

Communication: Half/Full Duplex over serial lines

Data Format: Register/coil-based

Limitations: No encryption, no discovery, limited addressing

OPC UA Overview
OPC UA is a platform-independent, service-oriented protocol for industrial automation and data exchange.

Transport: TCP/IP, HTTPS, WebSockets

Features: Discovery, security, data modeling, subscriptions

Communication Model: Client-server and publish-subscribe

Extensibility: Supports complex data structures and semantics

Use Cases for Modbus RTU to OPC UA Conversion

Integrating legacy Modbus RTU sensors and controllers into modern OPC UA-based SCADA or MES systems

Cloud integration using OPC UA clients in edge devices

Enhancing security and manageability in brownfield installations

Data standardization across heterogeneous devices

Conversion Architecture

Physical Connectivity
To convert Modbus RTU (serial) data into OPC UA (Ethernet-based), an intermediary device or software gateway is required.

Hardware Requirements:

Serial port (RS-232/RS-485)

Ethernet port (for OPC UA communication)

Gateway Functionality
The gateway must:

Act as a Modbus master (polling RTU slaves)

Translate Modbus registers to OPC UA nodes

Serve data to OPC UA clients securely

Network Architecture

Modbus RTU Devices <–RS-485–> OPC UA Gateway <–Ethernet–> SCADA/MES

Selecting the Right Gateway

Hardware Gateways

Softing edgeGate

ProSoft PLX51-UA-MB

HMS Anybus Communicator IIoT

ICP DAS UA-5231

Software-Based Gateways

Unified Automation SDKs

Kepware KEPServerEX with Modbus and OPC UA plug-ins

Matrikon OPC UA Tunneler

Open-Source Options

Open62541 (OPC UA library)

libmodbus (Modbus stack)

Node-RED with Modbus & OPC UA nodes

Implementation Steps

Prepare Modbus RTU Device Map
Understand the Modbus slave address, function codes, and register mappings.

Configure the Gateway

Set up serial parameters (baud rate, parity, stop bits)

Add Modbus polling configuration (addresses, intervals)

Define OPC UA namespace and node hierarchy

Test Modbus Communication

Use tools like ModScan or QModMaster

Ensure reliable polling and data integrity

Expose OPC UA Nodes

Map Modbus registers to OPC UA variables

Assign meaningful tag names, data types, and metadata

Connect to OPC UA Client

Use UaExpert or Ignition Designer to test connectivity

Browse the namespace, read/write values

Implement Security (Optional)

Enable user authentication, encryption (Basic256Sha256)

Restrict node access by role

Best Practices

Use structured namespaces (e.g., Devices/Boiler1/Temperature)

Enable diagnostic logs and monitor communication errors

Plan for retry logic and device timeouts

Use secure networks (VPN, VLANs) for OPC UA traffic

Advanced Features and Extensions

MQTT and Cloud Integration
Some gateways can publish OPC UA data to MQTT brokers for cloud applications (e.g., AWS IoT, Azure IoT Hub).

Companion Specification Support
For advanced applications, support for industry-specific OPC UA Companion Specs (e.g., PA-DIM, AutoID) can be added.

Edge Analytics
Gateways may support scripting, threshold alarms, or local storage for edge computing scenarios.

Troubleshooting Tips

Check serial wiring and termination

Monitor baud rate mismatches

Ensure the Modbus slave responds to polling

Use OPC UA logs to identify certificate or namespace issues

Conclusion

Converting Modbus RTU to OPC UA bridges the gap between legacy field devices and next-generation automation systems. Whether through hardware gateways or software stacks, the conversion enables secure, standardized, and scalable data communication. With careful planning and configuration, organizations can preserve existing investments while unlocking the potential of OPC UA for smart manufacturing, IIoT, and Industry 4.0.

This guide provides a blueprint for engineers, integrators, and decision-makers embarking on the journey of Modbus to OPC UA migration. As more SCADA systems adopt OPC UA natively, mastering this conversion becomes an essential skill in the modern automation toolkit.

Appendix A: Sample Node Mapping Table

Modbus Address

Function Code

OPC UA Node Name

Data Type

40001

03 (Read Holding)

Boiler1.Temp

Float32

40002

03

Boiler1.Pressure

Float32

00001

01 (Read Coil)

Pump1.Status

Boolean

Appendix B: Recommended Tools

UaExpert – OPC UA client for testing

QModMaster – Modbus RTU testing tool

Wireshark – Packet capture and analysis

Open62541 – OPC UA open-source stack

libmodbus – Modbus RTU/TCP library

ANC-300e: Ethernet/IP & Modbus TCP to Serial Modbus RTU, DF1 Converter
The ANC-300e has the combined performance as an Ethernet and RS-485 serial converter. The gateway behaves like a protocol converter/translator that allows difficult data interchanges and connections between incompatible networks. Protocols include:

RS485 serial Protocols:
Modbus RTU, Modbus Sniffer, A.O. Smith AIN, A.O. Smith PDNP, BACnet MS/TP Client, BACnet MS/TP Server, TCS Basys Master, MSA Chillgard Monitor, DMX 512-Master, DMX-512 Slave, M-Bus Master, Metasys N2 Master, Metasys N2 Slave, Siemens FLN Master, Siemens FLN Slave, Sullair Master, Toshiba ASD Master, Toshiba PLC Master, DF1.

Ethernet Protocols:
Ethernet/IP Client/Server, AB CSP Ethernet Client/Server, Modbus TCP/IP, Profinet IO, BACnet/IP BBMD, BACnet/IP Client, BACnet/IP Server, Baumer VeriSens Client, CC-Link IE SLMP Client, MELSEC Client/Server, Generic Socket Client/Server & GreenFumeHood Client, Modbus TCP.

ANC-300e is an easily configurable Ethernet / RS-485 converter gateway, that provides integrated communication between all the above common industrial and commercial communication networks. As part of the ANC Gateway Converter Series, the ANC-300e provides a common platform which is convenient and easy to setup in all products.

The Automation Network ANC-300e Ethernet & Fieldbus Gateway Converter allows data to be seamlessly transferred between Ethernet to Ethernet and Ethernet to RS-485 networks with simple configuration.

Coming Soon: Need to get data from your EtherNet/IP or Modbus TCP/IP-based devices to your OPC UA clients? This ANC-300e additional functionality is coming shortly.

Scroll to Top