Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Alarm status in logic

KNewman
2016-08-09
2019-04-28
  • KNewman - 2016-08-09

    How can I get the status of an individual alarm back to my logic so that I can take action on it? I'm afraid I already know the answer to my question, which is "you can't". I've done a number of searches on this forum and all over the web and have never seen an example of someone doing this. I did download and try the "AlarmManager" example but from the results it seems to confirm that there is nothing to link an IAlarm instance back to the entry in the alarm group table other than possibly the position of the alarm within the group, or by parsing the alarm message--methods which are both clunky and fragile. Why isn't there simply another column to map the alarm state to a program variable? It appears that the entire alarm infrastructure in Codesys is mostly just a fancy interface for notification in the visualization, with no way to actually control machine behavior based on the individual alarms. I hope someone can prove otherwise to me.

     
  • Maximilian-K - 2016-09-19

    Did you ever find a solution to this? I am interested in this functionality as well. Currently I have to set up alarms in my logic and then again in my alarm manager.

    EDIT:
    After looking into it further it seems possible to search through all the active alarms and get the ID, name, etc. I'm thinking you could create your own data structure of all the alarms and make a function that will parse through the active alarm list and turn the corresponding variables true or false. You could then use these throughout your logic.

    Perhaps a more simple approach would be to monitor values in your logic, and trigger alarm variables in the code, then link these variables to the alarm manager table through discrete values.

    For example, instead of having OilTemp in the alarm table with a high limit observation, create a data structure of all the alarms, check for the alarm condition in your logic and if it is true, set the variable Alarm.HighOilTemp to true. Within the alarm manager you would just monitor the variable Alarm.HighOilTemp to go true and you can still use it's state throughout the code.

     
  • KNewman - 2017-01-11

    No, unfortunately I didn't find a solution. I ended up just solving the alarms in logic and then using the alarm manager as just an annunciator. It's too bad, because it has so much great functionality; they just missed the ability to map the alarm status to a variable.

     
  • bizer - 2019-04-27

    Hi,
    any news on this topic? As far as I see, there are no new approches?

     
  • bizer - 2019-04-28

    Thanks, that's exactly what i was looking for. Perfect.

     

Log in to post a comment.