Operation
3.4.9 Pulse Coils – Modbus Function Code 16 (0x10)
The Modbus Write Multiple Registers function is used to pulse the relay(s) for a specified time. When
WebRelay-10 receives this command, it immediately turns the appropriate relay coil(s) ON (if not already
on) and starts the pulse timer. The relay(s) are selected by writing the pulse time to the register(s)
associated with the appropriate relay(s). The pulse time is specified in the register value field and can
range from 0.1 seconds to 86400 seconds (1 day). When the pulse time expires, the relay coil will be
turned OFF. If a pulse time command is sent with a value greater than 86400, the pulse timer will be set
to 86400. If a pulse time command is sent with a value less than 0.1, the pulse timer will be set to 0.1. If
any commands are sent to WebRelay-10 (Modbus, xml, or html) before the pulse timer has expired, the
pulse timer will be canceled immediately and the new command will be executed.
The pulse time is provided in IEEE 754 floating point format. The four data bytes are treated as two
individual big endian 16-bit words but, the least significant word is sent first. In other words, the 32-byte
floating point number represented as 1234 ABCD is sent ABCD 1234. In the example shown below, the
relay will pulse for 10 seconds. Ten seconds is represented using a floating point number of 41200000.
It is transferred as 00004120.
Pulse Coil Function Code (1 byte):
Start Address (2 bytes):
Register Quantity (2 bytes):
Byte Count (1 byte):
Pulse Duration (4 bytes, per relay):
Request
Relay Number
1
2
3
4
5
Modbus TCP Request Frame Example – Pulse Coil 4 for .5 s and Coil 5 for 5 s
Field Name
Transaction Identifier
Protocol Identifier
Message Length
Unit Identifier
Function Code
Data
Tx String: 00 01 00 00 00 0F FF 10 00 16 00 04 08 00 00 3F 00 00 00 40 A0
page 76
0x10
0x0010 (relay 1) – 0x0022 (relay 10)
0x0002 – 0x0014 (2 registers for each relay, even number)
0x04 – 0x28 (Multiples of 4)
0x3DCCCCCC – 0x47A8C000
(Little-endian Format: 0xCCCC3DCC – 0xC00047A8)
Relay Address
0x0010
0x0012
0x0014
0x0016
0x0018
Length
Function
2 bytes
Synchronization number.
2 bytes
Zero for Modbus/TCP
2 bytes
Number of bytes in frame (below)
1 byte
Slave Address (0xff if not used)
1 byte
Pulse Coils (Write Multiple Registers)
8-42 bytes Start address (0x0010 – 0x0022)
Register quantity (0x0002 – 0x0014)
Byte count (0x04 - 0x28)
Pulse Duration (0xCCCC3DCC –
0xC00047A8)
WebRelay-10 Users Manual
Relay Number
6
7
8
9
10
Xytronix Research & Design, Inc.
Relay Address
0x001A
0x001C
0x001E
0x0020
0x0022
Example Data
0x0001
0x0000
0x000F
0xFF
0x10
0x0016
0x0004
0x08
0x00003F00
0x000040A0
Need help?
Do you have a question about the WebRelay-10 X-WR-10R12-I and is the answer not in the manual?
Questions and answers