GetAlarmConfiguration

(Alarm Manager module)

Description: Returns a copy of an alarm's configuration structure, returning an unpopulated structure if 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, which can be obtained using GetAlarmName.
If there are multiple built-in alarms in a tag, the convention is to concatenate the UniqueID with a separator and a unique integer or string per alarm. For example, Concat(Root\UniqueID, \AlarmSeparatorString, 0).

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, which can be obtained using GetAlarmName.
If there are multiple built-in alarms in a tag, the convention is to concatenate the UniqueID with a separator and a unique integer or string per alarm. For example, Concat(Root\UniqueID, \AlarmSeparatorString, 0).

FriendlyName Display name of the alarm's source. This is only needed for alarms that are not associated with a tag, such as service alarms. Tag alarms will always show the tag's Name as the display name.
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.
Hook

The name of a module you supply, which will be called whenever any alarm event occurs for the given alarm, including events such as active / normal / acknowledge / shelve / disable / commission / etc.

VTScada will look for the callback module starting in the AlarmObject that is provided in the call to Commission(), and will search upwards until it reaches Code level. This gives you flexibility to specify your callback module in your custom alarm tag, or in a custom ancestor tag, or in the application (AppRoot).

The callback module must take a TransactionInfo structure as its only parameter. It is expected to return TRUE or Invalid to allow the transaction to be logged, or FALSE to prevent it.

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