?What happens?
Variables declared as PERSISTENT variables in the global variable list (GVL) are reset to their initial value after downloading.
When does this behaviour occur?
Persistent variables must be declared in the global variable list "Persistent variables...". If variables with the PERSISTENT flag are locally declared in POUs or in other global variable lists, the instance paths of these variables must be entered into the GVL "Persistent variables...". For this, execute the Add all instance paths command in the "Declarations" menu.
Variables which are not accessed in the logic for writing and which were declared as PERSISTENT in the global variable list are reset to their initial value after mains switching/download although the instance paths of the variables were added to the GVL "Persistent variables...".
Which products are concerned?
PLC Designer V3.0 and higher
Short-term measures:
Declare persistent variables either in the global variable list "Persistent variables..." or locally in a POU.
As an alternative, the function restriction neither occurs if the variable is written to in the logic, e.g. with the logic <Variable>:=<Variable>;
The <Variable>; instruction and an exclusive read access to the variable in the logic are not enough.
Evaluation/recommendations:
Variables which are declared in the global variable list with the PERSISTENT flag are reset to their initial value after downloading or mains switching. A remedy for this function restriction is described under short-term measures.
This will not be corrected since we want to filter PersistantData which is not written to in the PLC cycle.