Connect to a Modbus device and map register addresses to tags.
Home → Tutorials → Industrial Operations Tutorial → Devices Module Tutorial → Connect to a Modbus Device Tutorial
This tutorial teaches you to:
- Configure a Modbus TCP communication channel
- Add a device node for a Modbus slave
- Map Modbus register addresses to UNS tags
- Monitor communication status at runtime
Prerequisites
1. Create the Device Channel
- Navigate to Devices → Channels
- Click New channel and configure:
- Channel Name:
ModbusChannel - Protocol:
Modbus - Interface:
TCP/IP
- Channel Name:
2. Add a Device Node
- Go to Devices → Nodes
- Create a node with:
- Name:
PLC1 - Channel:
ModbusChannel - PrimaryStation:
127.0.0.1;502;1(semicolon-separatedIP;Port;SlaveID— 502 is the standard Modbus TCP port, 1 is the unit/slave ID)
- Name:
3. Create Device Points
Modbus addresses are composed as an operand prefix + a 5-digit zero-padded address. The operand selects the register family:
0xxxxx— Coil (read/write bit)1xxxxx— Discrete Input (read-only bit)3xxxxx— Input Register (read-only 16-bit)4xxxxx— Holding Register (read/write 16-bit)
- Navigate to Devices → Points
- Add the points below.
Holding Register — Tank 1 Level:
- Tag Name:
TankFarm/Tank1/Level - Node:
PLC1 - Address:
400001(Holding Register #1) - Data Type:
Native - AccessType:
ReadWrite
Holding Register — Tank 2 Level:
- Tag Name:
TankFarm/Tank2/Level - Node:
PLC1 - Address:
400002(Holding Register #2) - Data Type:
Native - AccessType:
ReadWrite
Tip: Native lets the driver pick the data type from the register width. To force a specific type, use the canonical enum values (Real, Single, Bit, etc.) — see the Modbus driver Reference for the full list and for byte/word-order options.
4. Start the Modbus Device Simulator
- Navigate to Devices → Channels
- Select
ModbusChannel - Run the built-in Modbus Simulator (right-click the channel row → Run Simulator). The simulator listens on
127.0.0.1:502by default and emulates a Modbus slave so you can test the loop without hardware.
5. Test Communication
- Click Start Runtime.
- Open Devices → Monitor.
- Confirm the node is healthy:
ActivityCounteris increasing andLastErrorCodestays at0. - Open the tag-value view (Unified Namespace → Tags, runtime grid) and confirm
TankFarm/Tank1/LevelandTankFarm/Tank2/Levelare receiving non-stale values from the simulator.