2.5. Creating and Querying Historical Records

To create and/or query historical records of PID Emulator data, click the History button on the Controller to start the History program.

History and data plot in GTK 
 

History in Photon 1.14

 

Starting the History program automatically starts the Cascade Historian, and gives you some ways to interact with it. The first button, Record, tells the Cascade Historian to record data for the number of seconds indicated in the spin button. (The PID Emulator must be running for this to work.)

The data from a query gets plotted automatically. In QNX the plot appears in a pane of the GUI. This pane holds a CwGraph widget, which was created by Cogent. In Linux the Plot Data button uses gnuplot to plot queries, similar to the Making plots buttons in the Log program. The interpolator and deadband options are explained in detail below.

2.5.1. Interpolator options

In the Interpolator options area you can specify the kind of query to make on the recorded historical data, based on the Cascade Historian interpolator of your choice (NoInterpolator, Periodic, Relative, or FixedRelative). Each interpolator has certain parameters, but not all parameters are available for every interpolator. However, the first three parameters are common to all interpolators:

    Y history specifies the history for the data point you wish to query.

    Start is the starting time of the query. It is automatically entered when you press the Record button, and is displayed in this entry box as the number of seconds after midnight of last night (eg. 9:00 a.m. would be 32400). The History program converts this entry to system time before sending it to the Cascade Historian.

    Duration is the length of the query, in seconds. This is also entered automatically when you press the Record button,

The Periodic interpolator uses two more parameters:

    Time Interval lets you choose a fixed time interval for each query data line. For example, every second (1), five times per second (.2), twenty times per second (.05), etc.

    Max Gap is an optional parameter that lets you specify the maximum length of time for which interpolation will be applied when no data exists. If the time between two data samples exceeds this maximum, then data will not be interpolated between the points.

The Relative and Fixed Relative interpolators interpolate the Y history against another history (X history) rather than time. And the Fixed Relative interpolator lets you specify a Time Interval for the query, like for the Periodic interpolator (above).

The Update display button is provided as a convenience to send a query and update the text and plot displays whenever you make any changes to any of the parameters.

For more information about interpolators, please refer to the interpolate command in the Commands reference of the Cascade Historian manual.

2.5.2. Deadband options

This is where you can set up and view deadbands on histories. A deadband gives you a way to filter out excess or repetitive data, reducing the size of the history file. The deadband tells the Cascade Historian to record the first value as a baseline value, and prevents the recording of subsequent values unless they exceed the deadband parameters explained below. Once a value exceeds the deadband parameters it is recorded, and becomes the new baseline.

Each time you press the Record button, the History program records 3 separate histories, one regular and two deadbanded. This allows us to view plots of any of the three histories simultaneously. The deadbanded histories are of two types: with and without prior values. A prior value forces the writing of the value just prior to any value that exceeds the deadband. A prior-value deadband creates a more realistic picture of the data, but it plots a few more points.

You can change the deadband parameters using the Set up deadband types button to open the Deadband Types window (shown below). Any changes made here will not take effect until the Record button is pressed to record new data. There are four different deadband parameters:

 

The Deadband Types window in GTK

 

The Deadband Types window in Photon 2

    Absolute is an absolute amount which must be exceeded before a value is recorded.

    Percent is a percentage of the baseline which must be exceeded before a value is recorded.

    [Note]

    If both of the above parameters are used, a value must exceed both of them before it will be recorded.

    Time Limit limits the application of the deadband to a length of time. Whenever the time limit expires, the value is recorded, whether or not it exceeds the deadband.

    Count Limit limits the application of the deadband to a number of changes of the point's value. Whenever the count limit expires, the value is recorded, whether or not it exceeds the deadband.

Each time a deadband is applied the system prints the return value from the Cascade Historian to STDOUT. For more information about deadbands, please refer to the deadband command in the Commands reference of the Cascade Historian manual.