History Statistics Tag

Not counted towards your tag license limit.

Each instance of a History Statistics tag will perform 7 statistical calculations, using the data collected from a numeric tag's value over a defined time period. History Statistics tags complement, rather than replace, Totalizer tags and Counter tags. The result of only 1 calculation will be shown, but you may display other calculations by linking other History Statistics tags to the first - these will simply take the result of the requested calculation from the first tag rather than performing calculations of their own.

History Statistics tags work by querying the saved history of the tag they watch. This query happens on startup and at every multiple of the update rate. If you create a large number of History Statistics tags you can expect system performance to slow accordingly.
History Statistics tags may be useful for screen displays. They are not required for reporting purposes.

The available calculations include:

  • Time-weighted average - average value over a specified length of time.
  • Minimum value during period
  • Maximum value during period
  • Value at start
  • Count of zero to non-zero transitions (e.g. equipment starts)
  • Non-zero time (example: total time that a pump was running during the period)
  • Totalizer, calculated as the sum of the values logged during the time period. Note that this calculation differs substantially from that used by Totalizer tags.

Any numeric tag may be used as the data source, so long as its value is logged. The exception is if the data source is another History Statistics tag. A warning will appear if you attempt to use a data source that is not being logged.

When counting non-zero time, note that logged INVALIDS are counted as zero. If equipment goes offline (or appears to) this may cause the History Statistics tag to report a shorter run time than expected.

Statistics are collected over a given duration of time (the Manual Data Period option in the tag's configuration). You provide the length of the time period and the frequency at which the display is to be updated. Time durations fall on regular clock intervals. For example, a manual data period set for the latest 1 hour, updated every 15 minutes, will use logged data for the 60 minutes prior to the most recent quarter-hour mark.

The calculated value of the History Statistics tag can be displayed on a page using any of the Analog widgets. While a History Statistics tag can be selected for inclusion in the Historical Data Viewer (HDV), clicking on one that is drawn on a page will not cause the HDV to open. Note that if you want to save the values calculated by the History Statistics tag, you will need to select an Historian to use for the built-in connection.

Values are not logged by default, but can be by attaching an Historian. If logged, the timestamp recorded for each calculated time span will match the start time, not the end time.

History Statistics properties Source Settings tab

Use this tab to select the logged tag whose value is to be used for the calculation, and the particular calculation to be performed by this instance of the History Statistics tag.

Every standard VTScada tag has only one source variable that can be used for the calculation: its value. Custom tag types may expose other variables that can be used in the calculation.

Options to select a data source

Source

Select the tag whose value (or other source variable) is to be used in the calculation. All numeric tag types are available. By default, the nearest Numeric parent tag will be selected. You can select another History Statistics tag here if you wish to display a different one of its 7 calculations. Selecting another History Statistics tag as the data source will disable the Data Period options for this tag instance.

Source Variable

For all standard VTScada tags, the only source variable is the tag's value. Custom tags, written specifically for your application, may make other variables available. If so, the drop-down list will be populated with the available choices.

Statistic

Select the calculation to be performed from the following list:

  • Average - time weighted average over the data period.
  • Minimum value during the data period.
  • Maximum value during the data period.
  • Value at start of the data period.
  • Zero to non-zero transitions during the data period.
  • Non-zero time. Example: total time that a pump was running during the period.
  • Totalizer - the sum of the values collected during the data period.

Difference from the Totalizer tag:

The Totalizer tag calculates a time-weighted integral of the values collected. The totalizer option of the History Statistics tag provides a sum of the values within the time interval. Both have their uses.

Scaling Factor

The calculated value will be multiplied by the factor you specify in this field. Use for applying a scaling factor to the value, for example if correcting for raw values that are measured in terms of minutes or hours instead of seconds. Defaults to 1.

Engineering Units

Text that will indicate to operators what the value of this tag means.

Questionable Data

Use this field to flag the tag’s data in the event that you suspect the values it is reporting might not be correct, or when this tag has initially been created and you wish to ensure that its data is marked for extra monitoring.

History Statistics properties Data Period tab

This panel is used to set the length of the calculation period, and the rate at which the calculation is updated.

If another History Statistics tag has been selected as the data source, all fields in this panel will be disabled. The source History Statistics tag will control the data period.

History Statistics data period options

Latest

Use the text field to set a number of time units. The statistic calculation will use data from this length of time, measured to the nearest clock interval as controlled by the update rate.

Update Rate

Sets the frequency at which the statistic is recalculated. The calculation will always use data from the full length of time specified by the Latest field, ending on the clock interval specified by this update rate. For example, if the update rate is 5 minutes, the update will occur at the 5 minute mark, 10 minute mark, etc.

The update rate must not be greater than the duration of time over which the statistic is being calculated, and can be no smaller than 0.1% of that time period.

If a parameter expression is used for either of these two values, the units will always be seconds. The time unit selection tool will be disabled.

History Statistics properties Historian tab

Optionally, link an Historian tag to this History Statistics tag to save a record of the summary data calculated by the History Statistics tag. Logging is done at the interval configured in the data period tab. In a multi-server application, logging is broadcast to all machines running the application.

Note that the History Statistics tag uses logged data for its calculations, thus logging the result of those calculations is redundant. Doing so may simplify later report generation, but at the cost of increased storage.

If logging is enabled by attaching an Historian, note that the timestamp of each recorded value will match the beginning of the configured time span, not the end.

The default is to have no connection to an Historian.