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!