PortDock

Reading Modbus RTU frames — request, response, exception, CRC

Decode «01 03 00 00 00 02 C4 0B» byte by byte: address, function, start, quantity, CRC, exception replies and the 40001 notation.

Tools for this guideSerial Windows program · freeModbus Master Windows program · freeModbus RTU Request Builder web · no installCRC & Checksum Calculator web · no install

Modbus RTU is a binary protocol over serial lines (RS-485, RS-232). The master (PLC, HMI, PC) sends a request and only the slave with the matching address replies. With the register map from the device manual you can build requests yourself.

Request: read 2 holding registers

01 03 00 00 00 02 C4 0B
BytesMeaning
01Slave ID 1
03Function 03 — read holding registers
00 00Start address 0 (high byte first)
00 02Quantity 2
C4 0BCRC16 — low byte first

Response: values 100 and 200

01 03 04 00 64 00 C8 BA 7A
BytesMeaning
01 03Same address and function
04Data byte count (2 registers × 2)
00 64First register = 100
00 C8Second register = 200
BA 7ACRC16
Byte-strip diagram of the Modbus RTU request 01 03 00 00 00 02 C4 0B and response 01 03 04 00 64 00 C8 BA 7A, split into slave ID, function, start address, quantity, byte count, register values and CRC
The request and response split into byte fields. CRC16 covers the slave ID through the last data byte and is sent low byte first.

Exception replies

When a request cannot be served, the slave adds 0x80 to the function code and appends an exception code. This one is «illegal data address (02)».

01 83 02 C0 F1

40001 means address 0

«40001» in a manual means «the first holding register»; the address on the wire is 0. 40010 is 9, and 30001 (input registers) is address 0 with function 04. If values look shifted by one, check this notation first.

CRC and byte order

CRC16 Modbus uses polynomial 0xA001 (reflected) and initial value 0xFFFF over everything from the address to the last data byte, and the low byte is sent first. The CRC above is 0x0BC4 and appears as «C4 0B». Try «01 03 00 00 00 02» in the CRC calculator to check.

The silent interval between frames

RTU ends a frame after 3.5 character times of silence. One character is 11 bits (start, 8 data, parity or stop, stop).

Baud1 char3.5 chars8-byte request on the wire
96001.15 ms4.0 ms9.2 ms
192000.57 ms2.0 ms4.6 ms
384000.29 ms1.0 ms (spec recommends 1.75 ms)2.3 ms
1152000.10 ms0.33 ms (spec recommends 1.75 ms)0.8 ms

Above 19200 bps the specification recommends a fixed 1.75 ms instead of 3.5 characters. USB adapters deliver data in chunks of several milliseconds, which easily breaks this timing — see the next guide.

Write requests: functions 06 and 16

Write requests follow the same order — slave ID, function, address … CRC. On success, function 06 echoes the request back and function 16 returns only the start address and quantity.

01 06 00 01 00 64 D9 E1
BytesMeaning
01 06Slave ID 1 · function 06 — write single register
00 01Address 1 (manual notation 40002)
00 64Value 100
D9 E1CRC16 — the reply is the same 8 bytes
01 10 00 00 00 02 04 00 64 00 C8 B3 E6
BytesMeaning
01 10Slave ID 1 · function 16 (0x10) — write multiple registers
00 00 00 02Start address 0 · quantity 2
04Number of value bytes that follow
00 64 00 C8Values 100 and 200
B3 E6CRC16 — the reply is 01 10 00 00 00 02 41 C8

Know the reply length in advance

A function 03 or 04 reply is 5 + 2 × quantity bytes (slave ID, function and byte count 3 + data + CRC 2). Ten registers give 25 bytes; the maximum of 125 per request gives 255. If the received length differs, the reply was split or mixed with other data.

See the decode in PortDock

Published 2026-10-17