Modbus Response & Exception Codes

RTU & Modbus TCP frame builder

Build the request frame from a master, then preview the slave's normal or exception response. Useful for hand-checking MODBUS traffic on RS-232/485 or TCP links.

RTU adds a CRC-16; TCP uses the 7-byte MBAP header.
 

Request Frame

-

Response Frame

-

How it works

A Modbus frame is a single PDU (function code + data) wrapped by a transport. Modbus RTU (serial RS-232/485) prepends a slave address and appends a 16-bit CRC (polynomial 0xA001, low byte first). Modbus TCP (Ethernet) wraps the PDU with a 7-byte MBAP header [Transaction ID | Protocol ID | Length | Unit ID] and uses no CRC.

A slave signals an exception response by setting the high bit of the function code (e.g. FC 1 → FC 0x81) and appending one of the standard exception codes (0x01–0x08, plus 0x0A/0x0B for gateway-specific failures; 0x09 is reserved and never appears on the wire). The full list is shown in the dropdown above.

Bytes tagged placeholder are zeros that the master or slave would fill in with the actual register / coil values. This tool builds wire-level frame structure for hand-checking, not for decoding live bus traffic.

Comments