Technical data
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 103
4.2.4.3 Cyclic Interrupt Organization Blocks (OB30 to OB38)
The S7 CPUs provide cyclic interrupt OBs that interrupt cyclic program processing at certain
intervals.
Cyclic interrupts are triggered at intervals. The time at which the interval starts is the mode
transition from STOP to RUN.
Rules for Cyclic Interrupts
When you specify the intervals, make sure that there is enough time between the start events of
the individual cyclic interrupts for processing the cyclic interrupts themselves.
If you assign parameters to deselect cyclic interrupt OBs, they can no longer be started. The CPU
recognizes a programming error and changes to STOP mode.
Starting the Cyclic Interrupt
To start a cyclic interrupt, you must specify the interval in the cyclic interrupts parameter block
using STEP 7. The interval is always a whole multiple of the basic clock rate of 1 ms.
Interval = n
X basic clock rate 1 ms
Each of the nine available cyclic interrupt OBs has a default interval (see the following table). The
default interval becomes effective when the cyclic interrupt OB assigned to it is loaded. You can,
however, assign parameters to change the default values. Refer to your "S7-300 Programmable
Controller, Hardware and Installation Manual" and your "S7-400, M7-400 Programmable
Controllers Module Specifications Reference Manual" for the upper limit.
Phase Offset in Cyclic Interrupts
To avoid cyclic interrupts of different cyclic interrupt OBs being started at the same point and
possibly causing a time error (cycle time exceeded) you can specify a phase offset. The phase
offset ensures that the execution of a cyclic interrupt is delayed by a certain time after the interval
has expired.
Phase offset = m
X basic clock rate (where 0 ≤ m < n)
The following figure shows how a cyclic interrupt OB with phase offset (OB37) is executed in
contrast to a cyclic interrupt without phase offset (OB38).