# WAGO CC100 Persistent Variables Codesys 3.5 Troubles

**URL:** <https://www.wago.community/t/wago-cc100-persistent-variables-codesys-3-5-troubles/1745>\
**Category:** CODESYS\
**Created:** [April 8, 2025, 2:54pm UTC](https://www.wago.community/t/wago-cc100-persistent-variables-codesys-3-5-troubles/1745 "2025-04-08T14:54:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssavov](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@ssavov](https://www.wago.community/u/ssavov)\
**Post date:** [April 8, 2025, 2:54pm UTC](https://www.wago.community/t/wago-cc100-persistent-variables-codesys-3-5-troubles/1745/1 "2025-04-08T14:54:33Z")

</div>

Hi everyone,

I’ve been struggling the whole day trying to get _persistent variables_ to work properly on a **WAGO CC100** controller using **CODESYS 3.5** , but without success.

After rebooting or power-cycling the controller, all values of my variables marked with `PERSISTENT` or `RETAIN` are lost.

This is in my GVL variables:  
VAR\_GLOBAL RETAIN PERSISTENT  
Power\_Cmd: REAL := 100;  
END\_VAR

And this is in my GVL.PERSISTENT section:  
{attribute ‘qualified\_only’}  
VAR\_GLOBAL PERSISTENT RETAIN  
GVL.Power\_Cmd: REAL;  
END\_VAR

I am using this variable in my main task:  
IF TO\_WORD(GVL.Power\_Cmd) \<\> GVL.SetLoggerActivePower THEN  
GVL.SetLoggerActivePower := TO\_WORD(GVL.Power\_Cmd);  
END\_IF;

Those are the last changes.

Am I missing something specific for the WAGO CC100 hardware or its runtime configuration?  
Is there a working method or configuration to reliably store persistent variables on this controller?

Any help, advice, or working example would be greatly appreciated. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![AdamReeve](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/adamreeve/32/59_2.png) [@AdamReeve](https://www.wago.community/u/AdamReeve)\
**Post date:** [April 8, 2025, 3:27pm UTC](https://www.wago.community/t/wago-cc100-persistent-variables-codesys-3-5-troubles/1745/2 "2025-04-08T15:27:53Z")

</div>

It’s unclear what you mean by your “GVL.PERSISTENT section”. Did you add a PersisentVars object to your project, and then use the right-click menu to Add All Instance Paths? That is generally the best way to define persistent variables.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/e/e7f539a8cfb5643d14c0d236b2382fa111352c7f.png)

(Once created, you don’t need to reference the PersistentVars object in your POUs, just keep it updated as you add new variables. You have done it correctly with the GVL.Power\_Cmd reference.)

---

<div class="post-metadata">

**Author:** ![ssavov](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@ssavov](https://www.wago.community/u/ssavov)\
**Post date:** [April 8, 2025, 4:28pm UTC](https://www.wago.community/t/wago-cc100-persistent-variables-codesys-3-5-troubles/1745/3 "2025-04-08T16:28:28Z")

</div>

This was exactly what I did.  
Will try again tomorrow.

Thanks!
