When an HMI, SCADA system or PC program reads a Modbus device one request per tag, every extra device and tag makes the poll cycle longer. Each request carries more than its data: sending the request, the device's processing time, and the pause before the next request. So values with nearby addresses are read together in «blocks». This guide sets out the rules and limits.
Rule 1 — one table, one contiguous run per request
- The function code picks the table: 01 coils, 02 discrete inputs, 03 holding registers, 04 input registers. 40001 (holding) and 30001 (input) are both wire address 0 but cannot share a request.
- A request is «start address + quantity», so it reads a contiguous run. To get 40001 and 40010 together you read 40001–40010, ten registers, and the eight in between come along whether you need them or not.
- The specification's own example (§6.3) works this way: reading registers 108–110 uses start address 0x006B (107) and quantity 3. Number X goes on the wire as X − 1 (§4.4).
Rule 2 — quantity limits
| Function | Max per request (spec) | Response data |
|---|---|---|
| 01 Read Coils | 2000 | ⌈quantity ÷ 8⌉ bytes |
| 02 Read Discrete Inputs | 2000 | ⌈quantity ÷ 8⌉ bytes |
| 03 Read Holding Registers | 125 | 2 × quantity bytes |
| 04 Read Input Registers | 125 | 2 × quantity bytes |
Reading 125 registers gives a response PDU of function 1 + byte count 1 + data 250 = 252 bytes, within the 253-byte PDU maximum (§4.1). Devices may accept fewer — see «Max per request» on the device register map or the manual. Above the limit, the device answers with exception 03 (Illegal Data Value).
Rule 3 — gaps and exception 02
If a grouped request includes an address the device does not define, many devices reject the «whole» request with exception 02 (Illegal Data Address). The specification's processing order also checks whether «start + quantity» fits the device's range and returns 02 if not. Some devices fill undefined registers with 0 instead; this varies, so check the manual or test.
- Start by grouping only adjacent values (allowed gap 0); if no exceptions come back, widen the gap step by step.
- If you get exception 02, split that request's range in half and read each part to narrow down which address is missing.
- Read both words of a 32-bit value (float, energy counter) in the same request. Split across requests, the value can change in between and the two halves no longer match.
How much faster — a worked example
Take ten holding registers (40001–40010) at 9600 bps 8E1, with the device replying 10 ms after a request. One request per value means ten requests of 8 bytes out and 7 bytes back. One request for all means 8 bytes out and 25 back.
| Method | Requests | RTU bytes | Cycle (calculated) |
|---|---|---|---|
| One per value | 10 | 150 | about 312 ms |
| One request | 1 | 33 | about 52 ms |
Bytes fell 4.5-fold and time six-fold, because the device delay (10 ms here) and the 3.5-character pause repeat for every request. The longer the device takes to process, the more grouping helps. Modbus TCP has no serial transmission time, but processing and the network round trip still repeat per request.
Split the poll rate too
- Measurements (current, temperature — values that change often) and settings (values that rarely change) need not be read at the same rate. Poll the measurement block often and the settings block rarely.
- With several devices on one RS-485 line, the cycle is the sum over devices of blocks × transaction time. Check it against your target and cut the number of blocks.
- PortDock Modbus Master gives each table (tab) its own Slave ID, function, start, count and interval, so make one table per block and set its rate. Picking a built-in device map with «Device profile» groups only contiguous registers per function code into tables, because many devices answer exception 02 for unused addresses. The traffic log shows every request and reply, so you can spot the one that raised an exception.
Sources
- MODBUS Application Protocol Specification V1.1b3 — §4.4 addressing model, §6.1–6.4 quantity limits, §7 exception codes
Published 2026-10-29