GetAlarmConfiguration
(Alarm Manager module)
Description: | Returns a copy of an alarm's configuration structure, returning an unpopulated structure it does not already exist. |
Returns: | Structure (see comments) |
Usage: | Script Only. |
Function Groups: | Alarm |
Related to: | Commission | GetAlarmStatus |
Format: | \AlarmManager\GetAlarmConfiguration(AlarmName) |
Parameters: |
AlarmName |
Required text. Unique name for the alarm. Typically the unique ID. |
Comments:
GetAlarmConfiguration should be called before commissioning an alarm. This will create an alarm structure that can be populated for the call to \AlarmManager\Commission().
An alarm has the following configuration structure:
ConfigurationStruct { All Boolean flags default to FALSE } | |
---|---|
Name |
Unique name for the alarm. Typically the unique ID. |
FriendlyName | Display name of the alarm's source. |
Area | Area |
Description | Description. See also: NoLegacyAlarmDesc |
Priority | Priority. Must be valid to be commissioned. Must be an integer corresponding to the Alarm Priority tag values. A priority of 0 will be treated as an event and will not go on either the Active or Current lists. |
Reserved | |
Disable | TRUE to disable the alarm. |
DisableParmName | Name of the tag's disable parameter. Allows you to get the operator name who made the configuration change. |
OnDelay | Seconds to delay before activating. |
OffDelay | Seconds to delay before clearing. |
RearmDelay | Seconds to delay before rearming after acknowledgment. |
Setpoint | Setpoint of alarm evaluation. The value is compared against the setpoint. |
ValueLabels | Array of labels to display instead of Value or Setpoint. Rarely used by tags other than digitals. |
Units | Phrase Key of the setpoint units. |
Function | Enumerated function for alarm evaluation. See: Alarm Manager Function Constants |
AlarmType | String identifying the type of alarm. Used for display purposes only, in accordance with the ISA18.2 standard. Examples include "Low", "High", "Test". |
Trip | TRUE if alarm only becomes unacked not active. |
NormalTrip | TRUE if alarm becomes unacked when it clears. |
OffNormal | TRUE if alarm only becomes active not unacked. |
Deadband | Setpoint deadband. |
PopupEnable | TRUE to enable popup display of active alarm. |
SoundFile | Filename relative to app path of custom sound. |
Custom | Number/String/Array/Dictionary/Structure containing custom data. This information is not shown anywhere on the AlarmPage by default, but could be displayed using a custom column. |
AdHoc | TRUE if alarm is ad hoc. Should not be set explicitly. It is an internal flag that is set if the alarm object calls AdHocAlarm() rather than Commission() |
ReactivateOnValueChange | If TRUE, the alarm will reactivate whenever the reported value changes. |
DescPhraseID | PhraseID or a ParmPhrase structure to translate the description to current language. |
NormalAck | TRUE to auto-ack the alarm when it clears. |
DisplayInfo | Sub-structure of display information. For display only, not evaluation. |
Example:
The following would typically be found in a tag's Refresh state.
IfElse(Valid(Name), Execute( { create or obtain the configuration structure for this alarm } Cfg = \AlarmManager\GetAlarmConfiguration(UniqueID); { update the property values in that structure } Cfg\Name = Root\UniqueID; Cfg\Area = AreaValue; Cfg\Priority = PriorityValue; Cfg\Setpoint = 1; Cfg\Function = \AlarmManager\ALM_FUNC_EQUAL; { commission (or update the commission of) the alarm } \AlarmManager\Commission(Root, Cfg, Value); ); );
(1)Function constants are documented in: Alarm Manager Function Constants