C5-E Modbus TCP/USB Online Manual

MBAP Header

With Modbus TCP, a Modbus Application Protocol Header (MBAP Header for short) precedes the actual message.

This header consists of the following parts:

Name Length Value
Transaction Identifier 2 bytes
Protocol Identifier 2 bytes 0000h (Modbus)
Length 2 bytes
Unit Identifier 1 byte 00h

The MBAP Header is 7 bytes long:

Transaction Identifier
It is used for transaction pairing; the server (the controller) copies the value from the client's request in the response. If the client increases the number on each query, the response can be uniquely assigned to the query.
Protocol Identifier
Because a Modbus protocol is used, the field always has the value 0.
Length
The length of the data including the Unit Identifier field (1 byte), the function code (1 byte) and the data.
Unit Identifier
This field is used for internal system routing. Because the controller does not support routing, the field always has the value 0.
▶   next

Contents