User Manual

User Guide
©2008-2020 Seeed Technology Co., Ltd. All rights reserved. solution.seeedstudio.com
15 / 23
5.4 Communication Sample
In the following instructions, the data at the beginning of the 0x or the ending of the H is a 16 - band data.
Modbus protocol with two common types of registers:
(1) To maintain the register, storage data is not lost, it is read and write. Usually with function number 3
(0x03) read, use function number 6 (0x06) or 16 (0x10) write.
(2) The input registers are used to store a number of read - only physical variables, such as temperature
values, that are read - only and usually read with a function number 4 (0x04).
5.4.1 Function number 3 communication sample
Common request formatAA 03 RRRR NNNN CCCC
AA
1 byte
Address, 0-255
03
1byte
Function number 3
RRRR
2byte
Start register address, high byte in front
NNNN
2byte
read the number of registers N, high byte in the front
CCCC
2byte
CRC CHECK
Common request formatAA 03 MM VV0 VV1 VV2 VV3… CCCC
AA
1byte
Address, 0-255
03
1byte
Function number 3
MM
1byte
Returns the number of data byte in the register value
VV0,VV1
2byte
Returns the first register value
VV2,VV3
2byte
Returns the second register value
Returns the “N” register value (N=MM/2)
CCCC
2byte
CRC CHECK
For example: to read register 0x0200-0x0201, namely from the machine address and baud rate for
example
Ask01 03 0200 0002 C5B3
Address
1byte
0x01
Function number
1byte
0x03
Start register
address
2byte
0x0200