Commission
(Alarm Manager module)
Description: | Commission the alarm by adding it to the Configured list, or modify an existing alarm's configuration. |
Returns: | Nothing |
Usage: | Script Only. |
Function Groups: | Alarm |
Related to: | Decommission | GetAlarmConfiguration | EvaluateAlarm |
Format: | \AlarmManager\Commission(AlarmObj, CfgStructure[, Value, ValueTimestamp, SuppressConfigEvent, AlarmDB, MachineID) |
Parameters: |
AlarmObj |
Required. The alarm object. Normally, the object pointer to the tag within which the alarm is being commissioned. |
CfgStructure |
Required. A structure of alarm configuration parameters. Normally obtained by a call to \AlarmManager\GetAlarmConfiguration. |
Value |
Optional numeric. Current value to evaluate, based on the new configuration. |
ValueTimestamp |
Optional UTC timestamp of the value. Defaults to the current time. |
SuppressConfigEvent |
Optional Boolean. If TRUE, no transaction record will be stored for this call to Commission. Should be used for alarm parameters that may be updated often due to being set by tag values or expressions rather than constants. Defaults to FALSE. Note that configuration events (for example, "Modify") are automatically filtered from the History list. Operators must enable the display of these events with the "Show Configuration Events" tool of the Alarm List. |
AlarmDB |
Optional name or object. The alarm database to be used for this alarm. Not necessary if the alarm object is valid. |
MachineID |
Optional. The workstation ID to be associated with the alarm. Defaults to the current workstation. |
Comments: |
Commission should be used when creating an alarm, or when updating that alarm's configuration. It will always generate a new call to EvaluateAlarm with the given value of the trigger, evaluating that against the current setpoint and comparison function. Commission will store the alarm's object and its Root value in a dictionary of alarm names. This gives an efficient look-up table to get an alarm object. After an alarm has been commissioned, further calls to this function will update that record in the alarm database. A call to \AlarmManager\Evaluate is made automatically as part of each call to Commission. Note: For the sake of creating efficient code, commission should never be used as a substitute for EvaluateAlarm. Use commission only when creating or changing alarm configuration, not when handing new values to the alarm to be evaluated against the setpoint. |
Example:
The following would typically be found in a tag's Refresh state. This alarm will trigger when the tag's value becomes 1.
IfElse(Valid(Name), Execute( { create or obtain the configuration structure for this alarm } Cfg = \AlarmManager\GetAlarmConfiguration(Root.UniqueID); { update the property values in that structure } Cfg\Name = Root.UniqueID; Cfg\Area = Area; Cfg\Priority = PriorityValue; Cfg\Setpoint = 1; Cfg\Function = \AlarmManager\ALM_FUNC_EQUAL; { ... other configuration properties as required ... } { commission, or update the commission of, the alarm } \AlarmManager\Commission(Root, Cfg, Value); ); );
Alarm API Structure Definitions - Alarm configuration structures