78
6 Useful Functions
78
Useful Functions
Chapter
6
03 (0x03) Read Holding Registers
The contents of slave holding registers are read.
Broadcast cannot be specified.
The start address of the holding register and the number of registers are specified.
Slave devices transmit data by converting the contents of each register to 2 bytes.
* Be sure to specify the setting code prior to reading setting values for each item.
* N = Number of registers
Exam
ple) Reading the contents from compensation (address 40057) to over (address 40058).
Note that the relative address is 0x38 when reading the compensation value.
The F701+ settings for this example are as follows.
* In function code 03, only the LO words or the HI words are read when the start address specifies
the LO words from a 32-bit integer data area, or the end of the start address + number of reg
isters
specifies HI words from a 32-bit integer data area.
[Request]
Function 1 byte 0x03
Start address 2 bytes 0x0000 to 0xFFFF
Number of registers 2 bytes 1 to 125 (0x7D)
[Response]
Function 1 byte 0x03
Data bytes 1 byte 2 x N *
Register value N x 2 bytes
[Error response]
Error code 1 byte 0x83 (Function +0x80)
Exception code 1 byte 01 or 02 or 03
[Request]
Function 03
[Response]
Function 03
Start address (HI) 00 Data bytes 04
Star
t address (LO) 38 Compensation (HI) 00
Number of registers (HI) 00 Compensation (LO) 64
Number of registers (LO) 02 Over (HI) 00
Over (LO) 32
Compensation 100 (0x0064)
Over 50 (0x0032)