Dear Community User! We are updating our platform to a new system.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 

Offline Check of Retain or Persistent Memory

Offline Check of Retain or Persistent Memory

DCEN_Tony
Established Member

Hello,

I have seen the several existing topics on PLC retain/persistent memory.  I am trying to clarify the following:

1. How to check total Retain only and Persistent data is within limits whilst developing application offline (before having hardware to check memory usage).  I understand the configurable PLC Persistent/retain limit on the core to be maximum 115(118)kB for both Persistent and Retain data.  However the application compiles OK when having 115kB PERSISTENT RETAIN and 115kB RETAIN only (e.g. 230kB in total).  I assume when you download application to the core you will then get an out of memory error.  Is there anyway to check total retain only and persistent will be within hardware limits in your offline PLC project?

DCEN_Tony_0-1728979632340.png

2. A colleague has asked for support on similar topic... With project below if only 624 bytes of retain data are used why is this shown as nearly 95% (5% spare space)?  Similarly with the persistent data if onlt 256 bytes then why does this take so much memory (37% (63% spare))?

DCEN_Tony_1-1728979975608.png

Many Thanks

 

1 REPLY 1

georkueh
Community Moderator
Community Moderator

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.

georkueh_0-1729839135761.png

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 

georkueh_0-1729847443863.png

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

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist