Skip to content

Are there any examples of alarm handling?

edited June 2021 in PLCnext Engineer
I understand how the various ALM function blocks work, but would like to know the best way to implement them into a project. For example, should I create a structure that contains elements that the function blocks use, then create an array of this structure? To register alarms, this array is fed into a loop with one instance of ALM_REGISTER. Is there an inherent mechanism for tracking active alarms and alarm history? The eHMI has no provision for this and it is expected to be handled in the PLC, but it isn't clear on how to do this. I am able to trigger, acknowledge, and reset alarms, but I have not been able to see a timestamp. Is that something I need to push into the structure(via programming), or should that be automatic?

Comments

  • Hi sparky,

    we do not have an example code, but a step by step how to use the functionblocks.
    Please check back the Alarms Section in our PLCnext Info Center.

    But your question is indeed interesting. I guess there is no general yes or no, it depends on your use case.

    If you are using static alarms (as I guess 80% of the users do) it makes sense to init them directly after the startup.
    This would have also the benefit that all Alarms are directly exposed to OPC UA, so the handling would be for the Client a bit more easier.

    Theoretically it is possible to register several alarms within on PLC cycle, so you could use a loop, but depending on other circumstances there might be an error of too many alarms were created during one cycle.
    So, at least you would have to check the result inside the loop.

    Personally I would use a small case structure for the init using one instance of the ALM_Register.

    Hope that helps, otherwise let me know.

    Take care,
    Frank
  • I don't understand the "per cycle" limitation of registering the alarms. If ALM_REGISTER is in a loop, and that loop doesn't do the next iteration until the Done output is TRUE, then there shouldn't be a problem, correct?
  • Hi Sparky,

    you are in correct, it is possible to init the alarms wirhin a loop.

    I'm refferencing to the Alamr Section in the PLCnext Info Center.
    Several alarms can be registered in the same PLC cycle. However, if the DONE output sends a FALSE signal, the registration can only be continued during the next cycle.

    So, you can use a loop, but in case a false is detected, you've to proceed in the next cycle.

    Have a great week,
    Frank
Sign In or Register to comment.