XML/JSON Operation
X-600M Users Manual
Section 6: XML/JSON Operation
Custom applications may be created to monitor and control the X-600M. This method does not require a
web browser. There are two types of files used to control and monitor the I/O previously configured on
the X-600M. These are XML files and JSON files. Both provide the same information, but the formatting
is different.
6.1 XML/JSON Monitor
The state of the I/O previously registered with the X-600M can be monitored by sending an HTTP
request to the HTTP or HTTPS ports (80 and 443 by default). The file to be requested must correspond
to a widget found on one of the dashboards, a dashboard as a whole, or the file state.xml or state.json.
When requesting a file for a single widget, the current status of its components will be returned. When
requesting a file for an entire dashboard, the current status of all the components on the dashboard will
be returned. When requesting the state.xml or state.json file, the status of all the I/O on configured on
the X-600M will be returned.
In the following example we will get the current reading of a temperature sensor configured on the X-
600M. This example assumes that a widget has been added to the dashboard along with a component
that displays the status of the temperature sensor. This widget has the name “
widget1
”, and the
temperature sensor has the name “
owSensor1
”. In this instance, the XML file to request has the file
name “
widget1State.xml
.”
All XML/JSON files share this same file name format accept for state.xml/state.json :
widgetnameState.xml or dashboardnameState.xml
Example:
Request:
http://192.168.1.2/widget1State.xml
Returns:
<datavalues>
<owSensor1>90.3</owSensor1>
</datavalues>
The number enclosed by the tag
<owSensor1>
, indicates the current state or value of the I/O named
“
owSensor1
”. If the widget contained more components, there would be one tag for each component in
the XML file.
JSON files work the same way as XML files, the only difference being the format of the file and the file
name extension that is used. To request the same file as above, but in the JSON format, we would send
the following request:
http://192.168.1.2/widget1State.json
The filename follows the same format as the xml filenames, the only difference being the file extension
of
.json
. The return value is formatted differently as well:
{"owSensor1":90.3}
If instead the file “dashboard1State.xml” was requested, an xml file with the status of all the widgets and
their components would be returned.
Page 106
Xytronix Research & Design, Inc.
Содержание X-600M
Страница 1: ...X 600MTitle Page Goes Here...
Страница 6: ...X 600M Users Manual Page 4 Xytronix Research Design Inc...
Страница 99: ...X 600M Users Manual Setup Pages Xytronix Research Design Inc Page 97...
Страница 116: ...Appendix B Installing New Firmware X 600M Users Manual Page 114 Xytronix Research Design Inc...