Data Historian

Help Contents

Introduction

The Data Historian stores timestamped data samples taken from:

You can display data from the Data Historian in a Trend Plot:

A trend plot of two tags in the data historian.

You can display data from the Data Historian in a list:

A historic data list.

Choosing Which Tags Store Values in the Data Historian

You can configure which tags store values in the Data Historian using the HistoricEnable property. This property can be set separately for each Data Point Tag and Time Series Tag.

HistoricEnableDescription
FalseNo data samples from the tag is stored in the Data Historian.
TrueData samples from the tag are stored in the Data Historian.

Note: If you change HistoricEnable from True to False, the existing data samples are retained in the Data Historian.

Data Access Interfaces

Third party applications can access the Data Historian from these interfaces built in to Fernhill SCADA:

Using SQL to Query the Data Historian

Each Tag stores its data in a separate named data table. To find the name of the data table for a tag, read the value of the HistoricDataTable property.

You can query a historic named data table directly. For example:

SELECT 
    ValueTime AS "Time Stamp", 
    ROUNDSD( Value, 4 ) AS "Value", 
    QUALITY_TO_STRING( Quality, TRUE ) AS "Quality", 
    LOG_REASON_TO_STRING( LogReason ) AS "Log Reason"
FROM 
    Historic000014
WHERE 
    ValueTime >= Current_Timestamp - Interval '1' Day
ORDER 
    BY ValueTime DESC
FETCH FIRST 250 ROWS ONLY

Historic Data Views

The Data Historian provides a set of views for querying all historic data of a given type:

View NameDescription
HistoricDataViewBOOL Historic data for Digital Data Point Tags.
HistoricDataViewLREAL Historic data for Analog Data Point Tags.
HistoricDataViewTIME Historic data for Time Series Runtime Tag.
HistoricDataViewUDINT Historic data for Double Word Data Point Tags.
HistoricDataViewUINT Historic data for Word Data Point Tags.
HistoricDataViewULINT Historic data for Long Word Data Point Tags and Time Series Counter Tags.
HistoricDataViewWSTRING Historic data for String Data Point Tags.

You can use an INNER JOIN to query the historic data for a tag from a historic view:

SELECT 
    ValueTime AS "Time Stamp", 
    ROUNDSD( Value, 4 ) AS "Value", 
    QUALITY_TO_STRING( Quality, TRUE ) AS "Quality", 
    LOG_REASON_TO_STRING( LogReason ) AS "Log Reason"
FROM 
    HistoricDataViewLREAL AS H INNER JOIN TagDataPoint AS T
    ON T.HistoricDataTable = H.TableName
WHERE 
    T.FullName = 'Example Graphic.Tank Level'
ORDER BY 
    ValueTime DESC
FETCH FIRST 1000 ROWS ONLY

Further Information

Fernhill SCADA Concepts

To learn about other Fernhill SCADA Concepts.

Configuration Tool

To learn about the tool to configure Fernhill SCADA.

Drivers

To learn about the different drivers available in Fernhill SCADA.

Fernhill SCADA Server

To learn about the SCADA Server.

Data Access

To learn about integrating data into third party applications.

Glossary

For the meaning of terms used in Fernhill SCADA.