Variables backup

Saving of current values of variables from a PLC to default values in program is useful if a PLC has to be replaced and values set by operator in the course of time shall be used as default values for the new deployment. The values concerned are mostly time schedulers, heating curves, setpoints, etc.

Mass operations with variables, such as setting as default value, ading into variable collection, or displaying values in the Variable browser, can be done with the Retrieve variables with Wizard function in the PLC context menu.  

In the dialogue window select one of the following::

  • Make initial values – sets current variable values as default values in the program source code
  • Add to variables collection – inserts all variables into a variable collection
  • Write to Variable browser – displays current values for all variables

Make sure the PLC is connected (Debug) before the retrieve process starts. Then right click the PLC and select Retrieve Variables.

Check the “Variables successfully retrieved” message in the lower left corner.

Focus the variable values which should be written into default values, right click the selection, and select Make initial value.

In the Make initial value dialog select the PLC project to write to. The Set initial value when equals to default value checkbox writes the value if the PLC value is e.g. 0, and the default variable would have no initial value declared. 

Check the new updated default values in the Initial value column.

Local variables can not have the initial value written!

By default, variables are stored in flash memory every 3 hours. You can change this setting in the PLC properties “Backing up variables”.

  • Enabled - Permission for Flash memory Periodic storage enabled - Permission for regular flash memory storage
  • Period - The time period flash memory storage
  • Trigger variable - When leading edge is generated on variables (data type - bool) Instant Flash Save

If storage space is exceeded variables to flash memory when the report is compiled, a warning message appears in the results; and k backing up variables to Flash will not occur.

On a Linux PLC (markMX, mark320, mark220, wPLC750-8101 and wPLC750-8102) are used to save variables in Flash memory 256 kB, which corresponds to, for example, 400 variables with a data type string. On PLC with FreeRTOS operating system (mark100, mark100v2, mark120, mark125, mark150, mark150 / 485, mark150 / 485s, IMIO100, IMIO105, IMIO110, ICIO200 and ICIO205) is reserved for storing in FLASH memory 103.4 kB, which corresponds, for example, to 200 variables with a data type string.

After exceeding the reserved space for saving variables to FLASH memory after compiling is results in an error stating that the reserved space has been exceeded. For successful compilation must be turned off in the PLC properties variable backup. Storing RETAIN variables does not change.

  • © Energocentrum Plus, s.r.o. 2017 - 2024