I have an application written with SFC in Codesys 2.3.
The SFC is declared as retain and restarts after a power up event at the exact step it was before a power off event, as it should, in my case.
My problem is, I want to detect the power up event, in order to react according to the duration of the power off situation (I should act differently if the power shortage was 1, 10 seconds, 1 hour or 1 day...).
I could store the actual time during every cycle and compare it with the current time.
Is there a system variable which is activated ( or set to TRUE ) just after a power up? This could be used to trigger a time check procedure.
I use a Wago 750-873 CPU.
Thank you for any help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found a solution by writing a small non-persistent SFC. It may have just 2 steps:
init and step_1
init runs just once and do the required operations (at startup)
then the sfc steps to step 1 (Transition is always TRUE) and stays there forever ( or as long as the power is on)
in step_1 I may store the actual timestamp, which I can test in init, in order to estimate the duration of the poweroff situation
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
I have an application written with SFC in Codesys 2.3.
The SFC is declared as retain and restarts after a power up event at the exact step it was before a power off event, as it should, in my case.
My problem is, I want to detect the power up event, in order to react according to the duration of the power off situation (I should act differently if the power shortage was 1, 10 seconds, 1 hour or 1 day...).
I could store the actual time during every cycle and compare it with the current time.
Is there a system variable which is activated ( or set to TRUE ) just after a power up? This could be used to trigger a time check procedure.
I use a Wago 750-873 CPU.
Thank you for any help
I found a solution by writing a small non-persistent SFC. It may have just 2 steps:
init and step_1
init runs just once and do the required operations (at startup)
then the sfc steps to step 1 (Transition is always TRUE) and stays there forever ( or as long as the power is on)
in step_1 I may store the actual timestamp, which I can test in init, in order to estimate the duration of the poweroff situation
good solution, run this SFC only once a second in resources tasks.
thank you for the information about the sfc scheduling.
regards