Are there any examples of alarm handling?
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
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
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.
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