
www.accuenergy.com
V: 1.10 Revised: January 2020
23
Chapter 9: Description of Modbus-TCP Protocol
9.1.3 Function Field
The function code field of a message frame contains eight bits. Valid codes are in the range
of 1-255. When a message is sent from a client to a server device, the function code field
tells the server what kinds of action to perform.
Code
Meaning
Data
01
Read Relay Output Status
Obtain current status of Relay Output
02
Read Digital Input (DI) Status
Obtain current status of Digital Input
03
Read Data
Obtain current binary value in one or more
registers
05
Control Single Relay Output
Force Relay to a state of ON or OFF
16
Write Multiple Registers
Place specific value into a series of consecutive
multiple registers
9.1.4 Data Field
The data field is constructed using sets of two hexadecimal digits, in the range of 00 to FF.
The data field of messages sent from a master to slave contains additional information
which the slave must use to take the action defined by the function code. This can include
information such as the register addresses, the quantity of registers to query and the count
of the actual number of data bytes. For example, if the master requests a slave to read a
group of holding registers(function code 03), the data field specifies the starting register
and how many registers are to be read.
If the master needs to write data(function code 10 hexadecimal) to a group of registers
in the slave, the data field specifies the starting register, how many registers to write, the
count of data bytes to follow in the data field and the data to be written into the registers.