Home

Modbus Frame Builder

Build RTU and TCP read/write frames with automatic CRC16 and MBAP header.

Request parameters
Fill in the parameters and the complete frame appears: RTU appends CRC16, TCP adds the MBAP header.

RTU: unit id + PDU + CRC16 (little endian) — serial / RS-485.

For read requests the quantity must be 1 - 125.

Frame
8 bytes
RTU
01 03 00 00 00 0A C5 CD
C array
const uint8_t buf[] = { 0x01, 0x03, 0x00, 0x00, 0x00, 0x0A, 0xC5, 0xCD, };
Field breakdown
Unit ID1
Function0x03
Address0x0000
Quantity10
CRC160xCDC5
Notes

The CRC is CRC-16/MODBUS (the same model as in the CRC calculator), appended little-endian.

Quantity limits come from the spec: 2000 read coils, 1968 write coils, 125 read registers, 123 write registers.

Everything is computed locally in your browser — nothing is uploaded.