Mbap header description, Error handling and exception responses – Basler Electric BE1-11 Modbus Protocol User Manual

Page 10

Advertising
background image

4

9424200774 Rev B

When Modbus is carried over TCP, additional length information is carried in the MBAP header to
allow the recipient to recognize message boundaries even if the message has been split into
multiple packets for transmission. The existence of explicit and implicit length rules and use of a
CRC-32 error check code (on Ethernet) results in an infinitesimal chance of undetected corruption
to a request or response message.

MBAP Header Description

The MBAP Header contains the fields listed in Table 2.

Table 2. MBAP Header Fields

Fields

Length

Description

Client

Server

Transaction
Identifier

2 Bytes Identification of a Modbus

request/response transaction.

Initialized by
the client.

Recopied by the
server from the
received request.

Protocol
Identifier

2 Bytes 0 = Modbus protocol.

Initialized by
the client.

Recopied by the
server from the
received request.

Length

2 Bytes Number of following bytes.

Initialized by
the client
(request).

Initialized by the
server (response).

Unit Identifier

1 Byte

Identification of a remote slave
connected on a serial line or on
other buses.

Initialized by
the client.

Recopied by the
server from the
received request.

The header is 7 bytes long:

Transaction Identifier – Used for transaction pairing, the Modbus server copies in the response
the transaction identifier of the request.

Protocol Identifier – Used for intra-system multiplexing. The Modbus protocol is identified by the
value 0.

Length – A byte count of the following fields, including the Unit Identifier and data fields.

Unit Identifier – Used for intra-system routing purpose. It is typically used to communicate to a
Modbus or a Modbus serial line slave through a gateway between an Ethernet TCP/IP network
and a Modbus serial line. This field is set by the Modbus Client in the request and must be
returned with the same value in the response by the server.

Note: All Modbus/TCP ADU are sent via TCP on registered port 502.

Error Handling and Exception Responses

Any query received that contains a non-existent device address, a framing error, or CRC error is ignored.
No response is transmitted. Queries addressed to the BE1-11 with an unsupported function or illegal
values in the data block result in an error response message with an exception response code. The
exception response codes supported by the BE1-11 are provided in Table 3.

General Information

BE1-11

Advertising