User Manual

PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
62 Manual, 03/2014, A5E02486774-AF
4.4.2
Addressing memory areas
STEP 7 facilitates symbolic programming. You create symbolic names or "tags" for the
addresses of the data, whether as PLC tags relating to memory addresses and I/O points or
as local variables used within a code block. To use these tags in your user program, simply
enter the tag name for the instruction parameter. For a better understanding of how the CPU
structures and addresses the memory areas, the following paragraphs explain the "absolute"
addressing that is referenced by the PLC tags. The CPU provides several options for storing
data during the execution of the user program:
Global memory: The CPU provides a variety of specialized memory areas, including
inputs (I), outputs (Q) and bit memory (M). This memory is accessible by all code blocks
without restriction.
Data block (DB): You can include DBs in your user program to store data for the code
blocks. The data stored persists when the execution of the associated code block comes
to an end. A "global" DB stores data that can be used by all code blocks, while an
instance DB stores data for a specific FB and is structured by the parameters for the FB.
Temp memory: Whenever a code block is called, the operating system of the CPU
allocates the temporary, or local, memory (L) to be used during the execution of the
block. When the execution of the code block finishes, the CPU reallocates the local
memory for the execution of other code blocks.
Each different memory location has a unique address. Your user program uses these
addresses to access the information in the memory location.
References to the input (I) or output (Q) memory areas, such as I0.3 or Q1.7, access the
process image. To immediately access the physical input or output, append the reference
with ":P" (such as I0.3:P, Q1.7:P, or "Stop:P").
Forcing applies a fixed value to a physical input (Ix.y:P) or a physical output (Qx.y:P) only.
To force an input or output, append a ":P" to the PLC tag or the address. For more
information, see "Forcing variables in the CPU" (Page 261).
Table 4- 4 Memory areas
Memory area
Description
Force
Retentive
I
Process image input
I_:P
1
(Physical input)
Copied from physical inputs at the beginning of the scan
cycle
No No
Immediate read of the physical input points on the CPU,
SB, and SM
Yes No
Q
Process image output
Q_:P
1
(Physical output)
Copied to physical outputs at the beginning of the scan
cycle
No No
Immediate write to the physical output points on the
CPU, SB, and SM
Yes No
M
Bit memory
Control and data memory No Yes
(optional)
L
Temp memory
Temporary data for a block local to that block No No
DB
Data block
Data memory and also parameter memory for FBs No Yes
(optional)
1
To immediately access (or to force) the physical inputs and physical outputs, append a ":P" to the address or tag (such
as I0.3:P, Q1.7:P, or "Stop:P").