SetShelved

(Alarm Manager module)

Description: AlarmManager subroutine that handles the shelving and unshelving of alarms.
Returns: Nothing
Usage: Script Only.
Function Groups: Alarm Manager
Related to: IsShelved | SetSuppressed
Format: \AlarmManager\SetShelved(AlarmName, Shelve[, ExpiryTime, Timestamp, AccountID, Device, MachineID]);
Parameters:  
AlarmName
Required.

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).

Shelve
Required. Boolean that indicates whether to shelve (TRUE) or unshelve (FALSE) the alarm.
ExpiryTime
Optional. The UTC timestamp for when the alarm should automatically unshelve.
Timestamp
Optional. The UTC timestamp of this event. Defaults to now.
AccountID
Optional. ID of the user who initiated this event. Defaults to the user currently signed in at the workstation.
Device
Optional. The name of the client device calling this function.
MachineID
Optional. The machine ID of the workstation calling this function.
Custom
Optional. Structure of custom fields to log.
(Refer to Alarm API Structure Definitions)
FromPLC
Optional Boolean. Used only with the PLC Alarm tag. TRUE when Shelve or Unshelve took place in the PLC.
Auto
Optional Boolean. TRUE if this is the result of an automated action such as that of unshelving on time expiry. Defaults to TRUE.
Comments:

 

Examples:

Code\AlarmManager\SetShelved(AlarmName, TRUE, CurrentTime(1) + 300);