02 - Linear and Structured Programming
02 - Linear and Structured Programming
Linear programming
Solutions for small automation tasks can be programmed linearly in a program cycle OB.
This is only recommended for simple programs.
The following figure shows a linear program schematically: The "Main" cycle OB contains
the complete user program.
Structured programming
Complex automation tasks can be more easily handled and managed by dividing them into
smaller sub-tasks that correspond to the technological functions of the process or that can
be reused. These sub-tasks are represented in the user program by blocks. Each block is
then an independent section of the user program.
Structuring the program offers the following advantages:
• Extensive programs are easier to program through the structure.
• Individual program sections can be standardized and used repeatedly with changing pa-
rameters.
• Program organization is simplified.
• Changes to the program can be made more easily.
• Debugging is simplified since separate sections can be tested.
• Commissioning is simplified.
The following figure shows a structured program schematically: The "Main" cycle OB calls
subprograms in succession to execute defined subtasks.
-1-
Linear and structured programming
-2-