Byte
Request
(Hex)
Field name
18
Device address
03
Function code
00
Address of the first register Hi bytes
00
Address of the first register Lo bytes
00
Number of registers Hi bytes
04
Number of registers Lo bytes
46
MSB of Checksum CRC-16
00
LSB of Checksum CRC-16
4.2.6.2 Write Holding Register
Here is reported an example of writing a holding register with address 0x0030 for the SlaveID 0x18.
Byte
Request
(Hex)
Field name
18
Device address
10
Function code
00
Address of the first register Hi bytes
30
Address of the first register Lo bytes
00
Number of registers Hi bytes
01
Number of registers Lo bytes
02
Number of byte to follow
05
value to write : MSB of reset
command
00
value to write : LSB of reset command
07
MSB of Checksum CRC-16
60
LSB of Checksum CRC-16
14
Byte
Answer
(Hex)
Field name
18
Device address
03
Function code
08
The number of data bytes to follow (4
registers x 2 bytes each = 8 bytes)
00
AbsoluteDecAngle (MSB ) [3]
00
AbsoluteDecAngle[2]
17
AbsoluteDecAngle[1]
5E
AbsoluteDecAngle (LSB) [0]
00
NumberOfTurns (MSB)[3]
00
NumberOfTurns [2]
00
NumberOfTurns [1]
01
NumberOfTurns LSB[0]
C9
MSB of Checksum CRC-16
66
LSB of Checksum CRC-16
Byte
Answer
(Hex)
Field name
18
Device address
10
Function code
00
Address of the first register Hi bytes
30
Address of the first register Lo bytes
00
number of registers written Hi bytes
01
number of registers written Lo bytes
03
MSB of Checksum CRC-16
CF
LSB of Checksum CRC-16