Accumulate
(Hierarchical Accumulator module)
Description: | Adds a tag and a value to be counted for that tag, to a named accumulator. |
Returns: | Invalid |
Usage: | Script or steady state. |
Function Groups: | Variable |
Related to: | GetValue | GetContainerNumActive | GetContainerNumUnacked |
Format: | \HierarchicalAccumulator.Accumulate(TagObj, AccumulatorName, Value [,LocalUniqueID]); |
Parameters: |
TagObj |
Required. The tag object that is contributing to the count |
AccumulatorName |
Required. The name of the accumulator that the tag is contributing to. For example, two accumulator names in use by the Alarm Manager are, "AlarmUnacked" and "AlarmActive". If creating your own accumulator, you may use any name you wish. |
Value |
Required. The current value to count for the TagObj\LocalUniqueID. Commonly a 1 or 0. |
LocalUniqueID |
Optional. If one tag contains items to be accumulated, use this field to provide a locally unique identifier for each.
Example: for accumulation of active alarms in Analog Status tag, this parameter will be "Hi" or "Lo", depending on which built-in alarm is being counted. |
Comments: |
The Accumulate function always returns Invalid. It may be called in steady state (for concise code), or as a subroutine call in a script to save RAM.
The accumulator enables a fresh count to be generated at different levels in a tag tree, and as tags are moved or disabled.
Access to the accumulation of active and unacknowledged alarms is provided by the Alarm Manager's GetContainerNumUnacked and GetContainerNumActive functions. |
Examples:
If Watch(1, AlarmLoUnacked); [ \HierarchicalAccumulator.Accumulate(Root, "AlarmUnacked", AlarmLoUnacked != 0, "Lo"); ]