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

Condition

Alarms have a condition which provides an indication of the type of alarm that has been raised (see Understand Alarm Conditions and Subconditions in the ClearSCADA Guide to Alarms). The condition of each alarm is active when the alarm is unacknowledged and/or uncleared, and is inactive when an alarm is acknowledged and cleared. As alarms in the Alarm Banner are either uncleared, unacknowledged, or both, you cannot see an alarm with an inactive condition.

The condition has one or more sub-conditions, one of which will be active whenever the alarm condition is active. The sub-conditions describe the various states of the condition and provide a more specific indication of the type of alarm. For example, a simple analog point has a condition called 'AnalogValue' which has six subconditions: 'Overrange', 'HighHigh', 'High', 'Low', 'LowLow', and 'Underrange'. So when the alarm is uncleared and/or unacknowledged, the 'AnalogValue' condition is active and one of its six subconditions is also active (the active subcondition corresponds to the state of the alarm, so if the point’s value is in the High alarm limit range, the 'High' subcondition will be active).

The Alarm.SelectedAlarms and Alarm.Alarms properties both return an alarm collection, and each alarm in the collection has a Condition property. The Condition property represents the active condition of the selected alarm. You can access the Condition in your script.

Syntax

Condition

Description

Returns a string containing the name of the active condition for the alarm.

Arguments

None.

Returns

String.

A string that contains the name of the alarm’s active condition.

Example:

In this example, Alarm.Condition is used to return the string that represents the active condition of the selected alarm. The string is displayed in a message box next to the text "Condition", and the source of the alarm, 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", "Condition" & Alarm.Condition & ", "Severity" & Alarm.SeverityDesc & ", Time " & Alarm.Time & ", "Source" & Alarm.Source & ", logged on user name " & Alarm.Server.Username & ", Object name " & Alarm.Object.Fullname
  • End Function

ClearSCADA 2015 R2