Technical data
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
82 Manual, 05/2010, A5E02789666-01
4.2.3 Block Types
4.2.3.1 Organization Block for Cyclic Program Processing (OB1)
Cyclic program processing is the "normal" type of program execution on programmable logic
controllers. The operating system calls OB1 cyclically and with this call it starts cyclic execution of
the user program.
Sequence of Cyclic Program Processing
The following table shows the phases of cyclic program processing:
Step Sequence in CPUs to 10/98 Sequence in CPUs from 10/98
1 The operating system starts the cycle monitoring
time.
The operating system starts the cycle monitoring
time.
2 The CPU reads the state of the inputs of the
input modules and updates the process image
table of the inputs.
The CPU writes the values from the process
image table of the outputs to the output modules.
3 The CPU processes the user program and
executes the instructions contained in the
program.
The CPU reads the state of the inputs of the
input modules and updates the process image
table of the inputs.
4 The CPU writes the values from the process
image table of the outputs to the output modules.
The CPU processes the user program and
executes the instructions contained in the
program.
5 At the end of a cycle, the operating system
executes any tasks that are pending, for example
downloading and deleting blocks, receiving and
sending global data.
At the end of a cycle, the operating system
executes any tasks that are pending, for example
downloading and deleting blocks, receiving and
sending global data.
6 Finally, the CPU returns to the start of the cycle
and restarts the cycle monitoring time.
Finally, the CPU returns to the start of the cycle
and restarts the cycle monitoring time.
Process Images
So that the CPU has a consistent image of the process signals during cyclic program processing,
the CPU does not address the input (I) and output (Q) address areas directly on the I/O modules
but rather accesses an internal memory area of the CPU that contains an image of the inputs and
outputs.
Programming Cyclic Program Processing
You program cyclic program processing by writing your user program in OB1 and in the blocks
called within OB1 using STEP 7.
Cyclic program processing begins as soon as the startup program is completed without errors.