Appendix B. User Memory Allocation
GFK-2222AD
April 2018
305
B-2
User Program Memory Usage
Space required for user logic includes the following items.
B-2.1
%L and %P Program Memory
%L and %P are charged against your user space and sized depending on their use in your applications.
The maximum size of %L or %P is 8192 words per block.
The %L and %P tables are sized to allow extra space for
RUN Mode Store
s per the following rules.
▪
If %L memory is not used in the block, the %L memory size is 0 bytes. If %L memory is used in the
block, a buffer is added beyond the highest %L address actually used in logic or in the variable table.
The default buffer size is 256 bytes, but can be changed by editing the Extra Local Words parameter
in the block Properties.
▪
The same rules apply for the size of %P memory, but %P memory can be used in any block in the
program.
▪
The buffer cannot make the %P or %L table exceed the maximum size of 8,192 words. In such a case,
a smaller buffer is used.
▪
You can add, change, or delete %L and/or %P variables in your application and
RUN Mode Store
the
application if these variables fit in the size of the last-stored %L/%P tables (where the
size
includes
the previous buffer space), or if going from a zero to non-zero size.
▪
The size of the %L/%P tables is always recalculated for
STOP Mode Store
s.
B-2.2
Program Logic and Overhead
The data area for C (.gefelf) blocks is considered part of the user program and counts against the user
program size. Additional space is required for information internal to the CPU that is used for execution
of the C block.
The program block is based on overhead for the block itself plus the logic and register data being used
(that is, %L).
Note:
The program stack of the LD
is not counted against the CPU’s memory size.
Note:
If your application needs more space for LD logic, consider changing some %P or %L
references to %R, %W, %AI, or %AQ. Such changes require a recompilation of the program
block and a
STOP Mode Store
to the CPU.