10. easyE4 communication Connection to other devices
10.17 Modbus TCP
Read Input Registers 0x04:
Function 0x04 reads the analog inputs' registers word by word.
The Modbus client treats two bytes as one input register.
This means that in order to read an analog input with 32 bits, two consecutive input
registers must be read.
Function Code
1 byte
0x04 ;Read Input Registers
Start address
2 byte
Must always be 1 less than the starting input you
want (zero-based)
Number of input registers
2 byte
1 to 125 (0x7D)
Tab. 141: Request-PDU
Response to the request being received
1. The starting address is analyzed (distributed among bytes 1 and 2)
b. Byte 1 = Hi; Byte 2 = Lo
2. The number of registers is analyzed (distributed among bytes 3 and 4)
b. Byte 3 = Hi; Byte 4 = Lo
3. The input registers are read from the start of the (starting address) to (start-
ing address + number of input registers)
(An input register corresponds to two bytes)
Function Code
1 byte
0x04 ;Read Input Registers
Bye Count
1 byte
A value of
= 2 * N must always be entered here
Register values
n* 2 byte
value
n= Number of input registers read
Tab. 142: Response-PDU
Preparation for sending the response
1. The input registers read are mapped to two bytes per input register
2. There are a high byte and a low byte for each input register
a. The first byte = Hi; the second byte = Lo
b. Example:
- Register word Hi0x00
- Register word Lo0x0A
- Content of marker word 0x000A
3. The LSB within the byte is bit 0
Once the response is encoded, it is sent.
794
easyE402/24 MN050009ENEaton.com