EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers.

Persistent Variables

Overview

This object is a global variable list (GVL), which only contains persistent variables of an application. Thus it has to be assigned to an application. For this purpose, it has to be inserted in the Applications tree via selecting the respective node, clicking the green plus button, and selecting Add Other Objects > Persistent Variables....

Only those variables which are declared with VAR PERSISTENT and which are contained in this list are persistent. The Add all Instance Paths command adds all PERSISTENT declarations found in other POUs to the list.

Variables declared with VAR PERSISTENT are also retain variables. Retain variables have the capacity to keep their values after executing a Reset warm command. The difference is, that persistent variables are only reinitialized upon executing the Reset origin command or by a new application download (after the application had been removed from the controller). An exception is made if you modified their names or data types.

Persistent variable list

G-SE-0027220.3.gif-high.gif

 

 

For further information, refer to the description of remanent variables.

Also refer to the description of the special commands for handling persistent variables.

Edit a persistent variable list in the persistence editor, which corresponds to the GVL editor. The VAR_GLOBAL PERSISTENT RETAIN is already preset in the first line.

Adding and Declaring Remanent Variables

When you add variables to an application, you can declare some of the variables as remanent variables. Remanent variables can retain their values in the event of power outages, reboots, resets, and application program downloads. There are multiple types of remanent variables, declared individually as retain or persistent, or in combination as retain-persistent.

Consult the Programming Guide specific to your controller for information on the memory size reserved for retain and persistent variables in the different controllers.

To add a global variable list called Persistent Variables to your application, proceed as follows:

Step

Action

1

Select the respective application node in the Applications tree, click the green plus button, and select Add Other Objects > Persistent Variables....

Alternatively, you can right-click the application node, and execute the command Add Object > Persistent Variables....

2

In the Add Persistent Variables dialog box type a name for this list in the Name text box.

3

Click Add.

Result: A persistent variable node is created in the Applications tree. For an example, refer to the Overview paragraph in this chapter.