Applies To:
  • CitectSCADA 6.xx
  • CitectHMI 6.xx

Summary:
How can I determine the Type of an Alarm from anywhere in Cicode? All I can see is the function AlarmSumType, but I want to find the type of an Alarm that isnt in the Summary list at the time.  

Solution:
For v6.10 and below, the Cicode function below which will return the Alarm Type (as an INT) when given the name of an alarm.

INT
FUNCTION GetAlmType(STRING TagName, INT ProcAnFormat = 0)

    INT iType, iRecordIdentifier, iResult;

    iRecordIdentifier = AlarmFirstTagRec(TagName, "","");
    iType = iRecordIDentifier BITAND 0x0000FFFF;

    SELECT CASE iType
        CASE 0 //DIGITAL ALARM
            sMsg="The alarm: " + TagName + " is of type: DIGITAL ALARM";
        CASE 1 //ANALOG ALARM
            sMsg="The alarm: " + TagName + " is of type: ANALOG ALARM";
        CASE 2 //ADVANCED ALARM
            sMsg="The alarm: " + TagName + " is of type: ADVANCED ALARM";
        CASE 3 //MULTI-DIGITAL ALARM
            sMsg="The alarm: " + TagName + " is of type: MULTI-DIGITAL ALARM";
        CASE 6 //TIME-STAMPED ALARM
            sMsg="The alarm: " + TagName + " is of type: TIME-STAMPED ALARM";
        CASE 8 //TIME-STAMPED DIGITAL ALARM
            sMsg="The alarm: " + TagName + " is of type: TIME-STAMPED DIGITAL";
        CASE 9 //TIME-STAMPED ANALOG ALARM
            sMsg="The alarm: " + TagName + " is of type: TIME-STAMPED ANALOG ALARM";
        CASE ELSE //UNKNOWN
            sMsg="ERROR - Unknown Alarm Type";
    END SELECT
    Message("Alm_Type",sMsg,0);
    RETURN iType;
END


In V7 , you can simply do the following:

sAlarmType = AlarmGetDsp(iANAlarm, "ALARMTYPE") ; // to get alarm type as string
iAlarmType = AlarmGetDsp(iANAlarm, "TYPENUM"); // to get alarm type as a number


 

Keywords:
Alarm Type Name Cicode 
 

Attachments