S5-100U
7.2.2
Structured Programming
To solve complex tasks, it is advisable to divide a program into individual, self-contained program
parts (blocks). This procedure has the following advantages:
•
Simple and clear programming, even for large programs
•
Program parts can be standardized
•
Easy alterations
•
Simple program test
•
Simple start-ups
•
Subroutine techniques (block call from different locations)
The STEP 5 programming language has the following five block types:
•
Organization Block (OB)
Organization blocks manage the control program.
•
Program Block (PB)
Program blocks arrange the control program according to functional or technical aspects.
•
Sequence Block (SB)
Sequence blocks are special blocks that program sequence controls. They are handled like
program blocks. (This is available for CPU 103 and higher.)
•
Function Block (FB)
Function blocks are special blocks for programming frequently recurring or especially complex
program parts (e.g., reporting and arithmetic functions). You can assign parameters to them
(available for CPU 103 and higher). They have an extended set of operations (e.g., jump
operations within a block).
•
Data Block (DB)
Data blocks store data needed to process a control program. Actual values, limiting values, and
texts are examples of data.
EWA 4NEB 812 6120-02
Introduction to Step 5
7-5