Sapia
Incorporated Modbus Software Components for Developers |
Raw Frames |
The Raw Frames tab shows all of the raw data bytes that make up the request and response of the last Modbus/TCP message transmitted. Viewing the raw frames is very beneficial when troubleshooting communications problems with your Modbus/TCP device or for just understanding how Modbus/TCP messages are constructed.
Request Data
The Request Data field includes the Modbus Application Protocol (MBAP) header and the Protocol Data Unit (PDU). The total length for all bytes of the Request is shown as a decimal Length to the left of the data. The MBAP Header contains the following fields.
Request MBAP
Field | Length (bytes) | Description | Example |
Transaction Identifier | 2 | Identification of a Modbus Request/Response transaction. | 076B |
Protocol Identifier | 2 | 0 = Modbus Protocol | 0000 |
Length | 2 | Number of following bytes. | 0006 |
Unit Identifier | 1 | Identification of a remote slave connected on a serial line or other buses. | 01 |
The remaining bytes are for the Protocol Data Unit (PDU) which is function code dependant. All PDUs contain the following bytes.
Request PDU
Field | Length (bytes) | Description | Example |
Function Code | 1 | The Modbus function code. | 03 (Read Holding Registers) |
Data | variable | Function code specific data bytes. | 00 00 00 20 |
Response Data
The Response Data field includes the Modbus Application Protocol (MBAP) header and the Protocol Data Unit (PDU). The total length for all bytes of the Response is shown as a decimal Length to the left of the data. The MBAP Header contains the following fields.
Response MBAP
Field | Length (bytes) | Description | Example |
Transaction Identifier | 2 | Identification of a Modbus Request/Response transaction. | 076B |
Protocol Identifier | 2 | 0 = Modbus Protocol | 0000 |
Length | 2 | Number of following bytes. | 0043 |
Unit Identifier | 1 | Identification of a remote slave connected on a serial line or other buses. | 01 |
The remaining bytes are for the Protocol Data Unit (PDU) which is function code dependant. All PDUs contain the following bytes.
Response PDU
Field | Length (bytes) | Description | Example |
Function Code | 1 | The Modbus function code. | 03 (Read Holding Registers) |
Data | variable | Function code specific data bytes. | 40 00 00 ... 00 |