Ethernet Communications Modules, 3rd Edition, Rev. D
5-2
Chapter 5: MODBUS TCP for H0/H2/H4-ECOM100
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Modbus TCP
Modbus TCP is essentially the serial Modbus RTU protocol encapsulated in a TCP/IP wrapper.
Modbus RTU is used for serial communications between a master and slave(s) devices. Modbus
TCP is used for TCP/IP communications between client and server devices on an Ethernet
network. The TCP version of Modbus follows the OSI Network Reference Model.
Client / Server Model
The Modbus messaging service provides a Client/Server communication between devices
connected on an Ethernet TCP/IP network. This client / server model is based on four types of
messages:
• Modbus Request - the message sent on the network by the Client to initiate a transaction
• Modbus Confirmation - the Response Message received on the Client side
• Modbus Indication - the Request message received on the Server side
• Modbus Response - the Response message sent by the Server
Protocol Description
A typical Modbus TCP frame consists of the following fields:
The MBAP header (Modbus Application Protocol header) is seven bytes long. It consists of the
following fields.
• Transaction Identifier - It is used for transaction pairing, the Modbus server
copies in the response the transaction identifier of the request. (2 bytes)
• Protocol Identifier - It is used for intra- system multiplexing. The
Modbus protocol is identified by the value 0. (2 bytes)
• Length - The length field is a byte count of the following fields,
including the Unit Identifier and data fields. (2 bytes)
• 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. (1 byte)
Client / Server Model
Client Server
Confirmation Response
The H0/H2/H4 - ECOM100 can
act as a Client or Server
Request Indication
TCP HEADER MBAP HEADER FUNCTION DATA