When attempting to Download or Code Generate my PLC Application in SoMachine Logic Builder, the build message "C0106: Out of global data memory" appears in the Messages zone.
SoMachine v3.0, SoMachine v3.1, SoMachine v4.1, SoMachine v4.2, SoMachine v4.3
M238, M241, M251, M258, LMC058, XBTGC, HMISCU, XBTGT w/ Control, XBTGK w/ Control
SoMachine Logic Builder, Windows 7, Windows 10
The build message "C0106: Out of global data memory" is caused by the application having more variables used in the Persistent Retain memory than there is physical memory on the PLC.
Reduce the number of variables declared in the PersistentVars Application object or declared as "VAR_GLOBAL PERSISTENT RETAIN" in the Global Variable List (GVL) node.
Do this incrementally and go to the Build menu and perform the following actions in sequence:
- Generate Code
After each Generate Code, check the Message list to see if the C0106 message has disappeared.
If so, one can see the used memory in the message list in the form of "Memory area 5 contains Persistent Data:…"
For example in Screenshot 2
is the maximum for the HMISCU PLC - of which 46%
Watch for ARRAYs, DUT (structures) and combinations of the two (ARRAYs of DUTs), which can increase the defined memory usage multiplicatively.
To see how many bytes the PLC has allocated to the Persistent Retain Variables area, go to the SoMachine Online Help [PLC type section] -> Programming Guide -> Memory Mapping