Technical data
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
72 Manual, 05/2010, A5E02789666-01
4.2 Blocks in the User Program
The STEP 7 programming software allows you to structure your user program, in other words to
break down the program into individual, self-contained program sections. This has the following
advantages:
• Extensive programs are easier to understand.
• Individual program sections can be standardized.
• Program organization is simplified.
• It is easier to make modifications to the program.
• Debugging is simplified since you can test separate sections.
• Commissioning your system is made much easier.
The example of an industrial blending process illustrated the advantages of breaking down an
automation process into individual tasks. The program sections of a structured user program
correspond to these individual tasks and are known as the blocks of a program.
Block Types
There are several different types of blocks you can use within an S7 user program:
Block Brief Description of Function See Also
Organization blocks (OB) OBs determine the structure of the user
program.
Organization Blocks and
Program Structure
System function blocks (SFB)
and system functions (SFC)
SFBs and SFCs are integrated in the S7 CPU
and allow you access to some important system
functions.
System Function Blocks
(SFB) and System
Functions (SFC)
Function blocks (FB) FBs are blocks with a "memory" which you can
program yourself.
Function Blocks (FB)
Functions (FC) FCs contain program routines for frequently
used functions.
Functions (FC)
Instance data blocks
(instance DB)
Instance DBs are associated with the block
when an FB/SFB is called. They are created
automatically during compilation.
Instance Data Blocks
Data blocks (DB) DBs are data areas for storing user data. In
addition to the data that are assigned to a
function block, shared data can also be defined
and used by any blocks.
Shared Data Blocks (DB)
OBs, FBs, SFBs, FCs, and SFCs contain sections of the program and are therefore also known as
logic blocks. The permitted number of blocks per block type and the permitted length of the blocks
is CPU-specific.