Siemens SIMATIC S7-200 System Manual page 45

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

Advertisement

Special Memory: SM
The SM bits provide a means for communicating information between the CPU and your program.
You can use these bits to select and control some of the special functions of the S7-200 CPU,
such as: a bit that turns on for the first scan cycle, a bit that toggles at a fixed rate, or a bit that
shows the status of math or operational instructions. (For more information about the SM bits, see
Appendix D.) You can access the SM bits as bits, bytes, words, or double words:
Bit:
Byte, Word, or Double Word:
Local Memory Area: L
The S7-200 provides 64 bytes of local memory of which 60 can be used as scratchpad memory or
for passing formal parameters to subroutines.
Tip
If you are programming in either LAD or FBD, STEP 7--Micro/WIN reserves the last four bytes of
local memory for its own use.
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 allocates 64 bytes of L memory for the main program, 64 bytes for each subroutine
nesting level, and 64 bytes for interrupt routines.
The allocation of L memory for the main program cannot be accessed from subroutines or from
interrupt routines. A subroutine cannot access the L memory allocation of the main program, an
interrupt routine, or another subroutine. Likewise, an interrupt routine cannot access the L memory
allocation of the main program or of a subroutine.
The allocation of L memory is made by the S7-200 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 might reuse the same L
memory locations of a different subroutine or interrupt routine.
The L memory is not initialized by the S7-200 at the time of allocation and might contain any
value. When you pass formal parameters in a subroutine call, the values of the parameters being
passed are placed by the S7-200 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 might contain any value at the time of allocation.
Bit:
Byte, Word, or Double Word:
Analog Inputs: AI
The S7-200 converts an analog value (such as temperature or voltage) into a word-length (16-bit)
digital value. You access these values by the area identifier (AI), size of the data (W), and the
starting byte address. Since analog inputs are words and always start on even-number bytes
(such as 0, 2, or 4), you access them with even-number byte addresses (such as AIW0, AIW2, or
AIW4). Analog input values are read-only values.
Format:
SM[byte address].[bit address]
SM[size][starting byte address]
L[byte address].[bit address]
L[size] [starting byte address]
AIW[starting byte address]
PLC Concepts
Chapter 4
SM0.1
SMB86
L0.0
LB33
AIW4
31

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents