Persistent Retain Variables Not Visible in Online View (PFC100 + CODESYS)

Hi everyone,

I’m working on a WAGO PFC100 with CODESYS. During development everything worked fine, but in the final stage I set several variables to PERSISTENT RETAIN.

When I go online, most of these persistent variables cannot be monitored. Instead, I see:

<Value of the expression cannot be retrieved>

Interestingly, a few variables do show their values correctly, but the majority do not.

  • The variables are not used as pointers or in any unusual way.

  • The application compiles and runs without errors.

Has anyone experienced this before? Is this a known issue with PFC100 or CODESYS? Any ideas on what could cause this behavior?

Thanks in advance!
Jasper

After changing your declaration to VAR PERSISTENT RETAIN, did you also add a Persistent Variables object to your project as step 2? And then step 3 is to open that object in a tab, right-click, and select “Add all Instance Paths”?

1 Like

Yes, I did. I also tested the persistent variables with a power cycle, and they work as expected. The issue is that I cannot monitor these variables in the online view, which is important for debugging purposes.

I contacted WAGO support, and they confirmed this is a CODESYS bug. Whenever a persistent 64-bit variable is monitored on a 32-bit controller, the online list cannot display the values correctly.

The solution is either:

  • Avoid monitoring any 64-bit persistent variables, or

  • Change them to 32-bit or smaller types.

Important to note: the variables do hold their correct 64-bit values in the PLC. The issue is only with how CODESYS displays them.

1 Like