Modbus TCP Frame Tools

Generate and parse Modbus TCP frames. Inspect MBAP headers, function codes and register data.

Modbus TCP Request Generator

Modbus TCP Response Generator

Data Type
Byte Order
Value(Enter a decimal value)

Modbus TCP Frame Parser

Parsing Rules

Byte Offset
Data Type
Original Bytes
Byte Order
Reordered Bytes
Parsed Frame
Actions
Add a rule to decode values from the payload.

How to Use the Frame Tools

Generate and Inspect Frames

Create Modbus TCP requests and sample responses, inspect MBAP fields, and decode captured register data. Use a separate TCP client to exchange frames with a device.

What you can do:

  • Generate requests for the eight common read and write function codes.
  • Build sample response frames for tests and comparison.
  • Decode payload values using byte offsets, numeric types and byte orders.

Build a Request

  • Unit ID: use the value required by the TCP device or gateway.
  • Transaction ID: 0–65535; the server echoes it in the response.
  • Function code: choose 01/02/03/04/05/06/15/16 in decimal; 15 and 16 are 0x0F and 0x10.
  • Start address: the zero-based protocol offset, not a reference number such as 40001.
  • Quantity: number of bits or 16-bit registers to read or write.
  • TCP request examples:
  • 00 01 00 00 00 06 01 03 00 00 00 02 — read two holding registers at address 0.
  • 00 01 00 00 00 06 01 06 00 00 00 01 — write 1 to holding register address 0.
  • MBAP: transaction ID 00 01, protocol ID 00 00, length 00 06, unit ID 01.

Build a Sample Response

  • Choose the same function code as the request.
  • Add register values using signed, unsigned or IEEE 754 types.
  • Choose ABCD, DCBA, BADC or CDAB to match the device.
  • Use the request’s transaction ID in the TCP response.
  • Use the request’s unit ID in the TCP response.
  • TCP response examples:
  • 00 01 00 00 00 07 01 03 04 00 01 00 02 — two registers containing 1 and 2.
  • 00 01 00 00 00 06 01 06 00 00 00 01 — confirmation of the single-register write.
  • The response keeps the request’s transaction ID. MBAP length is calculated from the frame.

Decode a Captured Frame

  • Paste a complete frame from the selected Modbus format.
  • Add a rule for each value you want to read from the payload.
  • Choose the signed, unsigned or IEEE 754 type from the register map. Hex Converter
  • Select the byte order used by the device.
  • TCP frame fields:
  • Inspect transaction ID, protocol ID, length and unit ID in the MBAP header.
  • Modbus TCP adds no CRC or LRC to the application frame.
  • TCP frame: MBAP header (7 bytes), function code (1 byte), then function data.
  • Check protocol ID 0x0000 and confirm that length equals the unit ID plus PDU bytes.
  • TCP parsing example:
  • Frame: 00 01 00 00 00 07 01 03 04 00 01 00 02
  • Transaction ID 1; protocol ID 0; length 7; unit ID 1; function 03; register bytes 00 01 00 02.
  • For saved RTU read responses, open the serial debugger and choose File as the parsing source.

Modbus TCP Explained

Numeric Types and Limits

    Byte and Word Order

      Common Function Codes

        Check a TCP Exchange

          Ways to Use These Tools