Raw Historic Values in ST Programs
You can use raw historic values as inputs in your ST programs.
In ST Programs, you need to specify the raw historic variables in the VAR variables list. The format for a historic variable needs to be:
<name of variable> AT %I(<Path of point>.Historic.<Historic Function> (<arguments for historic function>) : <type of variable>;
For example:
LastHistoricValue AT %I(Analog Input.Historic.RawValue ('D-1H', 'H+1H', 0, TRUE)) : LREAL;
The variable definition (above) has the name LastHistoricValue. The %I is used as historic values have to be read only.
Analog Input is the name of the point (which is located in the root directory). Historic is required to instruct the program to use the point's historic data. RawValue is the historic function (see Historic Functions and Arguments for more information).
('D-1H', 'H+1H', 0, TRUE) indicates the arguments for the RawValue function. Each different type of function requires different arguments. The arguments are listed in Historic Functions and Arguments.
LREAL is used to indicate the type of value that is the output of the historic variable.
ATTENTION: You should construct your queries so that they query limited amounts of historic data. Large and inappropriate query searches can severely affect system performance and can potentially delay other system operations.