Operation
WebRelay-10 Users Manual
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):
0x10
Start Address (2 bytes):
0x0010 (relay 1) – 0x0022 (relay 10)
Register Quantity (2 bytes):
0x0002 – 0x0014 (2 registers for each relay, even number)
Byte Count (1 byte):
0x04 – 0x28 (Multiples of 4)
Pulse Duration (4 bytes, per relay):
0x3DCCCCCC – 0x47A8C000
(Little-endian Format: 0xCCCC3DCC – 0xC00047A8)
Request
Relay Number
Relay Address
Relay Number
Relay Address
1
0x0010
6
0x001A
2
0x0012
7
0x001C
3
0x0014
8
0x001E
4
0x0016
9
0x0020
5
0x0018
10
0x0022
Modbus TCP Request Frame Example – Pulse Coil 4 for .5 s and Coil 5 for 5 s
Field Name
Length
Function
Example Data
Transaction Identifier
2 bytes
Synchronization number.
0x0001
Protocol Identifier
2 bytes
Zero for Modbus/TCP
0x0000
Message Length
2 bytes
Number of bytes in frame (below)
0x000F
Unit Identifier
1 byte
Slave Address (0xff if not used)
0xFF
Function Code
1 byte
Pulse Coils (Write Multiple Registers)
0x10
Data
8-42 bytes Start address (0x0010 – 0x0022)
Register quantity (0x0002 – 0x0014)
Byte count (0x04 - 0x28)
Pulse Duration (0xCCCC3DCC –
0xC00047A8)
0x0016
0x0004
0x08
0x00003F00
0x000040A0
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
Xytronix Research & Design, Inc.