ā 23 ā
5
Chapter
Function Code
For MODBUS protocol, coil numbers or resistor numbers are assigned by the function code, and each function code
only works for the assigned coil number or resistor number.
The correspondence between the function code and the coil number or resistor number is as follows.
The message length for each function is as follows.
[unit: byte]
*
1: "Assignable Data Number" above is limited by the data number that the micro controller assigned to the coil number or
address number.
(Excluding function code 06
H
).
Function Code
Coil Number, Resistor Number
Code Function Target Number Contents
02
H
Read (continuous) Input relay 1xxxx Read bit data
03
H
Read (continuous) Hold resistor 3xxxx Read word data
04
H
Read (continuous) Input resistor
4xxxx Read/write word data06
H
Write Hold resistor
10
H
Write (continuous) Retention resistor
Code Contents
Assignable
Data Number
Command Message Response Message
Minimum Maximum Minimum Maximum
02
H
Read bit data (read-only) 8 bit
*
1
8866
03
H
Read word data 60 words
*
1
887125
04
H
Read word data (read-only) 37 words
*
1
88779
06
H
Write word data 1 word 8888
10
H
Continuously write word data 60 words
*
1
11 129 8 8