Modbus is widely used in BAS for integrating meters, VFDs, chillers, and other equipment. Understanding the differences between RTU and TCP variants is essential for successful integration.
| Feature | Modbus RTU | Modbus TCP |
|---|---|---|
| Physical Layer | RS-485 serial | Ethernet |
| Addressing | Device address (1-247) | IP address + Unit ID |
| Speed | 9600-115200 baud | 10/100/1000 Mbps |
| Max Devices | 32 (RS-485 limit) | Unlimited (network) |
| Cabling | Twisted pair | Cat5e/Cat6 |
| Error Detection | CRC-16 | TCP checksum |
Modbus RTU uses RS-485 serial communication:
Wiring requirements:
Wiring diagram:
[T] = 120Ω Termination at both ends
| Parameter | Range | Notes |
|---|---|---|
| Device Address | 1-247 | 0 = broadcast |
| Baud Rate | 9600-115200 | Must match all devices |
| Data Bits | 8 | Standard |
| Parity | None/Even/Odd | Must match |
| Stop Bits | 1 or 2 | Must match |
Most BAS equipment defaults:
Modbus TCP uses standard Ethernet:
Network requirements:
| Parameter | Description |
|---|---|
| IP Address | Device network address |
| Port | 502 (standard) |
| Unit ID | 1-247 (often 1 or 255) |
Unit ID note: In TCP, Unit ID is used for gateway scenarios where one IP hosts multiple Modbus devices.
Both RTU and TCP use the same register model:
| Register Type | Address Range | Access | Typical Use |
|---|---|---|---|
| Coils | 00001-09999 | R/W | Binary outputs |
| Discrete Inputs | 10001-19999 | R | Binary inputs |
| Input Registers | 30001-39999 | R | Analog inputs |
| Holding Registers | 40001-49999 | R/W | Analog outputs, parameters |
Note: Different vendors use different conventions:
| Convention | Register 40001 Written As |
|---|---|
| Modicon (1-based) | 40001 |
| 0-based | 0 |
| Hex | 0x0000 |
Always verify register addresses against device documentation.
| Type | Registers | Range |
|---|---|---|
| UINT16 | 1 | 0-65535 |
| INT16 | 1 | -32768 to 32767 |
| Type | Registers | Byte Order |
|---|---|---|
| UINT32 | 2 | Big/Little Endian |
| INT32 | 2 | Big/Little Endian |
| FLOAT32 | 2 | IEEE 754, check word order |
Byte order warning: Word/byte order varies by manufacturer. Test with known values!
| Scenario | Reason |
|---|---|
| Legacy equipment | Only serial available |
| Simple point-to-point | Direct connection to device |
| No Ethernet infrastructure | Serial is only option |
| Short distances | Within same enclosure |
| Cost-sensitive | Serial hardware cheaper |
| Scenario | Reason |
|---|---|
| Modern equipment | Native Ethernet support |
| Long distances | Ethernet switches extend range |
| High speed needed | Ethernet faster than serial |
| Multiple systems need access | IP allows multiple clients |
| Existing Ethernet network | Leverage infrastructure |
Convert between RTU and TCP:
| Problem | Check |
|---|---|
| No communication | Wiring, termination, address |
| Intermittent errors | Baud rate mismatch, noise |
| CRC errors | Cable quality, grounding |
| Timeout | Address conflict, device offline |
| Problem | Check |
|---|---|
| Connection refused | IP address, port 502 open |
| Timeout | Network connectivity, firewall |
| Unit ID errors | Check gateway configuration |
| Slow response | Network congestion |