AC800M cold retain
I have a PM864 with a compact flash card. I'm trying to make a function operable from a push button on a HMI, so that if the function is turned on via the HMI, it turns on again after a power failure.
The logic I've written is:
HMI pushbuttons active the set and reset inputs on an SR block. The ouput of the SR block is a bool global variable.
In the global variables, i've given the SR output a coldretain attribute. In order to force the cold retain values to save, I've used a SaveColdRetain function block that is activated when a certain input is activated.
Every time this SaveColdRetain block activates, the status changes to a "1", however the "Done" output does not appear to turn on. So I'm not sure if it is actually working.
Everytime I've turned off power to the AC800, the global variable defaults back to false, instead of staying true as I want it to.
I'm not sure what I've missed, and the help inside compact control builder doesn't tell me much either.
Any help would be greatly appreciated.
Voted best answer
I think that happens because at power on RS block is executed and it writes 0 to it's output (I beleive a push button ON is false at that stage, and it is not a toggle button).
I can advice for a following solutions:
- use a toggle button from HMI, make it's variable coldretain in your application and use it directly as a memory, without need of RS block
- put move with EN function on the output of your RS block. EN for the move function will be active only when ON or OFF push buttons are active = move block will write only when there is push buttons action. Out of move block declare as a coldretain variable, so it will keep it's value during power fail. See example below: