Revision 1.01
state.xml?relay1State=2&pulseTime1=5
state.xml?relay1State=2&pulseTime1=5
state.xml?relay1State=2
(Note that http://192.168.1.2/ would be included on all commands above)
Multiple relays can be changed with a single command by submitting multiple relayXState variables separated by an
ampersand symbol (&). All four relayXState variables or a subset of the relayXState variables can be included. The
relayXState variables can be in any order. Relays that are already in the desired state will not be affected by on/off
commands. Note that pulse commands will reset the pulse timer each time a command is received.
The following line illustrates how to turn 'on' relay 1, turn 'on' relay 2, and turn 'off' relay 10.
http://192.168.1.2/state.xml?relay1State=1&relay10State=0&relay2State=1
When the above commands are sent to WebRelay-10
commands can also be sent without having WebRelay-10
noReply field as follows.
Turn relay3 'on' without returning state: http://192.168.1.2/state.xml?relay3State=1&noReply=1
Turn relay3 'off' without returning state: http://192.168.1.2/state.xml?relay3State=0&noReply=1
Password :
If the control password is enabled in the WebRelay-10
browser will prompt the user for the password. If the XML request is sent from another application and not a
browser, the html request will need to contain the password encoded using the base 64 encoding scheme. The html
request header without the password looks like this:
GET /state.xml?noReply=1 HTTP/1.1 (Ends with two \r\n)
The html request header with the password looks like this:
GET /state.xml?relay2State=1&noReply=1 HTTP/1.1 (Ends with two \r\n)
Authorization: Basic bm9uZTp3ZWJyZWxheQ== (Ends with two \r\n)
where bm9uZTp3ZWJyZWxheQ== is the base 64 encoded version of the username and password
none:webrelay
A utility is provided at http://www.ControlByWeb.com/encoder that can be used to encode the password. The utility
is used by simply typing the string username:password into the website and pressing encode.
3.3 Modbus Operation
WebRelay-10
can be controlled (and read) using Modbus/TCP protocol. This provides a standard means of using
TM
WebRelay-10
in conjunction with devices and software from other manufacturers. This section contains the
TM
information necessary to communicate with WebRelay-10
and it is assumed that reader is already familiar with Modbus. Detailed Modbus information can be found at
http://www.modbus.org.
It is important to note that when the control password in WebRelay-10
are disabled. This is because Modbus/TCP does not provide a mechanism for password protection. Make sure the
control password is disabled (default) before using Modbus with WebRelay-10
WebRelay-10
functions as a Modbus server. Client devices open a connection with WebRelay-10
TM
(unless another modbus port is selected) and sends commands or requests to read the state of a relay, or change a
relay. When WebRelay-10
Xytronix Research & Design, Inc.
TM
receives a command, it will perform the desired function and return a response. The
TM
This will pulse the relay for 5 seconds
This will pulse the relay for 5 seconds
This will pulse the relay for the preset time (1.5 seconds)
, its current state is returned in the form of an XML page. The
return the XML page. This is accomplished by adding the
M
unit and the XML page is requested through a browser, the
TM
using Modbus/TCP. This is not a tutorial on Modbus
TM
is enabled, Modbus/TCP communications
TM
TM
WebRelay-10
Users Manual
TM
.
on port 502
TM
page 23
Need help?
Do you have a question about the ControlByWeb WebRelay-10 and is the answer not in the manual?
Questions and answers