03/06/2026
OB1 is Not Enough Every Organization Block in TIA Portal Explained from Startup to Motion Control
OB1 is only the starting point.
The real power of TIA Portal comes when you understand all the Organization Blocks and why the CPU calls them.
Here is the complete breakdown.
________________________________________
What is an Organization Block?
You do not call an OB like an FC or FB. The CPU calls it automatically when a specific event happens. That event can be a normal scan, a startup, a timer, a hardware signal, a fault, or a motion task.
Once you understand OBs, you understand how the Siemens CPU actually runs your machine program.
________________________________________
1. OB1 - Main Program Cycle
The normal running program. Executes top to bottom, then repeats while the CPU is in RUN mode. This is where you call your FBs, FCs, sequences, interlocks, alarms, and HMI logic. It runs at priority class 1 - the lowest. Every higher priority OB can interrupt it, execute, and return.
One important point: a higher OB number does not mean higher priority. Priority depends on the OB type.
________________________________________
2. Additional Cyclic OBs - OB123 and above
Supported mainly on S7-1500. Useful for separating large programs into clean sections diagnostics, background calculations, energy monitoring, data handling. These still run within the normal scan, just after OB1 in numerical order.
________________________________________
3. OB100 - Startup
Runs once when the CPU switches from STOP to RUN. Use it to reset counters, set default values, clear fault flags, and prepare startup conditions. Much cleaner than filling OB1 with first-scan flags.
________________________________________
4. OB10 to OB17 - Time of Day Interrupts
Trigger based on the CPU clock. Set the start date, start time, and repetition mode in the OB properties. Use for shift resets, daily report triggers, end-of-day counter resets, and scheduled logging.
________________________________________
5. OB20 to OB23 -Time Delay Interrupts
These do not run by themselves. You start them from your program using the SRT_DINT instruction with a defined delay time. After the delay expires, the OB executes once. Useful for special delayed actions. For simple motor delays, normal IEC timers are still easier.
________________________________________
6. OB30 to OB38 - Cyclic Interrupts
Run at a fixed configured interval, completely independent of OB1 scan time. This is the key difference. Configure the interval in the OB properties in TIA Portal.
Use these for PID control loops, fast sampling, communication polling, and time-critical calculations. They have higher priority than OB1, so if one triggers while OB1 is running, the CPU pauses OB1, runs the interrupt OB, then returns.
Keep them short. Heavy logic inside a fast cyclic interrupt OB creates scan time problems that are very hard to diagnose.
________________________________________
7. OB40 to OB47 - Hardware Interrupts
React immediately to a configured hardware event โ a rising edge on a digital input, an encoder trigger, or a high-speed counter event. Faster than waiting for the next OB1 scan.
One important rule: never use a hardware interrupt OB as your main emergency stop method. Emergency stop must always go through proper safety hardware or a safety PLC.
________________________________________
8. OB82 - Diagnostic Error Interrupt
Called when a diagnostics-capable module detects a fault โ broken wire on analog input, short circuit on output, sensor supply failure, or channel fault. Essential for showing proper fault messages on the HMI instead of an unexplained CPU stop.
________________________________________
9. OB83 - Module Pull or Plug
Called when a module is removed or inserted while the CPU is in RUN mode. Especially important for ET 200SP hot-swap systems.
________________________________________
10. OB86 - Rack or Station Failure
Called when a PROFINET device or remote I/O station goes offline or comes back online. For any machine with ET 200SP or distributed I/O, this OB is critical. Without it, a lost PROFINET connection can stop your CPU. With it, you can raise an alarm and keep the rest of the machine running.
________________________________________
11. OB80 - Time Error
Called when the scan time exceeds the watchdog limit, or when a cyclic interrupt is triggered before the previous ex*****on finished. Very useful during commissioning to identify overloaded logic and timing problems.
________________________________________
12. OB121 - Programming Error
Called when a runtime programming error occurs โ wrong pointer, array index out of bounds, or calling a block that does not exist. Without OB121 some of these errors stop the CPU immediately. With it, you can catch the fault, log it, and keep running.
________________________________________
13. OB122 - I/O Access Error
Called when the program tries to read or write an I/O address that is not available. Very common during commissioning when not all hardware is connected. Without OB122, this can stop the CPU. With it, you handle missing I/O safely.
________________________________________
14. OB91 and OB92 - Motion Control
OB91 handles the MC-Servo cycle. OB92 handles the MC-Interpolator. Both are created automatically when you add a technology object in TIA Portal. For standard PLC projects you may not work with them directly. For motion control projects, they directly affect servo timing, CPU load, and system performance.
________________________________________
The Five OBs Every Real Project Should Have
These are not always mandatory for small test programs. But in real machines and commissioning work, they save enormous amounts of time.
OB80 - Time Error OB82 - Diagnostic Error OB86 - Rack or Station Failure OB121 - Programming Error OB122 - I/O Access Error
Even with just a simple fault flag inside each one, they prevent unexplained CPU stops and make troubleshooting far easier.
________________________________________
Final Thought
OB1 runs your normal logic.
Every other OB helps your PLC react to the real world startup, timing, hardware events, faults, diagnostics, I/O problems, and motion tasks.
When you understand OBs, you are not just writing ladder logic anymore. You are understanding how the Siemens CPU actually executes your machine program.
Save this post and share it with someone learning TIA Portal.
Which OB did you discover the hard way on a real project? Drop it in the comments.
________________________________________