Mbap header description, Error handling and exception responses – Basler Electric DECS-250N User Manual
Page 218

202
9440500990 Rev D
Modbus™ Communication
DECS-250N
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 21.
Table 21. 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 DECS-250N 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 DECS-250N are provided in
Table 22.
Table 22. Supported Exception Response Codes
Code
Name
Description
01
Illegal Function
The query Function/Subfunction Code is unsupported;
query read of more than 125 registers; query preset of
more than 100 registers.
02
Illegal Data
Address
A register referenced in the data block does not support
queried read/write; query preset of a subset of a numerical
register group.
03
Illegal Data Value
A preset register data block contains an incorrect number
of bytes or one or more data values out of range.