27
11.2 Read holding registers (0x03)
This function is used for reading holding registers from the slave.
The request telegram specifies the starting address (the address of the first register to be read) and the number of holding registers to
read. In the telegram, register addresses start from zero, meaning that registers numbered 1-16 are addressed as 0-15.
The register data in the response message are packed two bytes per register. For each register, the first byte contains the high-order bits
while the second byte contains the low-order bits.
Example of request from master to slave
In the request, the slave with address 1 is asked to deliver three contiguous registers starting from address 0x006b = 107 (meaning
register 108).
Example of response from slave to master
In the response, the byte count is six since there are three registers of two bytes. All three registers hold the value of 0x0001.
11.3 Read input registers (0x04)
This function is used for reading input registers from the slave. Input registers are read-only registers by definition. The request telegram
specifies the starting address (the address of the first register to be read) and the number of holding registers to read. In the telegram,
register addresses start from zero, meaning that registers numbered 1-16 are addressed as 0-15.
The register data in the response message are packed two bytes per register. For each register, the first byte contains the high-order bits
while the second byte contains the low-order bits.
Example of request from master to slave
In the request, the slave with address 1 is asked to deliver three contiguous registers starting from address 0x1010 = 4112 (meaning
register 4113).
Example of response from slave to master
In the response, the byte count is six since there are three registers of two bytes. All three registers hold the value of 0x2222.
11.4 Write single register (0x06)
This function is used for writing a single holding register in the slave. The request telegram specifies the address of the register that is to
be written. Register addresses start from zero, meaning that a register numbered 10 is addressed as 9.
The normal response is an echo of the request, indicating that the value was written.
Example of request from master to slave
In the request, the slave with address 1 is asked to write the value of 0xAFFE to the register at address 0x1000.
Example of response from slave to master
The response is an echo of the request.
Address
Function code
Start address HI
Start address LO
Quantity HI
Quantity LO
0x01
0x03
0x00
0x6B
0x00
0x03
Address
Function
code
Byte count
Register
108 HI
Register
108 LO
Register
109 HI
Register
109 LO
Register
110 HI
Register
110 LO
0x01
0x03
0x06
0x00
0x01
0x00
0x01
0x00
0x01
Address
Function code
Start address HI
Start address LO
Quantity HI
Quantity LO
0x01
0x04
0x10
0x10
0x00
0x03
Address
Function
code
Byte
count
Register
4113 HI
Register
4113 LO
Register
4114 HI
Register
4114 LO
Register
4115 HI
Register
4115 LO
0x01
0x04
0x06
0x22
0x22
0x22
0x22
0x22
0x22
Address
Function code
Address HI
Address LO
Value HI
Value LO
0x01
0x06
0x10
0x00
0xAF
0xFE
Address
Function code
Address HI
Address LO
Value HI
Value LO
0x01
0x06
0x10
0x00
0xAF
0xFE