Building a Display Using History Data

This section explains how to create a display in the Builder that accesses your historical data. This section assumes you have configured the Historian, and that your Historian has had time to gather data. For configuration information, see Configuring the Historian. For general information about the Historian, see Overview.

Data saved out of the Historian to the history database can be viewed from an RTView display if you are licensed for the SQL data source. For step-by-step instructions on viewing and configuring historical data, see Examples>The Historian .

Note: The SQL data source may not be licensed in your RTView installation.

Note: The name of the history database must match the Historian Database name specified in the Historian application. See Historian Application Configuration for more information.

You build a display using History data by attaching an object to your historical data. You have the following options for attaching your historical data:

Enable valueHistoryFlag
Creating a SQL Data Attachment
Extend with SQL

 

Enable valueHistoryFlag

The trend graph on the Graphs tab of the Object Palette (class name: obj_trendgraph02) features a trace*ValueHistoryFlag property for each trace. If you select this property, RTView attempts to connect to the history database and load initial data from the Historian for the corresponding trace any time you open a display containing that graph. Only data within the timeRange set on the graph is loaded and the graph is updated as live data becomes available. See Trend Graphs for more information.

To set up a trace to load from the history database, you must have a corresponding object in a history configuration file that the Historian is using. The data attachment in the configuration file must exactly match the data attachment for your trace. The data must not be stored in a user defined table. Only data stored in the Numeric Data Table (HISTORY or the table name you specified) is used to load historical data into your trace.

Creating a SQL Data Attachment

Any object in RTView can display historical data using an SQL data attachment.

For information about configuring history database tables for use in data attachments, see the steps to create your own history table. See Display File Configuration for more information.

Extend with SQL

The Extend with SQL option is the simplest way to retrieve and display all of your data: current, real-time data and historical data.

As a cache data source receives real-time data it displays the data and stores it in-memory. The cache continues receiving and displaying real-time data, and eventually the in-memory space reaches full capacity. The oldest in-memory data then overflows into a second source, the History database. The data stored in the History database (the "overflow" data) is not included in displays. Only data from the first source, stored in the cache in-memory space, is displayed.

To use Extend with SQL, you configure a cache to use a SQL query to retrieve data from an external database. To configure Extend with SQL, make a data attachment to a cache history table, select Advanced Filter Rows, specify the time period of interest, and select Extend with SQL. For details, see Extend with SQL and Filter Rows: Advanced.

Extend with SQL requires the following Object Properties be specified for a:

Table Cache

maxNumberOfHistoryRows
databaseName
historyTableName

Double Cache

maxNumberOfHistoryRows
databaseName
historyTableName

See Caches for more information.