NVRAM

KAS uses the NVRAMClosed"Non-volatile random access memory" NVRAM is the general name used to describe any type of random access memory which does not lose its information when power is turned off. This is in contrast to the most common forms of random access memory today, which both require continual power in order to maintain their data. NVRAM is a subgroup of the more general class of non-volatile memory types, the difference being that NVRAM devices offer random access, like hard disks. The best-known form of NVRAM memory today is flash memory (non-volatile memory) to save Retain Variables.

Hardware Type NVRAM Size Allocation
Simulator 128 Kbytes
AKD PDMM or PCMM 32 Kbytes

Table 8-3: NVRAM Size Depending on Hardware


  • Part of the NVRAM allocation is reserved to store some internal data (144 bytes). As a consequence, not all the complete physical NVRAM is available for the retain variables.

If the size is big enough, KAS updates the non-volatile memory to store the retain variables values. This operation is performed in the background every 20 seconds. The frequency increases to every 2 seconds when the application is running, and when you shutdown the application.


  • Using the retain variables is highly cycle time consuming. As a consequence, Kollmorgen strongly recommends to carefully monitor the system load with the TraceTimes command.

How can I check the NVRAM space is enough to store my retain variables?

To calculate the NVRAM space, you have to add the size of each retained variable according to:

  • its data type as described here
  • the numbers of elements in case you declare the variable as an array

Do not forget to add the 144 bytes as stated in the Warning above.

In the following example, the total size is: 3684 bits (which is less than 0.5 Kbytes)

Variable Size / element Element no. Total Size / variable
bLedStatus 1 bit 4 4
MasterAbsPos 64 bits 1 64
MyString 800 bits (100 bytes) 3 2400
TravelSpeed 64 bits 1 64
Internal data 1152 bits (144 bytes) na 1152