Hitachi EH-150 Series Applications Manual page 85

Table of Contents

Advertisement

 Function code 0x04 (Read Input Registers)
The function code 04 is a query to read input register of slave apparatus. Broadcasting is not supported.
(1) Sending data area format
Sending data area requires 4 words. Please set 6 bytes for head word.
Device No.
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 H04.
3) Starting address: Set the starting address of input register by hexadecimal number. (H0000 to HFFFF)
4) Number of input registers : Set the number of input registers by hexadecimal number. (H0000 to H00FE)
Ex.) Reading the value of 104 input registers from the address 30464 of slave No.14.
The head address of Sending data area WR100  WR100 = H0006
(2) The state of receiving data area
1) Completed properly
When a response is received properly from the slave, completion flag (t+1) will be ON, and the input register
information is stored in the address specified by the query from head word.
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.40 Receiving data area format (Function code 0x04 / 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.
H 0 0 0 6
0
4
Starting address
Number of input registers
1 word
Figure 6.38 Sending data area format (Function code 0x04)
Number of receive data (bytes)
Input register 1
Input register n
Figure 6.39 Receiving data area format (Function code 0x04)
Number of receive data (H0002)
H 8 4
6 - 43
Chapter 6 Communication Mode
04: Function code
Starting address of input register to read
The number of the input registers to read
WR101 = H0E04
WR102 = H01CF
WR103 = H0068
...
1 word
Exception code

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ehv seriesHx series

Table of Contents