Technical data

Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 73
4.2.1 Organization Blocks and Program Structure
Organization blocks (OBs) represent the interface between the operating system and the user
program. Called by the operating system, they control cyclic and interrupt-driven program
execution, startup behavior of the PLC and error handling. You can program the organization
blocks to determine CPU behavior.
Organization Block Priority
Organization blocks determine the sequence (start events) by which individual program sections
are executed. An OB call can interrupt the execution of another OB. Which OB is allowed to
interrupt another OB depends on its priority. Higher priority OBs can interrupt lower priority OBs.
The background OB has the lowest priority.
Types of Interrupt and Priority Classes
Start events triggering an OB call are known as interrupts. The following table shows the types of
interrupt in STEP 7 and the priority of the organization blocks assigned to them. Not all
organization blocks listed and their priority classes are available in all S7 CPUs (see "S7-300
Programmable Controller, Hardware and Installation Manual" and "S7-400, M7-400 Programmable
Controllers Module Specifications Reference Manual").
Type of Interrupt Organization Block Priority Class
(Default)
See also
Main program
scan
OB1 1 Organization Block for Cyclic Program
Processing (OB1)
Time-of-day
interrupts
OB10 to OB17 2 Time-of-Day Interrupt Organization
Blocks (OB10 to OB17)
Time-delay
interrupts
OB20
OB21
OB22
OB23
3
4
5
6
Time-Delay Interrupt Organization
Blocks (OB20 to OB23)
Cyclic interrupts OB30
OB31
OB32
OB33
OB34
OB35
OB36
OB37
OB38
7
8
9
10
11
12
13
14
15
Cyclic Interrupt Organization Blocks
(OB30 to OB38)