Function Blocks Using Dynamic Memory Allocation

Overview

The function blocks FB_SamplingDataAsynchron and FB_SamplingDataRealTime allocate memory for the arrays of data sampled from the drives. To achieve this, activate the option Use dynamic memory allocation in the View > Properties... > Application Build Options tab in EcoStruxure Machine Expert. Enter the Maximum size of memory (bytes) you want to reserve for the application.

For further information, refer to the Menu Commands Online Help.

NOTE:

The maximum admissible value for the parameter Maximum size of memory (bytes) depends on the controller you are using, on the size of the present application and on other functionalities using this function. If there is not enough memory available, a diagnostic message is issued.

As long as the function blocks are disabled, memory is released and can be used elsewhere.

Calculating the Memory Size

You can calculate the memory according to this example:

  • Number of samples = 1000

  • Number of channels = 4

  • Datatype = LREAL (= 8 bytes)

The size of memory required for 1000 samples equals:

1000 x 4 x 8 = 32,000 bytes