4 - 20 4 - 20
MELSEC-Q
4 MODBUS
R
STANDARD FUNCTIONS
4.3.12 Read/Write multiple registers (FC:23)
Reads and writes data from and to multiple holding registers.
Write is executed first and read is then executed.
Number of accessible devices with one message
Read: 1 to 125 points
Write: 1 to 121 points
(1) Request message format (Master Slave)
Data
Read head holding
register number
(0000
H
to FFFF
H
)
(H)
(L)
Function code
Function code
(17
H
)
Read points
n
(0001
H
to 007D
H
)
(H)
(L)
(H)
(L)
Write head holding
register number
(0000
H
to FFFF
H
)
(Number of bytes m 2)
Write points
m*1
(0001
H
to 0079
H
)
(H)
(L)
(H)
(L)
Number
of bytes
m 2*1
(0000
H
to 00F2
H
)
Write device data
1
(H)
(L)
Write device data
m
1: The number of points specified as the write points must be matched with the
number of bytes.
(2) Response message format (Slave Master)
(When completed normally)
Read device data
1
Data
(H)
(L)
Function code
Function code
(17
H
)
(H)
(L)
Number of bytes
n 2
Read device data
n
(Number of bytes n 2)
(When completed with an error)
Data
Exception
code *2
Function code
Function code
(97
H
)
2: When completed with an error, the exception code and error code are stored
into the buffer memory.
Refer to Section 11.3 for the storage location, confirmation method and more
details.