The config.xml file

The config.xml file defines constants needed by the program.

Definitions for each item listed in the table under pv2web_ro.read_config.read_xml() are provided, such as this example:

Example config.xml file.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<?xml version="1.0" ?>
<pv2web_ro__config version="1.0">

  <var name="PVLIST_FILE"               value="pvlist.xml" />           <!-- PVs to be monitored -->

  <var name="LOCAL_WWW_LIVEDATA_DIR"    value="./" />                   <!-- absolute directory path to WWW site on local file system -->

  <var name="LOG_INTERVAL_S"            value="300"  type="float" />    <!-- writing messages to log file -->

  <var name="REPORT_INTERVAL_S"         value="10"  type="float" />     <!-- updates to HTML pages -->
  <var name="SLEEP_INTERVAL_S"          value="0.1"  type="float" />    <!-- sleeps at end of main loop -->

  <var name="MAINLOOP_COUNTER_TRIGGER"  value="10000" type="int" />     <!-- another logging message interval -->

</pv2web_ro__config>

To use the pv2web_ro service effectively, it is likely you will only need to edit the value for LOCAL_WWW_LIVEDATA_DIR which defines the location of the directory used by the web server to serve content.

Preamble

The config.xml must be “well-formed XML”.

The first line of the file is always:

1
<?xml version="1.0" ?>

This line declares this to be a file that should be well-formed XML according to the version 1.0 standard.

Root Tag

All well-formed XML files have a single element at the outermost (root) level of the file. In the config.xml file, the root element is pv2web_ro__config. Note the closing </pv2web_ro__config> tag at the end of the file.

A version attribute describes this file adheres to the version="1.0" definition of config.xml files. That definition is described in the XML Schema file config.xsd provided in the source code package.

This XML Schema definition is used to validate the config.xml when it is read. If there are problems, the first problem discovered will be reported.