PLC concepts
5.1 Execution of the user program
S7-1200 Programmable controller
106 System Manual, V4.2, 09/2016, A5E02486680-AK
Interruptible and non-interruptible execution modes
OBs (Page 92) execute in priority order of the events that trigger them. In the Startup
properties of the device configuration of the CPU (Page 170), you can configure OB
execution to be interruptible or non-interruptible. Note that program cycle OBs are always
interruptible, but you can configure all other OBs to be either interruptible or non-
interruptible.
If you set interruptible mode, then if an OB is executing and a higher priority event occurs
before the OB completes its execution, the running OB is interrupted to allow the higher-
priority event OB to run. The higher-priority event runs, and at its completion, the OB that
was interrupted continues. When multiple events occur while an interruptible OB is
executing, the CPU processes those events in priority order.
If you do not set interruptible mode, then an OB runs to completion when triggered
regardless of any other events that trigger during the time that it is running.
Consider the following two cases where interrupt events trigger a cyclic OB and a time delay
OB. In both cases, the time delay OB (OB201) has no process image partition assignment
(Page 83) and executes at priority 4. The cyclic OB (OB200) has a process image partition
assignment of PIP1 and executes at priority 2. The following illustrations show the difference
in execution between non-interruptible and interruptible execution modes:
Figure 5-1 Case 1: Non-interruptible OB execution
Figure 5-2 Case 2: Interruptible OB execution
Note
If you configure the OB execution mode to be non
-interruptible, then a time error OB cannot
interrupt OBs other than program cycle OBs. Prior to V4.0 of the S7
-1200 CPU, a time error
OB could interrupt any executing OB. From V4.0
forward, you must configure OB execution
to be interruptible if you want a time error OB (or any other higher priority OB) to be able to
interrupt executing OBs that are not program cycle OBs.