XML Data Source

 The XML data source allows data to be delivered via the standard RTView XML schema. In many cases, this is used in prototyping since data can be created via a simple XML text editor. In other cases, customers use the XML format as a quick means for new data sources to provide data to RTView.

An API is provided for creating custom data adapters that can be integrated into the Display Builder environment and provide unique dialogs for data attachment. However, in some cases it is quicker and sufficient to provide the data via XML and use the standard XML data attachment dialog.

This section includes:

§        “XML System Requirements and Setup” on page 806

§        “Attach to XML Data” on page 807

§        “XML Data Source Substitutions” on page 813

§        “Application Options - XML” on page 814

§        “RTView Deployment - XML” on page 816

§        “XML Demos” on page 817

§        “Creating XML Sources” on page 820

§        “XML Data Source Command Line Options” on page 827

 

XML System Requirements and Setup

System Requirements

The XML data source has no additional “System Requirements”.

Setup

The XML data source requires no additional “Setup”.

Attach to XML Data

The Attach to XML Data dialog, which is used to connect an object property to an element in your XML data, can be accessed from the Object Properties window. Once a property has been attached to an XML element, it receives continuous updates.

When an object property is attached to data, the Property Name and Value in the Object Properties window will be displayed in green. This indicates that editing this value from the Object Properties window is no longer possible. To remove the data attachment, and resume editing capability in the Object Properties window, right-click on the Property Name and select Detach from Data. You will recognize that an object property has been detached from the data source when the Property Name and Value are no longer green.

Right-click on the Property Name from the Object Properties window and select Attach to Data>XML to display the Attach to XML Data dialog. The Attach to XML Data dialog provides three drop down menus that allow you to specify information regarding an XML element. See “Creating XML Sources” for technical details on creating and formatting an XML source.

 

atd_dialog_xml.gif

Field Name

Description

XML Source

Name of XML source containing XML element.

Data Key

Key corresponding to XML element.

Column(s)

If XML element is tabular, you can select which column(s) to display.

Filter

Check box to indicate whether or not to filter the XML element. Filters can only be used for tabular data. See “Row Filtering”

Filter Column

Name of the column to use as a filter. Multiple column names should be entered as a semicolon (;) delimited list (i.e. col1;col2;col 3). If your column name contains a space or a semicolon, then the entire name must be enclosed in single quotes.

Filter Value

Value that the Filter Column must equal. Multiple filter values should be entered as a nested list, where values for a given column are separated by commas within a semicolon (;) delimited list (i.e. val1,val2;val3,val4;val5,val6). If your filter value contains a space or a semicolon, then the entire value must be enclosed in single quotes.

When * is entered as a filter field value, data for all values in the specified filter column will be used to update the object property. When "*" is entered, only the literal comparative value will be used. These are only allowed for objects which display tabular data.

Data Server

Select to read data through your configured Data Server and not directly from the XML data source.

 

Default - Select the default Data Server you configured in Application Options>“Data Server Tab”.

 

None - Bypass data being redirected through the specified Data Server(s) for this attachment and instead attach directly to the data source.

 

Named Data Servers - Select a Named Data Server that you configured in Application Options>“Data Server Tab”.

 

Multi-Server Attachment - To configure multiple data servers, enter a semicolon (;) delimited list containing two or more Named Data Servers (e.g. ds101;ds102). Each name specified must correspond with a Named Data Server that you configured in Application Options>“Data Server Tab”. It is also possible to specify __default and __none (e.g. __default;ds101;ds102).

Note: The values __default and __none begin with two underscore characters.

 

Alternatively, a value of * can be entered to specify all data servers, including __default and __none.

When multiple data servers are specified, the data attachment will be directed to each data server in the list. For tabular data attachments, a column named DataServerName will be added as the first column of the table and contain the name of the server from which the data was received.

 

A multi-server attachment will receive data independently from each of the servers it specifies, so in most cases it will be necessary to combine the tables received into a single table. This can be accomplished in two ways:

1.     The multi-server attachment can be applied to a local cache that has the DataServerName column specified as an index column. The current table of that cache will contain the combination of the tables received from all servers. Note: It may also be necessary to configure cache row expiration settings to remove defunct rows.

2.     The multi-server attachment can be applied as the Table argument of the RTView function named Combine Multi-Server Tables. See “Tabular Functions” for more information.

The XML Source drop down menu lists all available XML sources. Drop down menus for Data Key, Column(s), and Filter Column populate based on the selected XML source. The XML Source field automatically displays the name of the default XML source. The Column(s) and Filter Column drop down menus will only contain options if the selected Data Key is a tabular element that has been included in an XML update. If the item you require is not listed, type your selection into the field. For information on adding XML sources or selecting a default XML source, see “Application Options - XML”.

Validation Colors

Fields in the dialog change colors according to the information entered. These colors indicate whether or not information is valid. Information entered into the dialog is validated against elements included in an XML update.

The following describes the significance of the Attach to XML Data validation colors:

Blue

Unknown

Entry does not match any known XML source*.

White

Valid state

Entry is valid.

Red

Invalid state

XML source is valid, but Data Key, Column(s) or Filter Column selected are not.

Gray

Not Required

Field does not require a value. This applies to the Column(s), Filter Column or Filter Value field for data keys that are not tabular elements.

*If an XML source is validated as Unknown, RTView will attempt to read it when you click OK or Apply.

Substitutions

Substitutions allow you to build open-ended displays in which data attachments depend on values defined at the time the display is run. Generic names, such as $data1 and $data2, are used instead of values for specific data keys. Later when the display is running, these generic values are defined by the actual names of specific keys, such as element1_data and element2_data. In this way, a single display can be reused to show data from a number of different sources. For more information on creating displays using substitution values, see “Substitutions”.

RTViewDs

The RTViewDs source provides information about the listeners currently active in the XML data source. The RTViewDs.Server source provides information about all listeners that a data server is currently maintaining for all of its clients. That is, while the RTViewDs.Server source provides information from a data server about all listeners from all of its clients, the RTViewDs source only provides information about listeners that the current client (e.g. Display Builder, Display Viewer) has redirected to data servers.

In the Attach to XML Data dialog, manually enter RTViewDs or RTViewDs.Server in the XML Source field. These options are not available from the drop down list.

atd_rtvds_xml.gif

 

XML Source

Data Key

Description

Column Name

Description

RTViewDs

listeners

Returns a table that contains a row for each unique data attachment to another XML source, and a row for each unique data attachment that has been redirected to a Data Server.

Source

The name of the XML source (file), or the name of the Data Server.

 

 

 

Local

When checked, indicates that the source is an XML source. When unchecked, indicates that the source is a Data Server.

 

 

 

Adapter

The name of the data adapter, which is xml for local XML attachments and cache, sql, and so forth, for redirected listeners.

 

 

 

Key

The entire data attachment string.

 

 

 

Listeners

The total number of listeners for the attachment string.

 

 

 

Updated

Specifies the time that the data was most recently applied to the listener.

 

cacheListeners

Returns a table that contains a row for each unique cache data attachment that has been redirected to a Data Server.

Note: The cacheListeners table does NOT show local cache listeners but rather, only cache listeners that have been redirected to a Data Server. The Local and Adapter columns are not specified in this table because only remote listeners for the cache data adapter are shown.

Source

The name of the Data Server to which the cache attachment has been redirected.

 

 

 

Key

The entire data attachment string.

 

 

 

Listeners

The total number of listeners for the attachment string.

 

 

 

Updated

Specifies the time that the data was most recently applied to the listener.

 

 

 

Cache Name

The name of the cache in the cache data attachment.

 

 

 

Table Name

The name of the table in the cache data attachment.

 

 

 

Columns

The name of the table column in the cache data attachment.

 

 

 

Filter Columns

The names of columns that have a filter applied to the.

 

 

 

Filter Values

The value of the filters applied to the columns (listed in Filter Columns).

RTViewDs.Server

listeners

Returns a table that contains one row for each unique data attachment for each client of the data server. Client ID Numeric ID of the client.

Address

IP address of the client.

 

 

 

Host

Hostname of the client, if available, or http if the client is connected via the rtvdata servlet.

 

 

 

Adapter

The name of the data adapter, which is xml for local XML attachments and cache, sql, and so forth, for redirected listeners.

 

 

 

Key

The entire data attachment string.

 

 

 

Listeners

Total number of listeners for the attachment string.

 

 

 

Pushed

Time data was most recently pushed from the server to the client.

 

 

 

Seq

Sequence number assigned to most recent data push.

 

cacheListeners

Returns a table that contains one row for each unique cache data attachment for each client of the data server. Client ID Numeric ID of the client.

Address

IP address of the client.

 

 

 

Host

Hostname of the client, if available, or http if the client is connected via the rtvdata servlet.

 

 

 

Key

The entire data attachment string.

 

 

 

Listeners

Total number of listeners for the attachment string.

 

 

 

Pushed

Time data was most recently pushed from the server to the client.

 

 

 

Seq

Sequence number assigned to most recent data push.

 

 

 

Cache Name

The name of the cache in the cache data attachment.

 

 

 

Table Name

The name of the table in the cache data attachment.

 

 

 

Columns

The name of the table column in the cache data attachment.

 

 

 

Filter Columns

The names of columns that have a filter applied to them.

 

 

 

Filter Values

The value of the filters applied to the columns (listed in Filter Columns).

Select Table Columns

From the Attach to XML Data dialog you can specify which table columns to display and in what order they will appear. In order to populate the listing of available columns, you must first select a valid XML source and data key.

Click on the ellipses button in the Column(s) field (or right-click in the Column(s) field and choose Select Columns) to display the Select Columns dialog. The dialog should contain a list of Available Columns that you can add to your table.

To add a column, select an item from the Available Columns list and click the Add button. If the item you require is not listed, type your selection into the Enter Column Name field. Click the Remove button to delete an item previously added to the Selected Columns list. You can control the order of columns in a table by arranging the items in the Selected Columns list with the Move Up and Move Down buttons.

Validation colors indicate whether selected columns are valid. However, if even one column selected is invalid, the Column(s) field in the Attach to XML Data dialog will register as an invalid entry.

Note: Invalid columns will not update.

If no data is available for a table row within a selected column, the table cell will display one the following values: N/A, false, 0, or 0.0.

select_columns_gen00054.gif

 

The following describes the Attach to XML Data dialog commands:

Command

Description

OK

Applies values and closes the dialog.

Apply

Applies values without closing the dialog.

Reset

Resets all fields to last values applied.

Clear

Clears all fields. Detaches object from data source (once Apply or OK is selected).

Cancel

Closes the dialog with last values applied.

XML Data Source Substitutions

In addition to standard built-in “Substitutions”, this data source also sets the following drill down substitutions:

Substitution Value

Definition

$XrowName (where X is the # of the rowname)

Data from a selected row or object. A substitution is defined for each part of the rowname.

For example, if the rowname was plant1:load:station7:machine8 the substitutions would be:

$1rowName:plant1

$2rowName:load

$3rowName:station7

$4rowName:machine8

$filterfield

Filter field name from the selected row or object.

$filtervalue

Filter field value from the selected row or object.

Application Options - XML

Select Tools>Options in the Display Builder to access the Application Options dialog.

Options specified in the XML tab can be saved in an initialization file (OPTIONS.ini). On startup, the initialization file is read by the Display Builder, Display Viewer, Display Server, Data Server and Historian to set initial values. If no directory has been specified for your initialization files and OPTIONS.ini is not found in the directory where you started the application, then RTView will search under lib in your installation directory. See “RTV_JAVAOPTS” for more information.

Note: Options specified using command line arguments will override values set in initialization files.

XML Tab

This tab allows you to allows you to add or remove XML sources, set the default XML source, and enter an XML source prefix.

Adding an XML source allows you to associate a name, which you will use when creating data attachments, with the full path to the XML source file used to update objects in your display. See “Creating XML Sources” for technical details on creating and formatting your own XML source file.

Entering an XML source prefix allows you to use the same path for several XML sources. The XML source prefix will be affixed to the beginning of all XML sources with the Use XML Source Prefix check box selected in the “Edit XML Source” dialog.

Once you add an XML source, it will be highlighted in yellow indicating that it has not been read. When you click OK, Apply, or Save, RTView will attempt to read it and populate menu items in the Attach to XML Data dialog unless the XML source definition has the Contains Substitutions check box selected. If the XML source remains yellow, the file was not found. When this information is saved to the initialization file, it will be used to populate Attach to XML Data dialog menus each time you run RTView.

gen_opt_xmltab.gif

 

Field Name

Description

XML Source Prefix

Directory path or URL base affixed to XML sources you add with the Use XML Source Prefix check box selected. This allows you to use the same path for several XML sources.

Note: The XML source prefix will not be applied to paths that begin with http://.

Default XML Source

Name of XML source used as the default for data attachments. Select from drop down menu to change default setting.

Add

Click to open the Edit XML Source dialog. To edit an existing XML source, double-click on a name from the XML Sources list.

Remove

Select an XML source from the list and click the Remove button to delete. It is not possible to remove an XML source that is currently updating an object.

Edit XML Source

When you add an XML source, the name you create (e.g., MyXMLSource) will be associated with the full path to the XML source file (e.g., mydata/update.xml) being used to update objects in your display.

gen_opt_xmltab_edit.gif

 

Field Name

Description

XML Source Name

Create a name to use when referencing the XML source file that will be used to update objects in your display. The XML source name will appear in the “Attach to XML Data” dialog when you create data attachments in the Display Builder.

XML Source Path

Full or relative path to the XML source file (e.g., mydata/update.xml) that is being used to update objects in your display. If your XML data source is a socket, specify with the following format:

remote://host:port/filename

Use XML Source Prefix

If selected, the XML source prefix you entered will be affixed to the XML source path. This allows you to enter a path once and use it for several XML sources. For example, if the XML source prefix is c:/rtview/ and the XML source path is mydata/update.xml, then MyXMLSource will be defined as c:/rtview/mydata/update.xml.

Note: This check box is only enabled if you filled in the XML Source Prefix field in the Application Options dialog.

Static

Select this option if your XML source file exclusively contains static information. If selected, RTView will read this file only once.

Contains Substitutions

Select this option if your XML Source Path contains substitutions. If selected, RTView will not read this file until the substitutions in the path have been defined. This applies to substitutions set in the Application Options dialog as well as those set in drill down displays.

RTView Deployment - XML

This section contains details about the deployment process that are specific to your data source. Please go to the “Deployment” section of this documentation for instructions on how to implement your RTView deployment option. Return to this page whenever you are instructed to refer to deployment information that is specific to your data source.

System Requirements and Setup

The XML data source has additional System Requirements and Setup. See “XML System Requirements and Setup” for more information.

Data Source Configuration File

RTView saves general application settings as well as data source configuration options in initialization files that are read at startup. If no directory has been specified for your initialization files and files are not found in the directory where you started the application, then RTView will search under lib in your installation directory. See “Application Options”, “Application Options - XML”, and “RTV_JAVAOPTS” for more information.

Include the following initialization file when you deploy RTView with this data source:

File Name

Description

OPTIONS.ini

Contains general options as well as data source options for XML.

Note: Options specified using command line and applet parameters override values set in these initialization files.

Rich Client Browser Deployment Setup for Direct Data Connection

Required Applet Parameters

No additional applet parameters are required for this data source. If you have not already, please review the basic applet parameters required to host the Display Viewer Applet. See “Rich Client Browser with Direct Data Connection - Manual Setup” for more information.

Optional Applet Parameters

The following options are read from OPTIONS.ini if not included in the applet parameters of your HTML file.

Parameter Name

Description

xmlsource

Name (including path) of data update file. If file contains static data, append :0 at the end of file name. This will signal RTView to read the file only once.

Note: It is only necessary to mention static XML data sources in applet parameters.

Setup Client

No additional client setup is required for this data source.

XML Demos

Except where noted, all demos can be run in three ways, as an application, or via rich or thin client in a browser.

Before You Begin

Start the Demo Server 

Rich Client and Thin Client Demos only. 

There are rich and thin client demos already installed on the “RTView Demo Server”.

In an initialized command window (see “Initializing a Command Prompt or Terminal Window”):

Type run_startup_demoserver 

 

Data Source Demo

The Data Source Demo is designed to illustrate each data source.

1.     Start the Simulators 

Start the simulators for each data source you will be using. To run the XML “Data Simulator”:

In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/dstutorial directory and:

type run_simdata

2.     Run Demos - Application, Rich Client Browser, or Thin Client Browser

Application Demo 

1. In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/dstutorial directory.

2. To view the demo, type:

run_viewer 

3. To edit the demo, type:

run_builder 

Rich Client Browser Demo

“Start the Demo Server” if it is not running.

1. In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/dstutorial directory.

2. Start the Data Server by typing:

run_dataserver -socket 

3. In the Data Server dialog, select:

Start Serving Data

4. Open a browser and navigate to http://localhost:8068/dstutorial_applet.

Thin Client Browser Demo 

“Start the Demo Server” if it is not running.

1. In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/dstutorial directory.

2. Start the Display Server by typing:

run_displayserver

3. Open a browser and navigate to http://localhost:8068/dstutorial.

 

Features Demo

Presents an overview of the many features of RTView.

Application Demo 

1.     In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/features directory.

2.     Start the simulator by typing:

Windows: start run_simdata

UNIX: run_simdata &

3.     To view the demo, type:

run_viewer

4.     To edit the demo, type:

run_builder

Rich Client Browser Demo 

“Start the Demo Server” if it is not running.

1.     In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/features directory.

2.     Start the simulator by typing:

Windows: start run_simdata

UNIX: run_simdata &

3.     Start the Data Server by typing:

run_dataserver -socket

4.     In the Data Server dialog select:

Start Serving Data

5.     Open a browser and navigate to http://localhost:8068/features_applet.

Thin Client Browser Demo 

“Start the Demo Server” if it is not running.

1.     In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/features directory.

2.     Start the simulator by typing:

start run_simdata

3.     Start the Display Server by typing:

run_displayserver &

4.     Open a browser and navigate to http://localhost:8068/features.

Geothermal Demo

A real-time operational application that allows you to drill down to various levels of detail.

Application Demo 

1.     In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/geothermal directory.

2.     Start the simulator by typing:

Windows: start run_simdata

UNIX: run_simdata &

3.     To view the demo, type:

run_viewer

4.     To edit the demo, type:

run_builder

Rich Client Browser Demo

“Start the Demo Server” if it is not running.

1.     In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/geothermal directory.

2.     Start the simulator by typing:

Windows: start run_simdata

UNIX: run_simdata &

3.     Start the Data Server.

type run_dataserver -socket

4.     In the Data Server dialog:

select Start Serving Data

5.     Open a browser and navigate to http://localhost:8068/geothermal_applet.

Thin Client Browser Demo

Start the Demo Server if it is not running.

1.     In an initialized command window (see “Initializing a Command Prompt or Terminal Window”), go to the demos/geothermal directory.

2.     Start the simulator by typing:

Windows: start run_simdata

UNIX: run_simdata &

3.     Start the Display Server by typing:

run_displayserver

4.     Open a browser and navigate to http://localhost:8068/geothermal/panels.jsp.

Creating XML Sources

Creating and Formatting XML Data

To attach an object property to XML data element, you will need to specify the XML source, data key and, if the element is tabular, column(s). The XML source is the name, including path, of the XML source file that will be used to update the object.

Note: XML source file names cannot contain spaces. RTView does not limit the number of XML source files you may create. Within each XML source file, you must format your data using the “Supported Tags and Attributes” in the table below.

In order to display your application data in RTView, have your application create an XML source file using the supported tags. Each time you would like to update an XML data element, your application must output an updated copy of the XML source file.

Note: Do not directly edit XML source files. This will cause errors if you are writing to the file while RTView is attempting to read it. When creating or updating XML source files, create a temporary file, write your XML data into it, and then rename the temporary file to the XML source file name. If your XML source file contains non-English characters, you must use UTF-8 encoding.

When an XML source file is added, either from Application Options or directly in the “Attach to XML Data” dialog, RTView will populate Attach to Data drop down menus based on that XML source file. If you specify (or modify) an XML source using the Application Options dialog, you may specify whether that XML source is static. Static XML sources are only read once each time you run RTView.

Data Elements: Scalar and Tabular

There are two types of data elements that you may include in an XML source: Scalar and Tabular.

A Scalar data element is a single value element. The data value can be a string, an integer or a double. Here is an example of how to format a Scalar data element in your XML source:

<data key="element1_data" value="10" />

data

Indicates that this is a scalar data element.

key

Assigns a key for this element. You will select this key in the Attach to Data dialog to attach an object property to this element. Key names cannot contain spaces.

value

Defines the value of this data element.

If this example was included in an XML source file named update.xml, you would select the following options from the Attach To Data drop down menus to connect an object property to this data element:

atd_dialog_xmlscalar.gif

 

Once you Apply this data attachment, the attached object will update with the value "10".

A Tabular data element contains multiple columns and rows of data. The value for each field can be a string, an integer, a double, or a boolean. Tabular data elements are useful for updating Table and Graph objects in RTView. Each time you update tabular data in your XML source, you must include all of the column and row information. Here is an example of how to format a Tabular data element in your XML source:

<table key="production_table">

        <tc name="Plant"

                 type="string"

                index="true" />

        <tc name="Units in Production"

                 type="int"

                index="false" />

<tr name="PID 0">

       <td>San Francisco</td>

       <td>99</td>

</tr>

<tr name="PID 1">

       <td=San Jose</td>

       <td=75</td>

</tr>

</table>

table

Indicates that this is a tabular data element.

key

Assigns key for this element. You will select this key in Attach to Data dialog to attach a property to this element. Key names cannot contain spaces.

tc

Indicates that you are defining a table column.

name

Name of the column. Each table column must have unique name.

type

Indicates what type of data will be included in the column. This field is optional. Valid values are: string, double, int, boolean or date. If the type is not specified, RTView will treat the values in the column as strings.

index

This field reserved for future use.

tr

Indicates that you are defining a table row.

name

Name of the row. Each table row must have unique name.

td

Defines the value of this field in the table.

All of the table columns must be specified before you specify any row data. The order of the table data elements in each row should correspond to the order of your columns. For example, if the first column you specified was a boolean, then the first field you add to each row must contain a boolean value.

If this example was included in an XML source file named update.xml, you would select the following options from the Attach To Data drop down menus to connect an object property to the Plant column in this data element:

atd_dialog_xml00055.gif

 

Once you Apply this data attachment, the attached object will update with the value San Francisco.

Supported Tags and Attributes

The following tags and attributes in XML data files are supported:

Tag

Attribute

Description

dataset

xmlns

Top level tag that includes the namespace attribute xmlns, which must be defined as www.sl.com, and the attribute version, which must be defined as 1.0. (xmlns="www.sl.com" version="1.0")

version

data

key

Key unique to this data element. Key names cannot contain spaces.

value

Value of this data element

table

key

Key unique to this tabular element. Key names cannot contain spaces.

tc

name

This is a required field and must contain a unique column name. All columns must be specified before any rows are specified. Columns must be specified in the order they will be displayed in a table.

type

Type of data contained in this column. This will be used for table sorting. If this field is not included or is invalid, the column will be assigned the type of string. Valid values: string, integer, double, boolean, date.

index

This field reserved for future use.

tr

name

This is a required field and must contain a unique row name.

td

Value for a cell in this row. Values must be specified in the order they will be displayed in a table (i.e.: The first value will be displayed in the first column of the row, etc.) and must be of the type specified for the corresponding column.

An example XML data file:

<?xml version="1.0"?>

<dataset xmlns="www.sl.com" version="1.0">

   <data key="element1_status" value="completed" />

   <data key="element2_status" value="broken" />

   <data key="element1_load" value="0.0" />

   <data key="element2_load" value="1102.0" />

   <table key="trade_table">

            <tc name="Customer"

                     type="string"

                    index="true" />

            <tc name="Symbol"

                     type="string"

                    index="false" />

            <tc name="Shares"

                     type="int"

                    index="false" />

            <tc name="Purchase Price"

                     type="double"

                    index="false" />

            <tc name="Current"

                     type="double"

                    index="false" />

            <tc name="High"

                     type="double"

                    index="false" />

            <tc name="Low"

                     type="double"

                    index="false" />

           <tr name="TID 0">

                   <td>Alice Chen</td>

                   <td>IBM</td>

                   <td>18</td>

                   <td>44.7</td>

                   <td>27.5</td>

                   <td>177.5</td>

                   <td>17.5</td>

           </tr>

           <tr name="TID 1">

                   <td>Betty Jones</td>

                   <td>CVTX</td>

                   <td>19</td>

                   <td>32.0</td>

                   <td>10.8</td>

                   <td>160.8</td>

                   <td>0.8</td>

           </tr>

          <tr name="TID 2">

                   <td>Chris Smith</td>

                   <td>AWE</td>

                   <td>61</td>

                   <td>98.6</td>

                   <td>4.1</td>

                   <td>154.1</td>

                   <td>0.1</td>

           </tr>

   </table>

</dataset>

Data Simulator

A sample data simulator is provided to allow you to work with RTView without setting up your own XML data. The simulator creates and updates a group of data elements according to information specified in a data file. These data elements are given initial values and output to the init.xml initialization file. Once every update period the values for these data elements are updated and output to the update.xml update file.

From an initialized terminal window (see “Initializing a Command Prompt or Terminal Window”) type:

run_simdata 

By default, the update period is set to 2000 milliseconds (2 seconds) to match to default update period for RTView. To change the update period, you must run the XML simulator from a command prompt or terminal window and specify the desired rate on the command line using -u. For example, the following will set the update period to 1 second:

run_simdata -u1000 

The data simulator outputs the following values:

Data Key

Data Type

Data Description

element1_load

double

Value starts at 20 and ranges between 0 and 100, updating by 5.

element1_status

string

Value iterates through the following values:

working, broken, waiting, completed

element1_data

int

Value starts at 15 and ranges between 0 and 100, updating by 10.

element2_load

double

Value starts at 10 and ranges between 0 and 100, updating by 7.

element2_status

string

Value iterates through the following values:

waiting, completed, working, broken

element2_data

int

Value starts at 5 and ranges between 0 and 100, updating by 12.

production_table

tabular

Table containing 15 rows of 5 columns:

Column name="Plant" type="string" (does not change)

Column name="Units in Production" type="int" (changes each update period)

Column name="Units Completed" type="int" (changes each update period)

Column name="Status" type="string" (changes each update period)

Column name="On Schedule" type="boolean" (changes each update period)

system_table

tabular

Table containing 15 rows of 5 columns:

Column name="System" type="string" (does not change)

Column name="Status" type="string" (changes each update period)

Column name="%Free Space" type="double" (changes each update period)

Column name="CPU Usage" type="int" (changes each update period)

Column name="On Site" type="boolean" (does not change)

trade_table

tabular

Table containing 100 rows of 7 columns:

Column name="Customer"  type="string" (does not change)

Column name="Symbol" type="string" (does not change)

Column name="Shares" type="int" (does not change)

Column name="Purchase Price" type="double" (does not change)

Column name="Current" type="double" (changes each update period)

Column name="High" type="double" (changes only if current values gets higher than this value)

Column name="Low" type="double" (changes only if current values gets lower than this value)

Additionally, the simulator will output the following data keys when using the default data file:

Data Key

Data Type

Data Description

step50_150by10

int

Value ranges between 50 and 150, updating by 10.

step-100_100by10

int

Value ranges between -100 and 100, updating by 10.

step50_75

int

Value ranges between 50 and 75, updating by 1.

step0_100

int

Value ranges between 0 and 100, updating by 1.

step0_50by2.5

double

Value ranges between 0 and 50, updating by 2.5.

step0_100by5.0

double

Value ranges between 0 and 100, updating by 5.

step-10_150.0

double

Value ranges between -10 and 150, updating by 1.

random0_100

int

Value is a randomly generated number between 0 and 100.

random0_100.0

double

Value is a randomly generated number between 0 and 100.

step_100

int

Value ranges between 0 and 100, updating by 1.

step_circ_50_200.0

double

Value ranges between 50 and 150, updating by 1.

You may create your own data file for use with the simulator; however, tabular data cannot be generated from a data file.

Use the following syntax to create custom data files:

Command

Description

key step min max start increment

The key value initially equals start and then increases by increment until max is reached. Then it decreases by increment until min is reached and starts over.

key step_circ min max start increment

The key value initially equals start and then increases by increment until max is reached. Then it starts over at min.

key random min max

The value of the key is randomly assigned to a number between min and max.

From the command line, specify the name of the custom data file for the simulator to use:

run_simdata mydatfile 

An example data file:

step50_75                step 50 75 50 1

step0_100                step 0 100 0 1

step0_50by2.5          step 0 50. 0 2.5

step0_100by5.0        step 0 100. 0 5

step-10_150.0           step -10 150 -10 1

random0_100            random 0 100

random0_100.0         random 0 100.

step_100                  step 0 100

step_circ_50_200.0   step_circ 50 200.

XML Data Source Command Line Options

In addition to general options, the following command line arguments are enabled with the XML data source when you run RTView applications from a Windows Command Prompt or UNIX terminal window. See “Command Line Options: Display Builder and Display Viewer” for more information.

Note: If a command line argument contains a space or a semicolon, then the entire argument must be enclosed in quotes (e.g.: "-sub:$data:my Data").

Name

Description

-xmlsource:(filename.xml)

Name (including path) of data update file. If file contains static data, append :0 at the end of file name. This will signal RTView to read the file only once.

Example:

-xmlsource:updatefile.xml

-xmlredirect

Redirect XML sources that don't start with http: or https: through the Data Server. Append :all to redirect all XML sources through the Data Server. Otherwise, XML data sources will be read directly by RTView.

Note: This option only applies when reading Data Server data via socket.

 

Example:

-xmlredirect

-xmlredirect:all