Calling subprogram on programmed alarm
[Siemens 840D]
There is an, by the manufacturer programmed, alarm that activates on a specific trigger. If the trigger is gone the machine moves according the program but the alarm message stays visible on the HMI.
On this specific event I want to trigger a subprogram to write $AC_PARAM variables to a file so the values in these variables does not get lost after the necessary reset before we can start again.
I modified the PLC so that there is an $A_DBD variable that gets assigned a value when the alarm is triggered. I use this variable to check for the alarm and to check functionality I have written a value to an R parameter when the variable changes. However, if I replace the R parameter for a subprogram the machine does nog execute this subprogram and says it's not possible.
Is there a different approach to solve this?