Modbus Master
The Modbus Master plugin reads and writes Modbus TCP, RTU, and ASCII devices.
Open the plugin
Open Development Configuration → Collection Configuration, create a device, and select Modbus Master as the collection plugin.
Create the channel and device through Collection Configuration. This page lists only Modbus-specific settings, addresses, and debug actions.
Read one known holding register
- Create a TCP client channel with the device's actual endpoint, for example
192.168.1.10:502. - Add a Modbus Master device, select
ModbusTcp, and enter its actual station number. Start with a1000ms execution interval and default advanced settings. - Add an enabled
Int16point at40001if the first holding register is a signed 16-bit value. - Compare its value, quality, and advancing collection time with a known source value before expanding the point table.
For RTU or ASCII, select a serial channel and match port, baud rate, data bits, stop bits, and parity. RTU over TCP still carries RTU frames. Verify MBAP for Modbus TCP, CRC for RTU, and text framing/LRC for ASCII; renaming a channel does not change framing.
In device debugging, 40001 and F=3;0 should read the same register. Stop affected tasks before reconfiguring a serial link. Test coils and registers separately before adding arrays: array length counts elements, while packing limits count bits or registers. After a permitted write to a safe point, verify through an independent master and then a new gateway sample.
See Channels and transport and Batch configuration.
Supported channels and data types
| Channel type | Check before configuration |
|---|---|
| TCP client | Confirm the device IP, port, and network reachability from the gateway. |
| TCP server | Confirm the local listening address and port, and that the field device can connect to the gateway. |
| Serial port | Confirm that the port is not in use and that baud rate, data bits, stop bits, and parity match the device. |
| UDP | Confirm the bind address, port, firewall rules, and packet source. |
Supported data types: Boolean, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float, Double, String, and Decimal.
Plugin properties
Configure channel type, endpoints, serial settings, TLS, connection timeout, and channel concurrency in the associated channel. Open its editor beside Associated Channel in the device editor. Retry count, read/write duty cycle, write priority, protocol timeout, data format, and string byte reversal are device plugin properties. See Collection Configuration for shared fields. The tables below list Modbus-specific settings.
Protocol
| Setting | Description |
|---|---|
| Modbus type | Select ModbusTcp, ModbusRtu, or ModbusAscii to match the field device and channel. |
| Default station | Station used when the variable address does not specify one. The default is 1. |
Runtime and data format
| Setting | Description |
|---|---|
| Read/write timeout | Default 3000 ms for a protocol response; independent of the collection interval. |
| Failure retries | Default 3. Error type and driver policy determine actual retries; include their requests and waiting time. |
| Pre-frame delay | Default 0 ms before sending. Multiple requests each incur the delay; this does not configure RTU frame boundaries. |
| Read/write duty cycle | Default 3. Under sustained read/write contention, counts writes before giving waiting reads an opportunity. It is not a percentage or a guaranteed 3:1 ratio in every observation window. |
| Write priority | Default off. Affects supported scheduling under contention; verify write results and source feedback separately. |
| Data format | Default ABCD; choose ABCD, BADC, CDAB, or DCBA to match the point table. Address option data= can override a single point. |
| String byte reversal | Default off. Swaps the two characters inside each word: the same ASCII source PLC001 becomes LP0C10. This is separate from numeric byte order and text encoding. |
Request packing
These limits count bits or registers in each request; variable rows can occupy different widths. Keep the defaults unless the device manual specifies a smaller limit.
| Setting | Range / default | Description |
|---|---|---|
| FC1 maximum coils | 1–2000, default 1600 | Maximum coil bits read in one FC1 request. |
| FC2 maximum discrete inputs | 1–2000, default 1600 | Maximum discrete-input bits read in one FC2 request. |
| FC3 maximum holding registers | 1–125, default 100 | Maximum holding registers read in one FC3 request. |
| FC4 maximum input registers | 1–125, default 100 | Maximum input registers read in one FC4 request. |
| FC15 maximum multiple-coil write | 1–1968, default 1968 | Maximum coil bits written in one FC15 request. |
| FC16 maximum multiple-register write | 1–123, default 123 | Maximum registers written in one FC16 request. |
DTU connection
| Setting | Description |
|---|---|
| DTU ID | Identifier used to match a registered DTU connection when the channel is a DTU service. Leave it empty for ordinary direct connections. |
When the channel type is a DTU service, DTU ID must exactly match the identifier registered in DTU Service. Leave it empty for direct TCP, serial, or UDP channels.
Address rules
Use the address area that matches the Modbus function:
| Address range | Area |
|---|---|
00001 onward | Coils |
10001 onward | Discrete inputs |
30001 onward | Input registers |
40001 onward | Holding registers |
Examples:
40001is the first holding register.40001;s=2;reads station2instead of the default station.40001;w=16;uses function code16when writing the value.F=3;100explicitly uses function code3at protocol offset100for a holding-register read. WithF=, the address is a zero-based offset rather than a40001-style area address.- Combine options with semicolons, for example
S=2;F=3;100. The options apply to this variable address only.
W= accepts a positive write function code; 15 (multiple coils) and 16 (multiple registers) are the usual values. When it is omitted, the write function follows the variable data type and protocol defaults.
See Common variable register options for data, len, bcd, encoding, and combined examples. Verify the address against the device point list before importing many variables.
Device debug
Open Development Configuration → Collection Configuration, select the Modbus device, and click More Functions, then open Debug.
Read and write

Read a confirmed safe address first. Before writing, confirm the variable permission, station, function code, data type, and field safety conditions.
Messages

Use the message view to check sent and received frames, connection failures, and protocol parsing errors.
Functions
| Function | Purpose |
|---|---|
| Read and write | Read a confirmed point and write only to an approved test point. |
| Messages | View sent and received frames, protocol fields, and error details. |
Register bits and Byte reads
For a holding-register Boolean, .0–.15 selects a bit. With known source bytes 04 D2 (1234), 40001.0 is false and 40001.1 is true. A nonzero whole register does not make every bit true.
Check periodic collection and single-Byte debugging separately. For the same 04 D2 source, a periodic Byte point at 40001.0 can return low byte 210. The debug Read/Write single-Byte operation returns the first response byte, 4; adding .1 there does not select the low byte. Compare the business point and raw frame when validating the point-table mapping.
Array length counts elements: three Int16 elements occupy three registers; three Float elements occupy six. If one array exceeds the slave request limit, shorten or split it instead of adjusting the number of variable rows.
One array write must also fit the FC15/FC16 limit; a smaller limit does not automatically split it. Writing three Int16 elements is rejected with FC16 set to 2; a limit of 4 allows it only if the slave supports that range. Inspect every address result in a batch rather than treating outer-request success as complete success.
Decimal uses a sixteen-byte representation occupying eight holding registers, not a universal PLC decimal format. Choose scaled integers, Float, or Double according to the device layout. For 64-bit counters, compare source bytes and the receiver's complete integer representation; an approximate browser number is insufficient to confirm precision.
Verify the configuration
- Read one confirmed field address.
- Confirm that the returned value, data type, byte order, station, and function code match the point list.
- For a writable point, write a safe value and read it back according to the field procedure.
- Only after the single-point check passes should you import the complete point list.
Troubleshooting
| Symptom | Check |
|---|---|
| Address read fails | Check the address area, station suffix, data type, and device point list. |
| Serial device does not respond | Check port ownership, baud rate, data bits, stop bits, parity, and channel type. |
| TCP device does not respond | Check the remote or bind address, firewall, station, and Modbus type. |
| Values are shifted or incorrect | Check data type, byte order, array length, and the address offset. |
| Batch read is rejected | Reduce the corresponding FC1–FC4 limit and compare it with the device manual. |
| Batch write is rejected | Keep FC15 between 1–1968 and FC16 between 1–123, then compare the configured limit with the device manual. |
Related links
- Collection Configuration: Channels, devices, variables, import, and common debug entry.
- Plugin Manual Index: Other collection and data-forwarding plugins.