AddToList

(Alarm Manager module)

Description: Adds an alarm to the specified list in an Alarm Database, usually a custom list.
Returns: Nothing
Usage: Script Only.
Function Groups: Alarm Functions
Related to: Commission | EvaluateAlarm | RemoveFromList
Format: \AlarmManager.AddToList(AlarmName, ListName, Action[, Timestamp, AccountID, Device, HookName, MachineID, Custom, FromPLC, Description, Config])
Parameters:  
AlarmName
Required text. A unique name for the alarm. Typically, the unique ID 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).
ListName
Required. The name of the list to add to, e.g. “Active”.
Action

A string or PhraseID that identifies the reason for the transaction.

For default options, see Alarm Action Codes in Alarm API Structure Definitions

Timestamp
Optional. UTC timestamp of the value. Defaults to the current time.
AccountID
Optional. AccountID of operator
Device
Optional. Name of client device.
HookName
Advanced Option. Name of the hook module to call before logging this transaction.
MachineID
Optional. Workstation MachineID. Defaults to local.
Custom
Optional. Structure of custom fields to be logged with the event.
FromPLC
Advanced Option. Set to FALSE.
Description
Optional. Customized description, used if it differs from the description given to Commission.
Config
An Alarm Configuration Structure. Not required if the alarm has been commissioned via a Commission() call.
Comments:

Advanced users only.

AddToList can be used to add an alarm to a custom list. The custom list can be displayed by specifying it in a <ListFormats><Format> section of AlarmListsFormats.XML as defined in Customize Columns in Alarm Displays

To add an alarm to the Active of Unacked lists based on an evaluation of a tag's Value compared to the alarm Setpoint, consider using EvaluateAlarm instead. (Although, AddToList can, technically, do this too.)

Example:

To add an alarm to a custom "Deferred" list:

\AlarmManager.AddToList(AlarmName, “Deferred”, “DeferLabel”);