View Full Version : Codesys/Wago - Retain/ Persistent Variables

March 22nd, 2012, 11:22 AM
A couple questions regarding retentive and persistent variables in Codesys v2.3 using the wago 750-841. Cannot seem to find any information in the manual or online.

When I declare var_global retain persistent and give it a preset value like :=4, and I change it in online mode, the value is saved when I'm logged in but not when i'm logged out.
Also, if I were to change the value offline, it will still show me the value that was changed online.

Where is this data stored in the plc and is there a way to access it through codesys? I need someone to explain how the whole retentive memory thing works.


(8{)} ( .)
March 22nd, 2012, 01:57 PM
Persistent variables don't retain their value when you reset the controller. You need to use RETAIN.

Good luck,

(8{)} (: .)

March 22nd, 2012, 01:59 PM
but they will if i use both wouldnt they?

April 2nd, 2012, 12:57 PM
persistent variables are rest when resetting the PLC and retain stay old value.
when cold resetting the retains are reset, and the persistent are not touched (like an hour meter when downloading new software (however the persistents will reset if you do a reset.
if you do a reset original all is reset.
see page 4-71 for this.