Modbus to OPC UA
PLCGateway reads Modbus TCP and RTU devices and serves their registers and coils from an OPC UA server as named, typed variables that MES, SCADA and historians can browse.
- Modbus TCP / RTU
modbus_tcpmodbus_rtu_tcpmodbus_rtu- OPC UA
Modbus has no names, no data types and no security: a register number means something different in every device. OPC UA has all three. PLCGateway holds the register map once – address, data type, word order, scaling, unit and description – and presents the result as an OPC UA address space.
The IT side then works with variables such as meter1.ActivePower instead of register 40101, over an encrypted and authenticated connection if required, while the devices keep speaking plain Modbus in the machine network.
- Source
- Modbus TCP / RTU
modbus_tcpmodbus_rtu_tcpmodbus_rtu - Connection
- TCP 502 · RTU over TCP · RS-485 / RS-232
- Target
- OPC UA
- Writing
- yes
Set it up in five steps
Add a device, choose Modbus TCP, RTU over TCP or RTU serial and enter the IP address or the serial port with baud rate and parity.
Set the unit id and, for 32-bit values, the word order of the device.
Create the tags with their addresses and data types, or import a register list from CSV; test the connection to see the first values.
Open Gateway → OPC UA and choose the security modes and whether clients sign in anonymously or with user name and password.
Connect your OPC UA client (UaExpert, an MES, a SCADA) to opc.tcp://<gateway>:4840 and browse Objects → PLCGateway.
Example: node ids in the OPC UA server
A device with the id meter1 and these tags appears in the address space as shown below. Names and values are examples.
| Tag | Address | Example value |
|---|---|---|
ActivePower | HR100 | 42.75 kW |
Energy | HR200 | 128450.5 kWh |
PumpRunning | C12 | true |
OPC UA node ids
opc.tcp://<gateway>:4840
Objects / PLCGateway / meter1
ns=1;s=meter1.ActivePower = 42.75
ns=1;s=meter1.Energy = 128450.5
ns=1;s=meter1.PumpRunning = true
Every tag is a variable under Objects / PLCGateway / device in namespace 1; clients read it, write it and subscribe to its changes.
The OPC UA server in PLCGateway
Every tag becomes a variable in PLCGateway's built-in OPC UA server, so MES, ERP, SCADA and historians use one standard endpoint instead of each controller's own protocol. Clients browse the devices and tags, read, write and subscribe to value changes.
The server offers the security modes None, Sign and SignAndEncrypt with automatically generated certificates; clients sign in anonymously or with user name and password.
- One endpoint (opc.tcp, port 4840) for all devices and protocols
- A folder per device and a variable per tag, with description and unit
- Subscriptions with data-change notifications; writing only where the tag allows it
- Client certificates are approved in the web interface
Controllers and devices
Equipment that is typically connected with this driver.
Modbus TCP / RTU
Registers, coils and discrete inputs over TCP, RTU over TCP or serial RS-485.
Learn more →Schneider Electric Modicon
Modicon M580, M340, Quantum, Premium, M221, M241 / M251 / M262
Learn more →CODESYS-based controllers
WAGO PFC200, ABB AC500, Modicon M262, Eaton XC300, Festo CPX-E, soft PLCs
Learn more →Building automation and energy meters
Desigo, Metasys, Honeywell, EcoStruxure, chillers, AHUs, energy meters
Learn more →Questions and answers
Can I import a register list?
Yes. Tags are entered by hand or imported from CSV with address, data type and description, and exported the same way.
Which Modbus variants are supported?
Modbus TCP, Modbus RTU over TCP and Modbus RTU on a serial line, each with unit id, word order and block-read settings per device.
Does the gateway also work the other way round?
Yes. PLCGateway also has a Modbus TCP server that offers the tags of every driver as registers and coils, for systems that only speak Modbus.
Connect your machines
Tell us which controllers you run; we show you PLCGateway with your own addresses.
Product and model names are trademarks of their owners. They are named only to show which equipment the drivers communicate with; PLCGateway is not affiliated with these companies.
