GetAlarmStat
(Function Library)
Description: | Returns the number of alarms in the given tag and its descendents, where those alarms match the specified statistic. |
Returns: | Text |
Usage: | Script or steady state. |
Function Groups: | Alarm |
Related to: | AlarmCondition |AlarmUnAckCondition |
Format: | \FunctionLib.GetAlarmStat(TagObj, Statistic[, Priority]) |
Parameters: |
TagObj |
Tag object to be checked for alarm statistics. Typically a parent tag, such as a station. Typically provided in the form, [TagName]\Root |
Statistic |
Required Text. Specifies which alarm types or states to count. See comments. |
Priority |
Optional Numeric. Specify only if querying statistics for a given priority value. |
Comments: |
This module is a member of the Function Library, and must therefore be prefaced by \FunctionLib. as shown in the "Format" section. The Statistic parameter must be provided as text using one of the following keywords. Counts include alarms in descendents where appropriate, such as with suppressed alarms.
|
Example:
Example shows an expression that could be added to the user interface (such as within an I/O or Calculations tag) rather than a script code file.
\FunctionLib.GetAlarmStat([Station 1]\Root, "ActiveCount")
Will return 5 if there are five active alarms in Station 1 and its descendants.