4P642495-1A
–
2022.02
Page
12
of
52
(2) Preset Single Register (0x06)
[Function]
Write a value to a holding register. In case of broadcast, the value is written to the same holding register of all
slave units. The address and the content of the holding registers are described in
3. Modbus registers
[Query]
The query message specifies the start address of the register and a value. The register address starts at zero:
register 40001 is addressed as 0. Here is an example of a request to slave address 1 for writing the value
‘
2
’
to
register 42002.
Query
Response
Field
Data
Field
Data
Slave Address
0x01
Slave Address
0x01
Function Code
0x06
Function Code
0x06
Address(Upper)
0x07
Address(Upper)
0x07
Address(Lower)
0xD1
Address(Lower)
0xD1
Value(Upper)
0x00
Value(Upper)
0x00
Value (Lower)
0x02
Value (Lower)
0x02
Error Check CRC16(Lower)
0x59
Error Check CRC16(Lower)
0x59
Error Check CRC16(Upper)
0x46
Error Check CRC16(Upper)
0x46
(3) Preset Multiple Registers (0x10)
[Function]
Write values to holding registers. In case of broadcast, the values are written to the same holding registers of
all slave units. The address and the content of holding registers are described in
3. Modbus registers
[Query]
The query message specifies the start address of the register, size of data and values. The register address
starts at zero: register 40001 is addressed as 0. This function can write up to 30 registers in one query. Here is
an example of a request to slave address 1 for writing 2 values to register 42001 and to register 42002.
Query
Response
Field
Data
Field
Data
Slave Address
0x01
Slave Address
0x01
Function Code
0x10
Function Code
0x10
Start Address(Upper)
0x07
Start Address(Upper)
0x07
Start Address(Lower)
0xD0
Start Address(Lower)
0xD0
Number of Registers(Upper)
0x00
Number of Registers(Upper)
0x00
Number of Registers(Lower)
0x02
Number of Registers(Lower)
0x02
Data Size(bytes)
0x04
Error Check CRC16(Lower)
0x41
Value1(Upper)
0x00
Error Check CRC16(Upper)
0x45
Value1(Lower)
0x10
Value2(Upper)
0x00
Value2(Lower)
0x01
Error Check CRC16(Lower)
0x18
Error Check CRC16(Upper)
0xC6