Memory Diagnosis

The function block “Memory Diagnosis” is used to supervise the memory with the “Dynamic Texts”. Its outputs provide LONG values with the total size of the memory ("memsize") and the number of used bytes ("used"). Gaps arise during the runtime when the length of some “Dynamic Texts” changes. The total size of these unused sections between used ones is written to the output "fragment". This value indicates the degree of the memory fragmentation.

A HIGH signal at the input “garbcol” starts the defragmentation. In that process the memory sections with the texts are moved one after another so that no gaps remain. Problems with the memory allocation for more or longer “Dynamic Texts” can be solved by this operation. However the runtime costs can be high. It depends on the number of texts and the degree of the fragmentation.

More information about the memory architecture of the “Dynamic Texts” and the usage of the diagnosis function block can be found in the chapter "Overview".

Signals

Name I/O Type(s) Function
garbcol I BIT Starts the defragmentation
memsize O LONG Size of DYNTEXTRAM (in bytes)
used O LONG Size of used memory (in bytes)
fragmnt O LONG Sum of the memory gaps (in bytes)