76
6 Useful Functions
76
Useful Functions
Chapter
6
01 (0x01) Read Coils
The ON/OFF status of slave coils is read.
Since it is a read command, broadcast cannot be specified.
The start address of the coil and the number of coils are specified.
* N = Number of coils/8, N = N+1 in case the division is not possible.
Example) Reading the digital zero (address 00005) status.
Note that the relative address is 0x04 when reading the digital zero value.
The
remaining bit is 0 when less than 8 bits.
* The F701+ response (coil status) is 0 at all times.
(The process is carried out as soon as the command is read.)
Consider execution confirmation of the coil to be something that is completed by a normal
response from the function code 05 (0x05) Write Signal Coil or 15 (0x0F) Write Multiple Coils.
[Request]
Function 1 byte 0x01
Start address 2 bytes 0x0000 to 0xFFFF
Number of coils 2 bytes 1 to 2000 (0x07D0)
[Response]
Function 1 byte 0x01
Data bytes 1 byte N *
Coil status N bytes N or N+1
[Error response]
Error code 1 byte 0x81 (Function +0x80)
Exception code 1 byte 01 or 02 or 03
[Request]
Function 01
[Response]
Function 01
Start address (HI) 00 Data bytes 01
Start address (LO) 04 Digital zero 00
Number of coils (HI) 00
Number of coils (LO) 01