You are here: Core Reference > Coding > Scripting > Cookie

Cookie

The Alarm.SelectedAlarms and Alarm.Alarms properties both return an alarm collection. Each alarm in an alarm collection has a unique cookie number which is used to identify each instance of alarm (if an alarm is re-raised, it will be allocated a new cookie). While alarm cookies are not displayed in the Alarm Banner, you can access them in your Alarm Banner scripts by using the Cookie property.

Syntax

Cookie

Description

Returns the unique cookie number of the alarm.

Arguments

None.

Returns

Cookie {integer}. The alarm cookie is returned as a number.

Example:

In this example, Alarm.Cookie is used to return the alarm cookie number of the selected alarm. The number is displayed in a message box next to the text "Cookie", and the time of the alarm, the severity description, the alarm item’s full name, and the name of the logged on user are also shown.

  • Function ShowAlarmInfo( Alarm )
    • MsgBox "One Alarm Selected", "Severity" & Alarm.SeverityDesc & ", Time " & Alarm.Time & ", "Cookie" & Alarm.Cookie & ", logged on user name " & Alarm.Server.Username & ", Object name " & Alarm.Object.Fullname
  • End Function

ClearSCADA 2015 R2