Appendix B. User Memory AllocationGFK-2222AD April 2018 305B-2 User Program Memory UsageSpace 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 Stores 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 theblock, 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 parameterin the block Properties.▪ The same rules apply for the size of %P memory, but %P memory can be used in any block in theprogram.▪ 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 theapplication if these variables fit in the size of the last-stored %L/%P tables (where the size includesthe 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 Stores.B-2.2 Program Logic and OverheadThe data area for C (.gefelf) blocks is considered part of the user program and counts against the userprogram size. Additional space is required for information internal to the CPU that is used for executionof 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 %Lreferences to %R, %W, %AI, or %AQ. Such changes require a recompilation of the programblock and a STOP Mode Store to the CPU.