![background image](http://html2.mh-extra.com/html/icp-das-usa/wf-2017/wf-2017_user-manual_3566431045.webp)
WF-2000 Series AIO
User’s Manual (Ver. 1.2, May./2014) ------------- 45
Modbus/TCP Application Data Unit
Transaction ID
(2 bytes)
Protocol
ID
(2 bytes)
Length
(2 bytes)
Unit ID
(1 bytes)
FCode
(1 bytes)
Data
(0 to 252 bytes)
MBAP Header
Protocol Data Unit
Figure
5-1 Modbus/TCP Application Data Unit
5.2.1
MBAP
The Modbus/TCP extension includes 7 additional bytes to the
original Modbus protocol, which allows for transport over the TCP/IP
layers.
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). The MBAP Header consists of 7 bytes of
information:
Table
5-1 MODBUS Application Protocol Header
Fields
Length
Description
Transaction
Identifier
2 bytes
Identification of Request/Response transaction –
Copied from request to response
Protocol Identifier
2 bytes
0 = Modbus protocol
Length
2 bytes
Number of following bytes - Includes the Unit
Identifier
Unit Identifier
1 byte
Identification of remote slave
5.2.2
Function Code
The function code field of a Modbus data unit is coded in one byte.
Valid codes are in the range of 1 ... 255 decimal (the range 128 - 255 is
reserved and used or exception responses). When a Modbus request is
sent from a Modbus Client to a Server device the function code field tells
the Server what kind of action to perform.
The Modbus/TCP feature of WF-2000 series module supports 7
function codes, which allows the reading and writing of data contents of
registers.