What are Organization Blocks (OB) in Siemens and PLC and types of Organization Blocks

Published on Jun26, 2025 | Category: or

Share this Page:

Organization Blocks (OBs) in Siemens PLCs are special parts of the program that are controlled by the PLC’s operating system. These blocks run automatically when specific events happen, such as errors, signals, or time-based actions.
The main block used in most programs is called the program cycle OB, often OB1. This block runs in a continuous loop when the PLC is in RUN mode. It is the base of the control logic and is used to check inputs, run instructions, and update outputs again and again.
The program cycle OB works at the lowest priority. This means it can be paused or interrupted by more important blocks like error-handling or interrupt OBs. However, the startup OB is different. It runs only once before the main cycle begins and is used to set initial values or reset things before normal operation starts.
Once the PLC finishes running OB1, it starts over again. This cycle continues nonstop, making OB1 the heart of most automation systems. In many cases, the whole program is written in just this one OB.
Other types of OBs can be created for special tasks. For example, you can use time-based OBs to run something every few milliseconds, or hardware interrupt OBs to respond immediately to signals from sensors. Error OBs handle problems like faulty devices or communication errors.
These extra OBs have higher priority and can interrupt OB1 to make sure urgent tasks are done on time. This structure helps your program run smoothly, safely, and in an organized way.

What is Organization Blocks in Siemens PLC?

Organization Blocks (OBs) in Siemens PLCs serve as the interface between the operating system and the user program. They are automatically triggered by system events and allow you to define how the CPU should behave in specific situations. These blocks manage important functions such as:

You can customize OBs to suit the logic and response you require from the PLC. The number and type of OBs available may depend on the specific CPU model. Some OBs provide start information when triggered, which can be used within the user program for dynamic control. For detailed behavior and configuration of OBs, refer to your CPU’s hardware and system manual.


Types of Organization Blocks in Siemens PLC

Organization Blocks (OBs) in Siemens PLCs are special system-defined blocks that manage how and when the user program executes. OBs are triggered by specific system events such as cyclic scans, startup, time interrupts, hardware events, or system errors.

Why OBs are Important in Siemens PLC Programming

OBs allow structured programming in Siemens PLCs by providing a framework for handling different types of tasks and events. They ensure safe and reliable automation through organized logic execution, startup routines, diagnostics, and real-time responses.


What is OB 1 (Cyclic program Blocks) Siemens PLC?

OB1 (Organization Block 1) is the main cyclic execution block in Siemens PLCs. It acts as the core of the user program and is automatically called by the operating system when the CPU is in RUN mode. OB1 is executed repeatedly in a continuous loop, which is why it is often referred to as the cyclic program block. During each scan cycle, OB1 first reads all input values, processes the logic, and then updates the output states accordingly. This loop continues until the CPU stops or is interrupted by other event-driven OBs like time-based or error-handling OBs. In most applications, OB1 contains the majority of the control logic and calls to other Function Blocks (FBs) or Functions (FCs) for modular programming.

What is Time-of-day interrupt organization blocks (OB10–OB17)?

Time Interrupt Organization Blocks (OB10 to OB17) are triggered at precise, user-defined time intervals. These OBs are useful when a specific part of the program needs to run regularly and at high accuracy, such as every 10 ms or 100 ms. They interrupt the cyclic OB1 program and are executed with a higher priority, making them ideal for time-critical tasks like sampling sensors or generating timed control signals.

What is Time-delay Interrupt OB (OB20 to OB23)?

Time-delay Interrupt Organization Blocks (OB20 to OB23) are triggered after a specified time delay set by the user. These OBs are started using the SRT_DINT instruction, where you define the delay time, OB number, and an optional identifier.

Once the delay expires, the corresponding OB (e.g., OB20) is executed automatically. These OBs are useful for executing time-based tasks such as delayed actions or scheduled events.

Usage Steps:

What is Cyclic Interrupt Organization Blocks (OB30 to OB38)?

Cyclic Interrupt OBs (OB30 to OB38) in Siemens PLCs are used to execute specific parts of the program at regular, time-based intervals. These blocks are ideal for time-critical operations that must run independently of the main program cycle.

The CPU calls each OB based on a fixed time interval (cycle clock), regardless of what the main OB1 is executing. Each OB has a default cycle time and priority level:

OB Default Time Frame Default Priority Class
OB305 s7
OB312 s8
OB321 s9
OB33500 ms10
OB34200 ms11
OB35100 ms12
OB3650 ms13
OB3720 ms14
OB3810 ms15

Function: These OBs allow scheduling tasks at fixed intervals. You can define a phase offset and cycle time to control their exact start time. This helps in applications where precise periodic control is required, such as PID loop execution or fast data logging.


What is Hardware Interrupt Organization Blocks (OB40 to OB47)?

Hardware interrupt OBs (OB40 to OB47) in Siemens PLCs are used when specific hardware events need immediate attention, such as a signal change on a digital input. Siemens PLCs allow up to eight hardware interrupt OBs, and each can be configured for specific channels or modules.

How it works: When a hardware event (like a rising or falling signal) occurs, the CPU checks which OB is assigned to handle it. By default, OB40 is used, but you can assign other OBs (OB41 to OB47) based on your system configuration. Each OB can also be given a priority level — higher priority OBs will interrupt lower priority ones.

Example: If a rising signal is detected on a digital input module and OB40 is assigned to that channel, OB40 will start running. Once OB40 finishes, the CPU sends an acknowledgment back to the module.

Note on multiple events:

These hardware interrupt OBs are useful for fast response tasks like emergency stops, limit switches, or high-speed counting where immediate action is critical.


What is Status Interrupt OB55 in Siemens PLC?

OB55 is a Status Interrupt Organization Block that is triggered when a DPV1 slave or an IO device reports a change in its operating status. For example, this could happen if a connected module or rack changes from RUN to STOP mode. The CPU operating system calls OB55 in response to such events, allowing you to react accordingly in your user program.

These interrupts are useful for monitoring the health and status of field devices on PROFIBUS or PROFINET networks. OB55 helps diagnose problems such as communication loss, mode transitions, or device failures at runtime.

Note: If you are using S7-400 CPUs or S7-400 PROFIBUS Communication Processors (CPs) configured in "S7 compatible" DP mode, OB55 cannot be used. In such cases, status interrupt handling is not available through OB55.

What is Update Interrupt OB56 in Siemens PLC?

OB56 is an Update Interrupt Organization Block that is called by the CPU when an update interrupt occurs on a DPV1 slave or IO device. This typically happens when the parameters for a specific slot or module are changed—either through local operation or remote configuration tools.

This OB helps detect and respond to configuration changes made during runtime, ensuring that your program can adjust or log such events as needed. It's especially useful in systems where dynamic parameter changes are expected.

Note: OB56 is not available if you are using S7-400 CPUs or S7-400 PROFIBUS CPs in "S7 compatible" DP mode. In this case, update interrupt handling via OB56 is not supported.

What are Synchronous Cycle Interrupt OBs (OB61 to OB64) in Siemens PLC?

Synchronous cycle interrupt OBs, also known as Isochronous Mode Interrupt OBs, are used to execute programs in sync with the DP cycle or the Profinet (PN) send clock. These OBs—OB61, OB62, OB63, and OB64—provide precise timing control for applications that require strict synchronization between hardware and software.

Each OB acts as an interface to a specific isochronous time-stamped alarm (TSAL). You can assign a priority between 2 and 26, or disable the OB by setting its priority to 0.

This feature is especially useful in motion control or high-speed deterministic systems, where exact timing is critical for reliable operation.

What is OB87 – Communication Error OB?

OB87 is triggered when a communication error occurs, such as a failure in data exchange between CPUs or with remote devices. If OB87 is not programmed:

What is OB86 – Rack Failure Organization Block?

OB86 is called when there is a hardware-related failure in the I/O system or DP/PROFINET network. This includes:

If OB86 is not available, the CPU will go into STOP mode.

What is OB85 – Priority Class Error OB?

OB85 is triggered when the CPU encounters a priority-related issue, such as:

Without OB85, the CPU enters STOP mode.

What is OB84 – CPU Hardware Fault OB?

OB84 is used to handle internal CPU hardware errors, including:

You can control OB84 handling with special instructions like: If OB84 is not programmed, the CPU does not enter STOP mode by default.

What is OB121 – Programming Error Organization Block?

OB121 is triggered when the CPU encounters a programming error during code execution. This could happen, for example, if your program tries to call a block that hasn’t been loaded into the CPU. If OB121 is not available and a programming error occurs, the CPU may enter STOP mode.

What is OB122 – I/O Access Error Organization Block?

OB122 is called when the CPU fails to access input/output modules correctly. This includes read or write errors when communicating with I/O modules. Handling OB122 allows your program to respond gracefully instead of stopping unexpectedly.

What are Startup Organization Blocks (OB100, OB101, OB102)?

These OBs are executed based on the type of CPU restart:

These OBs are useful for initializing variables and equipment based on the startup condition.

What is OB90 – Background Organization Block?

OB90 runs when the CPU has free time after OB1 execution and all interrupts have been handled. It helps maintain a minimum cycle time. OB90 is the lowest priority OB and gets interrupted by almost any event. It’s useful for non-critical background tasks that don't require time guarantees.

What is OB88 – Processing Interrupt OB?

OB88 is triggered when the CPU aborts a block execution due to internal issues like:

If OB88 isn’t available and such an error occurs, the CPU typically enters STOP mode.

What are Synchronous Cycle Interrupt OBs (OB61 to OB64) in Siemens PLC?

Synchronous Cycle Interrupt OBs, also called Isochronous Mode Interrupt OBs, are used to execute programs precisely in sync with the DP (Profibus) cycle or the Profinet (PN) send clock. These blocks help ensure high-precision control where exact timing is required, such as in motion control and real-time applications.

The OBs used for this purpose are:

Each OB acts as an interface to a time-stamped alarm (TSAL), which ensures that the interrupt is triggered exactly at the right time.

You can assign a priority level from 2 to 26 to these OBs. If you want to disable any of them, set the priority to 0. These settings help the CPU decide when and how to execute isochronous tasks in a coordinated manner.

📋 Siemens PLC OB Availability by CPU Series

Different Siemens PLC series support different sets of Organization Blocks (OBs). Use the table below to identify which OBs are available in S7-300, S7-400, S7-1200, and S7-1500 systems.

Organization Blocks Availability by Siemens PLC Series

ℹ️ Notes: