====== 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. ===== Selection of variables ===== Make sure the PLC is connected (Debug) before the retrieve process starts. Then right click the PLC and select Retrieve Variables. {{:en:mervis-ide:35-help:save_variable.png}} 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. {{:en:mervis-ide:35-help:set_the_initial_value.png}} 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.  {{:en:mervis-ide:35-help:dialog_create_init_value.png}} Check the new updated default values in the Initial value column. {{:en:mervis-ide:35-help:inital_value.png}} Local variables can not have the initial value written! ===== Backing up variables to flash ===== 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.