What It Is
Every Modbus request needs a target device address. On serial Modbus RTU networks this is usually called the Slave ID. On Modbus TCP networks it is usually called the Unit ID.
They serve the same practical role: identify the target device or route the request through a gateway path.
The important practical distinction is that the Unit ID in Modbus TCP is often trivial on standalone Ethernet devices but becomes critical when a gateway bridges TCP requests to a downstream serial network. In those cases, the Unit ID is often the actual routing key to the target RTU device.
Address Ranges
| Context | Field Name | Typical Valid Range | Notes |
|---|---|---|---|
| Modbus RTU | Slave ID | 1 to 247 | Must be unique on the serial bus |
| Modbus TCP | Unit ID | 0 to 255 | Often simplified for standalone TCP devices |
| Broadcast | Address 0 | Special case | Devices act, but do not respond |
Why It Matters
| Scenario | Impact |
|---|---|
| Duplicate RTU addresses | Causes collisions or confusing responses |
| Wrong Unit ID through a TCP-to-RTU gateway | Request reaches the wrong downstream device or no device at all |
| Broadcast used unintentionally | No response is returned, which can look like a timeout |
Common Failure Modes
| Failure Pattern | What Usually Happened | Practical Result |
|---|---|---|
| Duplicate serial address | Two RTU devices share one Slave ID | Responses collide or appear inconsistent |
| Gateway routing assumption is wrong | The TCP Unit ID was treated like a cosmetic field | Requests never reach the intended downstream device |
| Broadcast was used during normal validation | Address 0 was sent without understanding the behavior | The device may act, but no response comes back |
| Standalone TCP device ignored Unit ID differently than expected | The device handles Unit ID loosely or vendor-specifically | One tool works while another appears broken |
Commissioning Notes
Address validation should prove one known-good request to the actual intended device, not only a generic response from somewhere on the path. On serial links, that means confirming uniqueness on the bus. Through gateways, it means confirming the TCP Unit ID maps to the right downstream target and not just to any responding device.
[!WARNING] When a gateway bridges Modbus TCP to Modbus RTU, the Unit ID in the TCP request often maps directly to the RTU Slave ID on the serial side. A wrong Unit ID is then a routing mistake, not just a cosmetic field mismatch.