10. easyE4 communication Connection to other devices
10.17 Modbus TCP
Write Single Registers 0x06:
This function writes 16 bites to a register ((NET) marker word in the easy)
Function Code
1 byte
0x06 ;Write single Registers
Target address
2 byte
Must always be 1 less than the MW being written
to (if you want MW1 to be written to, there must
be a 0 here)
Register value
2 byte
Value to be written
Tab. 143: Request-PDU
Response to the request being received
1. The target address is analyzed (distributed among bytes 1 and 2)
a. Byte 1 = Hi; Byte 2 = Lo
2. The value being written is analyzed (distributed among bytes 3 and 4)
a. Byte 3 = Hi; Byte 4 = Lo
3. The value is written to the target register ((NET) marker word)
Response-PDU
If the value is written successfully, the request will be echoed once as a response
(→ Section "Write Single Registers 0x06:", page 795 Request PDU)
In other words, the response is identical to the corresponding request and is used for
confirmation purposes only.
Write Multiple Registers 0x10:
This function writes n * 16 bits to N registers ((NET) marker words in the easyE4)
Function Code
1 byte
0x10 ;Write Multiple Registers
Start address
2 byte
Must always be 1 less than the starting marker word
(if you want MW1 to be written to, there must be a 0
here)
Number of registers
2 byte
1-123 (0x0001 to 0x007B)
Bye Count
1 byte
2 * N
Register values being written
(marker words)
n * 2 byte
Values being written
Tab. 144: Request-PDU
n = Number of registers being written to
Response to the request being received
1. The starting address is analyzed (distributed among bytes 1 and 2)
a. Byte 1 = Hi; Byte 2 = Lo
2. The number of registers is analyzed (distributed among bytes 3 and 4)
a. Byte 3 = Hi; Byte 4 = Lo
easyE402/24 MN050009ENEaton.com
795