Modbus Tcp Frame Format; Mbap Header Description - Omron CS1W-ETN21 Quick Start Manual

Sysmac cs/cj serie modbus tcp
Hide thumbs Also See for CS1W-ETN21:
Table of Contents

Advertisement

MANUEL STA46
1-3

Modbus TCP frame Format

A dedicated header is used on TCP/IP to identify the MODBUS Application Data Unit. It is called the
MBAP header (MODBUS Application Protocol header).
This header provides some differences compared to the MODBUS RTU application data unit used on
serial line:
The MODBUS ' slave address' field usually used on MODBUS Serial Line is replaced by a single
byte ' Unit Identifier' within the MBAP Header. The ' Unit Identifier' is used to communicate via
devices such as bridges, routers and gateways that use a single IP address to support multiple
independent MODBUS end units.
All MODBUS requests and responses are designed in such a way that the recipient can verify that
a message is finished. For function codes where the MODBUS PDU has a fixed length, the function
code alone is sufficient. For function codes carrying a variable amount of data in the request or
response, the data field includes a byte count.
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.
1-3-0

MBAP Header description

The MBAP Header contains the following fields:
Fields
Transaction
Identifier
Protocol
Identifier
Length
Unit Identifier
The header is 7 bytes long:
• Transaction Identifier - It is used for transaction pairing, the MODBUS server copies in the
response the transaction identifier of the request.
• Protocol Identifier – It is used for intra-system multiplexing. The MODBUS protocol is identified
by the value 0.
• Length - The length field is a byte count of the following fields, including the Unit Identifier and
data fields.
• Unit Identifier – This field is 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.
All Modbus/TCP ADU are sent via TCP on registered port 502.
JP Viskovic 30/08/2005 OEE-F
Length
Description
2 Bytes
Identification of a
MODBUS Request /
Response transaction
2 Bytes
0 = MODBUS protocol
2 Bytes
Number of following
bytes
1 Byte
Identification of a
remote slave
connected on a serial
line or on other buses
Modbus TCP
Client
Initialized by the
Recopied by the
client ( request)
server from the
received request
Initialized by the
Recopied by the
client ( request)
server from the
received request
Initialized by the
Initialized by the
client ( request)
server (Response)
Initialized by the
Recopied by the
client ( request)
server from the
received request
Server
5

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cj1w-etn21

Table of Contents