Memory Management

The Condition Monitoring library internally uses TcCOM objects provided by the installed drivers. These are created dynamically using the TwinCAT AMS router memory.

Necessity for dynamic memory management

All memory requests and initializations are accomplished during the initialization phase. Since the number of elements of the input data and the internal structures depend on the configuration of the respective function blocks, the memory space for them is allocated dynamically as a matter of principle. This is done automatically by using the PLC Condition Monitoring Library.

Since all memory assignments take place during the initialization and the initialization of function blocks may therefore take up a relatively large quantity of memory, it can also fail at this point – but not later – due to a lack of memory space.
The allocated memory is released again once the object is deleted.


TwinCAT router memory for dynamically created objects

The buffers reserved by the TwinCAT 3 Condition Monitoring Library are created during the initialization of function blocks in the TwinCAT AMS router memory, so that they are available for execution under real-time conditions. Certain functions, such as high-resolution histograms and quantiles as well as the calculation of spectra with very high resolutions, require considerably more router memory than conventional control programs. Therefore it may be necessary to increase the size of the router memory.

Adapting the router memory

The standard size is 32 MB (2 MB up to TwinCAT 3.1.4016). The current setting can be displayed with the AMS Router Information dialog box.

Memory Management 1:

To increase the router memory capacity, a value in MB is entered in the TwinCAT configuration under System\ Real-Time\ Settings and the configuration is activated.

Up to TwinCAT 3.1.4022.4, a reboot of the target device was required for adaptation of the router memory.

Memory Management 2: