Can't read Alarm Class from Alarm Storage

mareszym
2020-05-27
2024-06-06
  • mareszym - 2020-05-27

    I try to read Alarm Class from Alarm Storage by this code, of course in the beginning I define AlarmManagerClient, etc.

    AlarmManager.g_AlarmHandler.GetAlarmsFromStorage( ...... );

    FOR i:=0 TO iCountRowsFromHistory-1
    itfIAlarm := arritfAlarmsFromHistoryAll[i];
    itfAlarmClass := itfIAlarm.GetAlarmClass();
    END_FOR

    but itfAlarmClass is always 0 so I can't use itfIAlarm.GetAlarmClass().GetName() method

    The rest of Alarm elements like timestamps, message, latchvalues, etc. have proper values.

    Same behavior I see in simulation AlarmManager examle app from Codesys Store and in real environment with Wago PFC200 controller.
    Maybe someone knows where is the problem and how to read proper itfAlarmClass value ?

    Regards
    Marek

     
  • talhaali - 2024-06-06

    Hi, I am trying to access active alarms in code(As alarm count variable updates only when we go to to alarm table frame in visualization). I wrote following code but it is not working:

    VAR
    iCountActiveAlarms : INT;
    parritfActiveAlarms : POINTER TO ARRAY[0..0] OF IAlarm;
    itfAlarmManagerClientAll : IAlarmManagerClient;
    END_VAR

    AlarmManager.g_AlarmHandler.GetActiveAlarms(
    itfAlarmManagerClient :=itfAlarmManagerClientAll,
    iCountActiveAlarms => iCountActiveAlarms,
    parritfActiveAlarms => parritfActiveAlarms);

    The Value is always 0.
    Please help.

     
  • talhaali - 2024-06-06

    Hi, I am trying to access active alarms in code(As alarm count variable updates only when we go to to alarm table frame in visualization). I wrote following code but it is not working:

    VAR
    iCountActiveAlarms : INT;
    parritfActiveAlarms : POINTER TO ARRAY[0..0] OF IAlarm;
    itfAlarmManagerClientAll : IAlarmManagerClient;
    END_VAR

    AlarmManager.g_AlarmHandler.GetActiveAlarms(
    itfAlarmManagerClient :=itfAlarmManagerClientAll,
    iCountActiveAlarms => iCountActiveAlarms,
    parritfActiveAlarms => parritfActiveAlarms);

    The Value is always 0.
    Please help.

     
  • talhaali - 2024-06-06

    Hi, I am trying to access active alarms in code(As alarm count variable updates only when we go to to alarm table frame in visualization). I wrote following code but it is not working:

    VAR
    iCountActiveAlarms : INT;
    parritfActiveAlarms : POINTER TO ARRAY[0..0] OF IAlarm;
    itfAlarmManagerClientAll : IAlarmManagerClient;
    END_VAR

    AlarmManager.g_AlarmHandler.GetActiveAlarms(
    itfAlarmManagerClient :=itfAlarmManagerClientAll,
    iCountActiveAlarms => iCountActiveAlarms,
    parritfActiveAlarms => parritfActiveAlarms);

    The Value is always 0.
    Please help.

     

Log in to post a comment.