tWF-DA1PD2R1 User’s Manual
tWF-DA1PD2R1
User’s Manual (Rev1.0, APR./2019) ------------- 27
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:
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
Table 5-1: MODBUS Application Protocol Header
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 tWF-DA1PD2R1 controller supports 6 function codes,
which allows the reading and writing of data contents of registers.
Function Code
Descriptions
01 (0x01)
Read Coil Status
02 (0x02)
Read Input Status
03 (0x03)
Read multiple AO Registers
04 (0x04)
Read analog Input Registers/Read counter
05 (0x05)
Write Single Coil/Clear Counter/Force Function mode
06 (0x06)
Write Single AO
Table 5-2: Supports Function Codes of tWF series