Hi,
on the ctrlX CORE there is only one physical NVRAM (Non Volatile RAM) available. For X3 the size is 128 kB, for X5/X7 it is 2 MB. Because of administration issues of the ctrlX operating system, not all the size is available for the applications running on the ctrlX CORE. Each app is allowed to reserve NVRAM to handle its application(s). So does the PLC app, too.
Using the dialogue in the PLC Web UI you can reserve NVRAM for the PLC app. We defined values up to 118000 for X3 and 2000000 for X7. Please notice, that setting these values can fail, if other apps have already reserved memory for their applications. That's why the default values are lower than the maximum ones.
When creating a PLC project, the user is able to define one or multiple applications. Each application defines splitted memory areas (area 0, area 1, area 2 and area 3). The individual content and it's calculated size can be seen in the window Messages when compiling the application.
Memory areas 0 and 3 are located in the RAM, area 1 and 3 must be located in the NVRAM. When downloading a PLC application the required memory size is allocated in the corresponding memory area. Please note: To handle memory descriptors and online changes an additional offset is allocated inside these areas based on the size, that was reckoned by compiling the project in ctrlX PLC Engineering. The defined value for area 0 and area 3 is 30% and for area 1 und area 2 it is 5%. Example: The reckoned size of an application for area 0 or area 3 is 10000 bytes. Then 13000 bytes are allocated. If the same value is required for retain data (area 1 ), then the allocated size is 10500 bytes. Additionally there are values for the minimum size of each area, too: The defined value for area 0 and area 3 is 64 kB and for area 1 und area 2 it is 256 Byte.
Doing online changes dues to the fact that there will be memory gaps inside the areas. If the memory area is so fragmented, that an online change is not possible any longer, the program must be cleaned, compiled and downloaded again.
If there are multiple PLC applications defined in the ctrlX PLC Engineering project under the same device, each of them has an area 0, area 1, area 2, area 3. So the setting of the right value depends on the number of the PLC applications, too.
Coming back to your questions:
1. To identify the right setting for the value in the dialogue
Compile all the PLC applications in your project that shall run on the same controller and sum up all the calculated sizes for the corresponding area 1 and area 2. This must be the minimum value.
2. The PLC application requires 590 bytes of retain data. This value is higher than the minimum size of 256 byte. The additional offset is 5% (30 byte). As a consequence 590 + 30 bytes, are allocated on the controller. I can't explain why 4 byte more are allocated. maybe it's the alogorithm. But that shouldn't matter. On the other hand the calculated memory for retain persistent data is lower than the minimum value of 256 bytes then 256 bytes are allocated.
I hope this answers your questions.
Kind regards
... View more