
Modbus Commands
C-23
TIWAY I Gateway User Manual
Code
15 allows the host computer to write multiple coils. When this
command is given, successive coils are changed, by an associated bit
pattern, to the indicated state; where each bit indicates:
1 = ON 0 = OFF
Addressing
is sequential up to the maximum memory size for a particular
secondary
. The maximum number of coils that can be addressed with one
command is 800. If more are given, the whole command will be rejected with
an Exception code 03.
The broadcast address (00) can be used to change the same coils in all
networked programmable controllers.
[This command is equivalent to TIW
A
Y Primitive 30 using data types 04, 07
(Y unpacked, packed) or data types 05, 08 (C unpacked, packed), depending
on the position of network port Switch 10.]
I000000
Request: 07 0F 0012 000C 02 DC08 XXXX
Checksum (XXXX)
Coil status (DC08)
Number of bytes (02)
Number of coils (000C)
Start coil address (0012)
Function code (0F)
Slave address (07)
Figur
e C-26
Write
Multiple Coils Example — Request
This request is for the secondary node to change the values of 12 (0C hex)
coils starting at address 12 (18 decimal) to the states given by the following
bit pattern.
I000000
1 101
D
1 110
C
0 000
0
1 000
8
Coil 25 (ON)
Coil 18 (OFF)
Coil 29 (ON)
Coil 26 (OFF)
Figur
e C-27
Coil
Bit Patter
n
The bit pattern indicates that coils 19, 20, 21, 22, 24, 25, and 29 are to be
changed to ON and 18, 23, 26, 27, and 28 changed to OFF
.
Code 15 — W
rite
Multiple Coils
Comentarios a estos manuales