Check memory for active application command
Function: The command starts a check of the memory area of the active application. The memory is subjected to various checks. The results are displayed in the message window.
Call: PLC > Window menu
Requirement: At least one application is loaded and in online mode.
The memory area of the active application is checked for the following:
- BOOL variables have defined values.
- STRING and WSTRING variables are terminated.
- Enumeration variables have valid values.
- Variables of a sub-area type have valid values.
- Variables of a constant block type (STRUCT, ARRAY etc.) are unchanged compared to their initialization values.
- Function pointer addresses are internally consistent.
- Function pointers in the project point to a memory managed by TwinCAT 3 PLC. Function pointers to library blocks or external blocks are excluded; these can be stored in external memory.
- Pointers to a type point to memory locations of this type.
- Pointers point to memory locations whose address is aligned to the type granularity, or is 0 or -1.
- Interface variables and function table pointers are internally consistent.
- The code of compiled blocks is unchanged.
Note: Compiled blocks with breakpoints are excluded from the check because the code for these is manipulated at runtime.
The results of the check are displayed in the message window. Violations of the check criteria appear as warnings.
If you double-click on a warning, the Memory view appears with the relevant position is highlighted in orange. The Memory view can also be opened with Show Memory View command.
The check can be restricted using the 'memory_check' attribute.