PLCS.net - Interactive Q & A

PLCS.net - Interactive Q & A (http://www.plctalk.net/qanda/index.php)
-   LIVE PLC Questions And Answers (http://www.plctalk.net/qanda/forumdisplay.php?f=2)
-   -   Codesys/Wago - Retain/ Persistent Variables (http://www.plctalk.net/qanda/showthread.php?t=70387)

electro89 March 22nd, 2012 11:22 AM

Codesys/Wago - Retain/ Persistent Variables
 
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.

thanks
Martino

(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{)} (: .)
(Yosi)

electro89 March 22nd, 2012 01:59 PM

but they will if i use both wouldnt they?

shooter 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.
.


All times are GMT -5. The time now is 12:52 PM.

.