Modbus Protocol Parser
Online Modbus protocol parser supporting RTU/ASCII/TCP frame analysis, command building, register conversion, and CRC/LRC checks for industrial communication debugging.
Please enter data
Modbus Protocol Reference
Modbus is a common master-slave protocol in industrial automation across serial lines and Ethernet networks. This tool provides packet parsing, register conversion, command building, CRC/LRC checks, and serial debugging to speed up troubleshooting.
Modbus RTU Frame
RTU uses compact binary frames over serial links. A frame includes slave ID, function code, data field, and CRC-16 checksum.
Modbus TCP Frame
Modbus TCP prepends a 7-byte MBAP header before PDU, including transaction ID, protocol ID, length, and unit ID. Default port is 502.
Common Function Codes
Read function codes are used to fetch coil/register values, while write function codes update device states or parameters.
| Code | Name |
|---|---|
| 0x01 | Read Coils (0x01) |
| 0x02 | Read Discrete Inputs (0x02) |
| 0x03 | Read Holding Registers (0x03) |
| 0x04 | Read Input Registers (0x04) |
| 0x05 | Write Single Coil (0x05) |
| 0x06 | Write Single Register (0x06) |
| 0x07 | Read Exception Status (0x07) |
| 0x08 | Diagnostics (0x08) |
| 0x0B | Get Comm Event Counter (0x0B) |
| 0x0C | Get Comm Event Log (0x0C) |
| 0x0F | Write Multiple Coils (0x0F) |
| 0x10 | Write Multiple Registers (0x10) |
| 0x11 | Report Slave ID (0x11) |
| 0x14 | Read File Record (0x14) |
| 0x15 | Write File Record (0x15) |
| 0x16 | Mask Write Register (0x16) |
| 0x17 | Read/Write Multiple Registers (0x17) |
| 0x18 | Read FIFO Queue (0x18) |
| 0x2B | Encapsulated Interface Transport (0x2B) |
Byte Order Notes
Different PLC vendors use different byte/word layouts for 32-bit and 64-bit values. ABCD/DCBA/BADC/CDAB are common patterns in mixed-vendor projects.
CRC-16/Modbus Parameters
- Polynomial: 0x8005 (reflected form often shown as 0xA001)
- Initial value: 0xFFFF
- Reflect input: true
- Reflect output: true
- XOR out: 0x0000
Use Cases
- Troubleshoot timeout, exception code, and CRC errors between PLC and SCADA systems.
- Convert register byte streams to engineering values for field verification.
- Build read/write commands quickly without dedicated master software.
- Reproduce field issues with serial requests and response logs.