PET-AR400 User Manual
V1.0.0
P.53
PDU
Function Code
Data
1 byte
N bytes
byte 7
byte 8 ~ n
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 table below shows the mapping between the function code and the register number for the
PET-AR400.
Function Code
Register Number
Number
Function
Object
I/O Type
Number
Size
01 (0x01)
Read
Coils
Digital Output
0xxxxx
1-bit
03 (0x03)
Read
Multiple Holding Registers
Analog Output
4xxxx
16-bit
04 (0x04)
Read
Input Registers
Analog Input
3xxxx
16-bit
05 (0x05)
Write
Single Coil
Digital Output
0xxxx
1-bit
06 (0x06)
Write
Single Holding Register
Analog Output
4xxxx
16-bit
15 (0x0F)
Write
Multiple Coil
Digital Output
0xxxx
1-bit
16 (0x10)
Write
Multiple Holding Registers
Analog Output
4xxxx
16-bit
Data
Data is transmitted in 8-bit, 16-bit and 32-bit format.
The data for 16-bit registers is transmitted in high-byte first format.
For example: 0x0A0B ==> 0x0A, 0x0B.
The data for 32-bit registers is transmitted as two 16-bit registers, and is low-word first.
For example: 0x0A0B0C0D ==> 0x0C, 0x0D, 0x0A, 0x0B.
The data field may be nonexistent (of zero length) in certain kinds of requests; in this case the
server does not require any additional information. The function code alone specifies the action.