Siemens STEP 7 PLC programming - Blocks used in the program


#1

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
Organization blocks (OB) OBs determine the structure of the user program.

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.

Function blocks (FB)
FBs are blocks with a “memory” which you can program yourself.

Functions (FC)
FCs contain program routines for frequently used functions.

Instance data blocks
(instance DB)
Instance DBs are associated with the block when an FB/SFB is called. They are created automatically during compilation.

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.

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.