RETAIN VALUES - AC500
I'm new to AC500, i want to retain values so that when i power down & power up the PLC, the values are retained & start from where it ended during last power down.
Suppose in Codesys, in a counter i want the Count Value (CV) to start from where it was during power down. Next day i power up my PLC(PM573-ETH), the count value(CV) should start from where it ended a day before.
While declaring variable for CV i tick marked RETAIN, but still during power up & down the value is not being retained & is getting reset during next power up. I have TA521 battery installed.
I hope someone can help me out with this.
You can declare retain variables either in PLC_PRG as local or as global declaration
I cant remember retain global or normal global area limitations.
->For global retain you can declare as this
Enter global variables then
Under var global
You declare and write as above
Or in PLC_PRG or in other type PRG you build
Write and declare
I also find belowe document after a quick search. You can look page from 92 and solve your problem.
From that document i see that wheter declaring your variables retain or persistent, in Power Off/On conditon you have to plug battery if you want unchanging on data.