Modbus Line
Modbus Line manages a Modbus communication line with one or many slave devices. It supports Serial, TCP, UDP, RTU-over-TCP, device discovery, register discovery, per-device polling, state tracking, and ModbusDeviceStateEvent generation.
Manage multiple Modbus devices on one line
The line keeps a device map with slave IDs, states, poll intervals, register definitions, read/write flags, last activity, and last error. It is the preferred component for RS485 buses, TCP gateways, UDP gateways, polling events, and ModbusWatermarkTask.
Shared bus
Track several slave IDs through one serial adapter or network gateway.
Discovery
Scan configured slave ID ranges and discover register maps during commissioning.
Polling events
Fire ModbusDeviceStateEvent when state, telemetry, or last error changes.
Choosing a connection type
SERIAL for several slave IDs on a shared adapter. Match serial settings to the bus.TCP for PLCs or gateways. Enable reconnect when the device or link can restart.Commissioning devices and register maps
Scan narrow slave ranges
Use ranges such as 1-10 or exact known IDs. Scanning 1-247 can make startup slow and noisy.
Discover registers carefully
Register discovery can probe coils, discrete inputs, input registers, and holding registers, and may write current values for writable detection.
Curate production maps
After discovery, keep useful registers, rename them, and set correct read/write flags.
Configuration parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
Connection type | Yes | SERIAL, TCP, or UDP. | SERIAL |
Network settings | Conditional | Network address, port, reconnect, and RTU-over-TCP mode for TCP/UDP connections. | None |
Serial settings | Conditional | Serial port, baud rate, data bits, stop bits, parity, encoding, flow control, echo, and open delay. | 9600, 8N1, rtu |
Validation and retries | Yes | CRC validation, transaction retry count, and transaction timeout. | CRC on, 2 retries, 500 ms |
RS485 settings | Optional | Termination, receive-during-transmit, TX polarity, and before/after TX delays for serial adapters. | Disabled |
Discovery | Optional | Automatic slave discovery on start, discovery ranges, and register discovery. | Disabled |
Polling and automation notes
Per-device poll interval
Use shorter intervals only for values that must react quickly. Increase intervals for slow meters or devices with many registers.
Disabled devices
A device in DISABLED state is skipped by polling and cannot be written by line actions.
Address translation
Vendor manuals may use labels such as 40001. Translate them to raw Modbus addresses before creating registers.