Addressing The Local (L) Memory Area - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

CPU Memory: Data Types and Addressing Modes

Addressing the Local (L) Memory Area

The S7-200 PLCs provide 64 bytes of local (L) memory of which 60 can be used
as scratchpad memory or for passing formal parameters to subroutines. If you are
programming in either LAD or FBD, STEP 7-Micro/WIN 32 reserves the last four
bytes of local memory for its own use. If you program in STL,
L memory are accessible, but it is recommended that you do not use the last four
bytes of L memory.
Local memory is similar to V memory with one major exception. V memory has a
global scope while L memory has a local scope. The term global scope means that
the same memory location can be accessed from any program entity (main
program, subroutines, or interrupt routines). The term local scope means that the
memory allocation is associated with a particular program entity. The S7-200 PLCs
allocate 64 bytes of L for the main, 64 bytes for each subroutine nesting level, and
64 bytes for interrupt routines.
The allocation of L memory for the main cannot be accessed from subroutines or
from interrupt routines. A subroutine cannot access the L memory allocation of the
main, an interrupt routine, or another subroutine. Likewise, an interrupt routine
cannot access the L memory allocation of the main or of a subroutine.
The allocation of L memory is made by the S7-200 PLC on an as-needed basis.
This means that while the main portion of the program is being executed, the L
memory allocations for subroutines and interrupt routines do not exist. At the time
that an interrupt occurs or a subroutine is called, local memory is allocated as
required. The new allocation of L memory may reuse the same L memory locations
of a different subroutine or interrupt routine.
The L memory is not initialized by the PLC at the time of allocation and may
contain any value. When you pass formal parameters in a subroutine call, the
values of the parameters being passed are placed by the CPU in the appropriate
L memory locations of the called subroutine. L memory locations, which do not
receive a value as a result of the formal parameter passing step, will not be
initialized and may contain any value at the time of allocation.
You can access L memory as bits, bytes, words or double words. You can use
L memory as a pointer for indirect addressing but you cannot indirectly address
L memory.
Format:
Bit
Byte, Word, Double Word
5-6
L [byte address].[bit address]
L [size] [starting byte address] LB33
S7-200 Programmable Controller System Manual
all 64 bytes of
L0.0
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents