Write Multiple Coils [0Fh] - Hitachi WJ Series User Manual

Table of Contents

Advertisement

Chapter 11
11.2.6

Write Multiple Coils [0Fh]

 How to write multiple coil statuses on Modbus communication?
Q
 Rewrite multiple consecutive coils.
A
 An example of changing the state of input terminals 1 to 7 of the inverter with slave address 1 is
shown below. The status of input terminals 1 to 7 are as follows.
Input terminal No.
Coil No.
Terminal state
No.
1
Slave address
2
Function code
3
Coil start No. (High)
4
Coil start No. (Low)
5
Number of coils (High)
6
Number of coils (Low)
7
Number of data bytes
8
Write data (High)
9
Write data (Low)
10
CRC-16 (High)
11
CRC-16 (Low)
No.
1
Slave address
2
Function code
3
Coil start No. (High)
4
Coil start No. (Low)
5
Number of coils (High)
6
Number of coils (Low)
7
CRC-16 (High)
8
CRC-16 (Low)
*1. For broadcast, there is no response.
*2. Note that the starting number is 1 less than the actual register number. Specify a number of
"(Register No.) - 1".
*3. "The number of data bytes" is not the number of coils, but the number of bytes to be
actually written. In addition, the maximum number of writable data is 32 coils (4byte). If it is
exceeded, an exceptional response of exception code "03h" is returned.
*4. Since the write data is a set of the higher and lower bits, even if the number of bytes that
actually need to be changed is an odd number, add zero data for one byte and set it to an
even number.
 Input terminal function is internally processed by "OR" of control terminal input and
!
communication input. However, "Input terminal monitor [d005]" displays only control terminal
state.
 If the command cannot be executed successfully, an exceptional response is returned. For
details, refer to "11.2.9 Exceptional Responses".
1
2
0007h
0008h
ON
ON
Query
Field name
*1
*2
*2
*3
*3
*3
*4
*4
Response
Field name
*1
*2
*2
*3
*3
11-2-8
RS485 Communication
3
4
0009h
000Ah
000Bh
ON
OFF
Example
(HEX)
01
0F
00
Coil start No. = (Coil No.) - 1
06
00
07
02
17
17h = 0001 0111
00
E8
Input terminal 7 Input terminal 1
02
Example
(HEX)
01
08
00
06
00
07
F4
08
5
6
000Ch
000Dh
ON
OFF
OFF
7

Advertisement

Table of Contents
loading

Table of Contents