Siemens SIMATIC S7 System Manual page 80

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

PLC concepts
4.2 Accessing data
L (local memory area)
The CPU provides 64 L memory bytes for each POU (program organizational unit) in a local
memory stack. A POU's associated L memory addresses are accessible only by the
currently executing POU (main, subroutine, or interrupt routine). When you use interrupt
routines and subroutines, the L memory stack is used to preserve L memory values of a
POU that temporarily suspends execution, so another POU can execute. The suspended
POU can then resume execution with the L memory values that existed prior to giving
execution control to another POU.
L memory stack maximum nesting limits:
● Eight subroutine nesting levels when initiated from the main program
● Four subroutine nesting levels when initiated from an interrupt routine
The nesting limits allow a 14 level execution stack in your program. For example, the main
program (level 1) has eight nested subroutines (levels 2 to 9). During execution of the 9th
level subroutine, an interrupt occurs (level 10). The interrupt routine contains four nested
subroutines (levels 11 to 14).
L memory rules:
● You can use L memory for local scratchpad "TEMP" variables in all POU types (main,
subroutine, and interrupt routines)
● Only subroutines can use L memory for "IN" IN_OUT", and "OUT" variable types that are
passed to or from subroutines.
● If you are programming a subroutine in either LAD or FBD, only 60 bytes are allowed for
TEMP, IN, IN_OUT, and OUT variables. STEP 7-Micro/WIN SMART uses the last four
bytes of local memory
Local memory symbols, variable types, and data types are assigned in the Variable table
that is available when the associated POU is opened in the program editor. Absolute L
memory addresses are automatically assigned when a POU is successfully compiled.
In most cases, use L memory symbol name references in your program logic, because you
cannot know all the absolute L memory addresses until after the complete POU is
successfully compiled. However, you can use absolute L memory addresses as shown in the
following table.
Table 4- 13
Bit:
Byte, Word, or Double Word:
Local memory and to global V memory use a similar address syntax, but V memory has a
global scope while L memory has a local scope. Global scope means that the same memory
address can be accessed from any POU. Local scope means that the L memory allocation is
associated with a particular POU and cannot be accessed by another program unit.
80
Absolute addressing of L memory
[byte address].[bit address]
L
[size] [starting byte address]
L
System Manual, V2.3, 07/2017, A5E03822230-AF
L0.0
LB33, LW5,
LD20
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents