97BPLC concepts
4.2 Data storage, memory areas, I/O and addressing
S7-1200 Programmable controller
84
System Manual, 11/2011, A5E02486680-05
Table 4- 13 Absolute addressing for M memory
Bit
M[byte address].[bit address]
M26.7
Byte, Word, or Double Word
M[size][starting byte address]
MB20, MW30, MD50
Temp (temporary memory): The CPU allocates the temp memory on an as-needed basis.
The CPU allocates the temp memory for the code block at the time when the code block is
started (for an OB) or is called (for an FC or FB). The allocation of temp memory for a code
block might reuse the same temp memory locations previously used by a different OB, FC or
FB. The CPU does not initialize the temp memory at the time of allocation and therefore the
temp memory might contain any value.
Temp memory is similar to M memory with one major exception: M memory has a "global"
scope, and temp memory has a "local" scope:
●
M memory: Any OB, FC, or FB can access the data in M memory, meaning that the data
is available globally for all of the elements of the user program.
●
Temp memory: Access to the data in temp memory is restricted to the OB, FC, or FB that
created or declared the temp memory location. Temp memory locations remain local and
are not shared by different code blocks, even when the code block calls another code
block. For example: When an OB calls an FC, the FC cannot access the temp memory of
the OB that called it.
The CPU provides temp (local) memory for each of the three OB priority groups:
●
16 Kbytes for startup and program cycle, including associated FBs and FCs
●
4 Kbytes for standard interrupt events including FBs and FCs
●
4 Kbytes for error interrupt events including FBs and FCs
You access temp memory by symbolic addressing only.
DB (data block): Use the DB memory for storing various types of data, including intermediate
status of an operation or other control information parameters for FBs, and data structures
required for many instructions such as timers and counters. You can access data block
memory in bits, bytes, words, or double words. Both read and write access is permitted for
read/write data blocks. Only read access is permitted for read-only data blocks.
Table 4- 14 Absolute addressing for DB memory
Bit
DB[data block number].DBX[byte
address].[bit address]
DB1.DBX2.3
Byte, Word, or Double
Word
DB[data block number].DB [size][starting
byte address]
DB1.DBB4, DB10.DBW2,
DB20.DBD8