Chapter 6 Communication Mode
6 - 41
Mod
b
u
s M
a
ster
Function code 0x02 (Read Input Status)
The function code 02 is a query to read input status of the slave. Broadcasting is not supported.
(1) Sending data area format
Sending data area requires 4 words. Please set 6 bytes for head word.
Figure 6.32 Sending data area format (Function code 0x02)
1) Device No.: Set the slave number by hexadecimal number. (H01 to HFF. H00 cannot be used.)
2) Function code: Set the function code to H02.
3) Starting address: Set the starting address of input status by hexadecimal number. (H0000 to HFFFF)
4) Number of input status: Set the number of the input status by hexadecimal number. (H0000 to H07F0)
Ex.) Read status of 48 input status from the address 10321 of slave No. 01.
The head address of Sending data area WR100
WR100 = H0006
WR101 = H0102
WR102 = H0140
WR103 = H0030
(2) The state of receiving data area
1) Completed properly
Figure 6.33 Receiving data area format (Function code 0x02)
When a response is received properly from the slave, completion flag (t+1) will be ON, and the input status
information is stored in the address specified by the query from LSB. (same as function code 0x01.) Data unit of
EH-SIO is one word same as function code 01.
2) Receiving exception response
When an exception response is received, error flag (t+2) turns on, and the receiving data area is as follows.
Figure 6.34 Receiving data area format (Function code 0x02 / Exception response)
3) Other errors (except for exception response)
When there is no response from a slave or an abnormal factor is detected in the response, error flag (t+2) turns on,
an error code is stored in the return code area of the s parameter, and the number of receiving data is cleared to
H0000. (Data other than the number of receive data bytes maintains previous values.)
Please refer to section “6.3.5 Error detection in modbus master mode” for more information on error codes.
Exception code
Number of receive data (H0002)
H 8 2
Number of receive data (bytes)
1 word
…
n+7
n
n+15
b15
b7
b0
…
n+8
b8
Head address specified by the query
in LSB.
…
Number of input status
Device No.
0 2
Starting address
H 0 0 0 6
1 word
02: Function code
Starting address of input status to read
The number of input status to read
Summary of Contents for EH-150 Series
Page 2: ......
Page 10: ...M E M O ...
Page 30: ...Chapter 4 Installation 4 10 M E M O ...
Page 156: ...Chapter 7 System setup 7 12 M E M O ...
Page 164: ...Chapter 8 Daily and Periodic Inspection 8 8 M E M O ...