Technical data
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 105
4.2.4.4 Hardware Interrupt Organization Blocks (OB40 to OB47)
The S7 CPUs provide hardware interrupt OBs that react to signals from the modules (for example,
signal modules (SMs), communications processors (CPs), function modules (FMs)). With STEP 7,
you can decide which signal from a configurable digital or analog module starts the OB. With CPs
and FMs, use the appropriate parameter assignment dialogs.
Hardware interrupts are triggered when a signal module with hardware interrupt capability and with
an enabled hardware interrupt passes on a received process signal to the CPU or when a function
module of the CPU signals an interrupt.
Rules for Hardware Interrupts
Hardware interrupts can only be executed when the corresponding organization block exists in the
CPU program. If this is not the case, an error message is entered in the diagnostic buffer and
asynchronous error handling is executed (OB80, see Error Handling Organization Blocks (OB70 to
OB87 / OB121 to OB122)).
If you have deselected hardware interrupt OBs in the parameter assignment, these cannot be
started. The CPU recognizes a programming error and changes to STOP mode.
Assigning Parameters to Signal Modules with Hardware Interrupt Capability
Each channel of a signal module with hardware interrupt capability can trigger a hardware interrupt.
For this reason, you must specify the following in the parameter sets of signal modules with
hardware interrupt capability using STEP 7:
• What will trigger a hardware interrupt.
• Which hardware interrupt OB will be executed (the default for executing all hardware interrupts
is OB40).
Using STEP 7, you activate the generation of hardware interrupts on the function blocks. You
assign the remaining parameters in the parameter assignment dialogs of these function modules.
Priority of the Hardware Interrupt OBs
The default priority for the hardware interrupt OBs is priority class 16 to 23. You can assign
parameters to change the priority classes.