Object ‘Persistent Variable List’

Symbol:

This object is for the management of persistent variables.

The persistence editor automatically manages the order of the persistent variables. It allows the addition and deletion of persistent variables without loss of data - independent of their position in the declaration:

If the user deletes a variable from the declaration, CODESYS automatically replaces the variable by an invisible placeholder variable in the process image. This placeholder has the same size as the deleted variable and thus guarantees that the following variables retain their addresses. If you add a new variable at any position, this is appended to the process image at the end, so that existing variables also retain their addresses. The changing of variables (name or data type) is treated like a deletion and a new creation and thus creates a gap or a new entry at the end of the process image (not in the declaration). The addition of variables from programs or function block instances using the command Add all instance paths takes place in the same way. The persistence editor also offers commands for the determination of the number of gaps, for cleaning these gaps and for backing up and restoring the persistent values with the help of recipes.

Hint

Before deciding which way you want to set up persistence for an application, you should be familiar with the application case (see chapter Data persistence) and the mechanism of the VAR PERSISTENT declaration (see chapter Remanent variables - RETAIN, PERSISTENT).

Hint

There can only be one persistent variable list per application and CODESYS treats the variables declared as PERSISTENT in this list as persistent. If you have created VAR PERSISTENT declarations in POUs, you can add them to the list with the menu command Declarations ‣ Add all instance paths . Global PERSISTENT declarations in other modules are not permitted.

See also