Technical data

Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
96 Manual, 05/2010, A5E02789666-01
4.2.3.5 Shared Data Blocks (DB)
In contrast to logic blocks, data blocks do not contain STEP 7 instructions. They are used to store
user data, in other words, data blocks contain variable data with which the user program works.
Shared data blocks are used to store user data that can be accessed by all other blocks.
The size of DBs can vary. Refer to the description of your CPU for the maximum possible size.
You can structure shared data blocks in any way to suit your particular requirements.
Shared Data Blocks in the User Program
If a logic block (FC, FB, or OB) is called, it can occupy space in the local data area (L stack)
temporarily. In addition to this local data area, a logic block can open a memory area in the form of
a DB. In contrast to the data in the local data area, the data in a DB are not deleted when the DB is
closed, in other words, after the corresponding logic block has been executed.
Each FB, FC, or OB can read the data from a shared DB or write data to a shared DB. This data
remains in the DB after the DB is exited.
A shared DB and an instance DB can be opened at the same time. The following figure shows the
different methods of access to data blocks.