
Auxiliary Operations
WebRelay Users Manual
5.3.7 Write Multiple Registers – Modbus Function Code 16 (0x10)
The Modbus Write Multiple Registers function is used to pulse the relay for a specified time. When the
WebRelay receives this command, it immediately turns the relay coil on (if it is not on already on) and
starts the pulse timer.
The pulse time is specified in the register value field and the time 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 the
WebRelay (commands may be modbus, xml, html, or electrical input) 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 ABCD is sent as CDAB. 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.
Request (set pulse time)
Start Address (2 bytes):
0x0010 (always start at this address)
Register Quantity (2 bytes):
0x0002 (always 2 registers)
Byte Count (1 byte):
0x04 (always 4 bytes)
Register value (4 bytes):
0x00004120 = 10-second pulse
Response
The request is acknowledged by responding with the register quantity that was requested.
Errors
Pulse Function code Error (1 Byte):
0x90
Exception codes (1 Byte):
0x01 – Feature not supported.
0x02 – Address quantity not an even number.
Incorrect combination of start address and relay count.
Page 68
Xytronix Research & Design, Inc.