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

CategoryDesc

Alarm categories are classes of conditions and are used to provide a general indication of the type of alarm that has been raised. The Condition and Subcondition of the alarm provide more specific indications 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'. The point’s value is 5 which is in the 'LowLow' threshold that has been configured for the point. This means that an alarm is raised for the point and the alarm has the following attributes:

From the example, you can see that the Category provides a very general indication of the type of alarm that has been raised, the Condition shows a more specific indication of the type of alarm, and the Subcondition shows the point state that has caused the alarm to be raised.

To access the Category of an alarm in your script, you need to use the CategoryDesc property of the alarm. You can access the CategoryDesc property of any alarm in an alarm collection that has been returned by the Alarm.SelectedAlarms or Alarm.Alarms properties. The CategoryDesc property returns the alarm’s category value as a string.

Syntax

CategoryDesc

Description

Returns the category of the alarm.

Arguments

None.

Returns

Category {string}. The alarm’s category is returned as a string.

Example:

In this example, Alarm.CategoryDesc is used to return the alarm category of the selected alarm. The number is displayed in a message box next to the text "Category", 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 & ", "Category" & Alarm.CategoryDesc & ", logged on user name " & Alarm.Server.Username & ", Object name " & Alarm.Object.Fullname
  • End Function

ClearSCADA 2015 R2