The IEC 61131-3 defines a statistical variable model. In the program, you must plan for the required variables and in particular for the dimensioning of arrays for a potential maximum expansion of the program. The run time can no longer be changed.
The PacDrive system was therefore extended by a dynamic memory management function. Using the PLC configuration, the parameter DynIECDataSize can be used to reserve a portion of the working area as dynamic memory area for the program. The reserved area is exclusively available for the program.
You must allow for the correct reservation, usage, and release at program runtime. If the program is reset, the system performs the release of the reserved memory areas automatically. The entire memory area becomes available after a restart.
The DynIECData function is complex, and the incorrect use of dynamic memory management can result in errors that are difficult to diagnose. Further, such errors can lead to system anomalies that may effect the operation of your machine.
WARNING | |
---|---|
To make your program more readable and to be more efficient at debugging any errors that arise with the use of this function, add the suffix _DYN to the variable name of the pointer to dynamic memory.