Syntax of an OPC Historic Tag

NOTE: Tags do not apply to Template expressions, instead you use Template Parameters.

You can use a historic tag to calculate a value from a database item's historic data. The historic tag performs a specific calculation on the item's historic data and returns a single value. A historic tag has the following syntax:

"<Item>.<Database Aggregate>;<OPC Historic Algorithm>;<Start Date>;<Interval>"

"<Item>;<OPC Historic Algorithm>;<Start Date>;<Interval>"

Where:

Do not enter the angle brackets < > .

Take care with End and End Last Historic Algorithms used on clients, or with Geo SCADA Expert features, that run in Local Time with Daylight Saving Time. Ensure that the start and end times specified for the sample interval do not coincide exactly with the time at which the clock jumps backward. Include a small offset in the sample time, to offset the calculation to avoid the sample end or start time exactly matching the time that the clock jumps backward at the transition from Daylight Saving Time to Standard Time. A small offset of 1s or even 1ms should suffice. For more information about Daylight Saving Time, see The Effects of Daylight Saving Time Adjustments.

If the item only has a single historic database aggregate, you can leave out the <Database Aggregate> part of the expression. For example, points only have a single historic database aggregate and so the <Database Aggregate> part of the expression is not required. If there are multiple historic database aggregates, you have to include the <Database Aggregate> so that Geo SCADA Expert knows which database aggregate to use. For example, forecasts have multiple historic database aggregates, so a database aggregate has to be specified in a historic tag to define which forecast is required.

Example:

The following expression is used to animate the Value property of a text box on a Mimic:

".Region.DEC System.AI;Average;H;1H"

The text box displays the average value since the start of the current hour for a point called 'AI'. The 'AI' point is located in a sub-group called 'Region.DEC System'.

The same result could be achieved by entering:

".Region.DEC System.AI.Historic;Average;H;1H"

If the expression was to reference a database item that has multiple historic database aggregates, such as a forecast, the database aggregate part of the expression has to be included. For example, if a text box on a Mimic was animated to show the maximum value since the start of the current day for a forecast called 'D1Forecast', the expression would be:

".Region.DEC System.D1Forecast.Forecast1;Max;D;1D"

Where:

  • Region.DEC System.D1Forecast is the name and location of the forecast
  • Forecast1 is the name of the required database aggregate. Each forecast database item can contain up to eight forecasts and is stored in its own database aggregate. By defining the database aggregate in the expression, you specify which of the eight forecasts are to be used in the calculation, in this case, Forecast1.
  • Max is the name of the OPC historic algorithm (this calculates the maximum value)
  • D defines the start range as the start of the current day
  • 1D defines the duration of the range as 1 day.

Disclaimer

Geo SCADA Expert 2019