![ControlByWeb WebRelay X-WR-1R12-1I-E Скачать руководство пользователя страница 59](http://html1.mh-extra.com/html/controlbyweb/webrelay-x-wr-1r12-1i-e/webrelay-x-wr-1r12-1i-e_user-manual_2658788059.webp)
WebRelay Users Manual
Section 5: Auxiliary Operations
5.1 XML
Custom computer applications may be created to monitor and control WebRelay without using a web
browser. Monitoring the state of the input and the relay is done by sending a request to port 80 (or port
specified in setup) for the XML page. Control of the relay is done by sending GET requests to the same
page on port 80 (or port specified in setup). This can be demonstrated by entering commands into the
URL line of a web browser.
5.1.1 state.xml
XML Monitor All Functions
The state of the Relay and Input can be monitored by sending a request to port 80 (or port specified in
setup). This can be demonstrated by entering the following URL into the address bar of a web browser
(substituting the IP address as necessary):
http://192.168.1.2/state.xml
The following state.xml page is returned:
<?xml version="1.0" encoding="utf-8" ?>
-<datavalues>
<relaystate>1</relaystate>
<inputstate>0</inputstate>
<rebootstate>0</rebootstate>
<totalreboots>0</totalreboots>
</datavalues>
The numbers enclosed by the tags,
<tag>
, indicate the current state or value monitored by WebRelay.
Values for each tag are described in the table below.
Custom Computer applications can open a TCP/IP connection with the WebRelay and send a
GET
request for the state.xml file to obtain the current state of the WebRelay. Parameters can be passed with
the GET request to control relays on the WebRelay. (See
Section 5.2 HTTP Get Requests
for
instructions on using GET requests to monitor and control the WebRelay.)
XML Tags*
Monitor Values
<relaystate>
0=off(coil off)
1=on (coil energized)
<inputstate>
0=off (voltage not applied to input)
1=on (voltage applied to input)
<rebootstate>
0=Auto Reboot off
1=Pinging
2=Waiting for response
3=Rebooting
4=Waiting for boot
Xytronix Research & Design, Inc.
Page 59