Alarm Manager:

sarmin
2022-08-15
3 days ago
  • sarmin - 2022-08-15

    hi,

    i need to access the alarm history table to no avail. i copied the alarm manager sample code (example 4) partially to suit my application. it seemed to me that it only worked once at power startup. after that, the alarm history row count didnt even budge after introducing an alarm.

    any helps?


    Talk Topic about project #codesys-example/alarm-manager

     
  • sarmin - 2022-08-16

    hi,
    i have done more testings and found that the function is actually called everytime the alarm storage is modified which is correct, my test variable proved that. however the issue is at "getalarmsfromstorage", circled in red at the attachment, it is not reading the alarms storage correctly.

    even more so, at one point the code worked until power recycle, it was reading the alarms storage correctly and counting rows correctly until power recycle. it has never recovered since then and there was no code change, only clean all, build, rebuild and download to the hmi.

    any helps will be very much appreciated?

     
  • 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.