Between Merbon RT 2.2.0.5 and 2.4.0.11, there were significant changes in runtime memory organization and memory management on the FreeRTOS platform. Although upgrading is generally recommended and sometimes necessary for installation extensions or organizational reasons, project upgrades can affect the behavior of some runtime features. Let’s look at them so that we can proceed correctly when upgrading to version 2.4.0.11 or later.

First of all, it will be good to summarize how writing or reading from memory actually takes place during various changes of the runtime state.

The values of the variables are stored in the PLC in three places:

Image – a compiled program that contains default values as they were entered (or left) when creating the program. It is not automatically written to the image during runtime, it serves as a reference for a cold restart with default parameters.

Flash – permanent memory into which the backup of current variables is periodically written. In the event of a power failure, these variables are then used. The FLASH memory contains changes written by clients, ie setting of required values, time programs, etc., but only after the time for periodic backup of variables (Variables Backup, default period is 3 h) has elapsed or after going through a warm restart. It first backs up the entire contents of RAM/NVRAM (Retain) to FLASH, copies the program image to working memory, fills the RAM with a backup from FLASH, and then starts executing the (new) program. Therefore, during a warm restart, the default values of the variables from the image will not be used, but the backed-up variables restored from FLASH.

RAM/NVRAM – working memory. RAM is deleted after a power failure and after switching on it is filled with a backup from FLASH before starting the program. NVRAM or Retain holds values even after a power failure, and if a variable is declared as Retain, it does not recover from FLASH – the (newer) value in Retain takes precedence.

A cold restart is a return to the default variables that were loaded into the PLC when the program was loaded. All changes entered by clients during program run are lost. It is worth noting the difference between cold restart and power failure behavior: a power failure preserves the values set by clients (if they were declared as Retain or managed to write to FLASH), while a cold restart runs a program with default (“safe”) values from the uploaded project.

We remind you that if we want to back up the current values to the project in Merbon IDE incl. changes entered by clients, mark the variables (even in bulk) in the Variable Browser and select Set as default in the context menu. This operation copies the current values from the PLC to the Merbon IDE source code. After editing the program and compiling, these values will appear as default, they will be part of the image and will be written to the PLC when the program is loaded. After a cold restart, they are then copied to the working memory and the program uses them as the initial one. The settings of the required values and time programs will be retained even after editing the program and playing it.

Now to the runtime behavior when switching between versions:

Transition from V 2.2.0.5 or from 2.3.0.11 to V 2.4.0.11 – FreeRTOS:

Network configuration (IP address setting, etc.)      The network configuration is retained
Project Project is retained
Variables in Flash memory Variables are not retained
Variables in Retain memory      Variables are retained
Web      The website will be deleted and the old look of the website is not supported on the new version, it is necessary to re-create the website with an internal editor

Variables in the Flash memory will be lost – setpoints, time programs, etc. Before the transition, it is therefore necessary to load the variables from the PLC and update the default variables in the project (Set as default).

Due to a change in the format of the web pages on the web server, the old web project is not compatible with the new web site. The website must be recreated in the internal HMI editor in the Merbon IDE. Only text menus can be imported from the old version, not graphic panels.

Transition from V 2.2.0.5 or from 2.3.0.11 to V 2.4.0.11 – Linux:

Network configuration (IP address setting, etc.)      The network configuration is retained
Project Project is retained
Variables in Flash memory Variables are retained
Variables in Retain memory      Variables are retained
Web      The web is retained, but cannot be edited in the new IDE. You must use an external editor or re-create the site with an internal editor for changes

The above memory problems do not occur with controllers with the Linux OS, after the project upgrade it is possible to work with the new project as before.

The exported web panels are compatible with the new web server, but for change requests you must use an external web editor from the old version – or re-create the entire web in the new version, similar to FreeRTOS platforms.