FX
3U
Series Programmable Controllers
User’s Manual - MODBUS Serial Communication Edition
7 MODBUS Standard Commands
7.14 Write Multiple Coils (Command Code: 0x0F)
7.14
Write Multiple Coils (Command Code: 0x0F)
Writes values (ON/OFF) to multiple coils.
1) Request message format (Master
→ Slave)
Function code
Function code
(0F
H
)
Head coil number
(0000
H
to FFFF
H
)
Write points
*1
(0001
H
to 07B0
H
)
Data
Number of bytes n
*1
(0001
H
to
00F6
H
)
Device data
1
(H)
(L)
(H)
(L)
. . .
(Number of bytes n)
Device data n
1
2
3
(Device data 1 to n ) b7
Device data 1 b6 b5 b4 b3 b2 b1 b0
Data storage order
Device data n
0 : OFF
1 : ON
The values (ON/OFF) stored into the device data 1 to n are written to the coils in order from low-order to high-order bits of the device data.
*1. The number of the specified write points must be matched with the number of bits specified as the number of bytes. For example, when the write points are set to 16, set the number of bytes to 2 bytes
(= 16 bits).
2) Response message format (Slave
→ Master)
(When completed normally)
Function code Data
Function code
(0F
H
)
Head coil number
(The same head coil number
value as in the request message is stored.)
(H) (L)
Write points
(The same write points value as in the request message is stored.)
(H) (L)
(When completed with an error)
Function code
Function code
(8F
H
)
Data
Exception code*
2
4
5
6
7
8
9
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed contents.
10
73