Write Multiple Coils (Modbus Function Code 15 (0X0F)) - ControlByWeb WebRelay-Quad X-WR-4R1-5 User Manual

Hide thumbs Also See for WebRelay-Quad X-WR-4R1-5:
Table of Contents

Advertisement

Revision 2.2b

3.3.3 Write Multiple Coils (Modbus Function Code 15 (0x0F))

A single byte can be written to set the state of all four relays. To do this, set the starting address to 0, set the
quantity of outputs to 4, and write a single byte with the appropriate value according to the table below.
Data Byte (hex)
LS Data Bits (binary)
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
0x08
0x009
0x0A
0x0B
0x0C
0x0D
0x0E
0x0F
Alternatively, to modify the state of one, two, or three relays only, the starting address and quantity of outputs can be
set to values other than 0, and 4 respectively.
Request
Modbus/TCP:
Transaction identifier (2 Bytes): 0x0001
Protocol identifier (2 Bytes): 0x0000
Length (2 Bytes): 0x0008
Unit identifier (1 Byte): 0xff
Modbus:
Function code (1 Byte): 0x0f (write coil)
Starting address (2 Bytes): 0x0000 ~ 0x0003
Quantity of outputs (2 Bytes): 0x0001 ~ 0x0004
Byte count (1 Byte): 0x01
Output value (1 Byte): 0x00 ~ 0x0f (see table above)
char write_mult_coil_mb_request[] = {0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x01, 0x01, 0x0F };
Response
Modbus/TCP:
Transaction identifier (2 Bytes): 0x0001
Protocol identifier (2 Bytes): 0x0000
Length(2 Bytes): 0x0006
Unit identifier (1 Byte): 0xff
Xytronix Research & Design, Inc.
Relay 4 State
0000
off
0001
off
0010
off
0011
off
0100
off
0101
off
0110
off
0111
off
1000
on
1001
on
1010
on
1011
on
1100
on
1101
on
1110
on
1111
on
WebRelay-Quad
Relay 3 State
Relay 2 State
off
off
off
off
off
on
off
on
on
off
on
off
on
on
on
on
off
off
off
off
off
on
off
on
on
off
on
off
on
on
on
on
Users Manual
TM
Relay1 State
off
on
off
on
off
on
off
on
off
on
off
on
off
on
off
on
page 30

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the WebRelay-Quad X-WR-4R1-5 and is the answer not in the manual?

This manual is also suitable for:

Webrelay-quad x-wr-4r1-iWebrelay-quad x-wr-4r1-e

Table of Contents