OB – Organization Block interrupts – what you should always have in your software

Organization Block OB TIAPortalHowTo.com
Organization Block OB

1. Types of Organizational Blocks – OB in TIA Portal

The most common OB in TIA Portal, without which, your software will not work is OB1 (Program Cycle). This OB, being the main block of the program, is called cyclically, which means it will always be called once per PLC scan.

There are however other types of OBs:

  • Startup
  • Time delay interrupt
  • Cyclic interrupt
  • Hardware interrupt
  • Time error interrupt
  • Diagnostic error interrupt
  • Pull or plug of modules
  • Rack or station failure
  • Programming error
  • IO access error
  • Time of Day
  • MC-Interpolator
  • MC-Servo
  • MC- Pre Servo
  • MC Post Servo
  • Synchronous Cycle
  • Status
  • Update
  • Profile

To find out more about a particular type of OB press the ‘more…’ link and you will be taken to TIA Portal help:

Organization Blocks OB in TIA Portal TIAPortalHowTo.com
Organization Blocks OB in TIA Portal

More information about the types of OB (Organization Blocks) in TIA Portal can be found on Siemens website: Which organization blocks can you use in STEP 7 (TIA Portal)?

2. Error OBs in TIA Portal

Some of the OBs (Organization Blocks) in TIA Portal are triggered when a specific error occurs and here is the most important thing:

If your program does not have an OB that PLC is trying to call because of a specific error, THE PLC WILL GO IN TO STOP MODE!

In majority of the applications this unacceptable.

3. Which OBs do I need in my PLC to prevent PLC stop?

This mostly depends on the hardware you are using. For example, if you have a remote IO, lets say ET200SP you will need:

  • OB82 – Diagnostics error interrupt
  • OB83 – Pull or plug of modules
  • OB86 – Rack or station failure
  • OB121 – Programming error
  • OB122 – IO access error

Basically it’s better to have more then less of OBs in the PLC because: A) OBs won’t be triggered until a particular condition is met – so they will not extend your scan cycle B) They will not eat away your a substiantial percentage of your PLC memory as they will, most probably, not hold a lot of code (some might even be completely empty)

I would recommend inserting the following OBs in to your program:

Organization Blocks OB STOP PLC TIAPortalHowTo.com
Organization Blocks OB STOP

4. What should be inside an OB?

Ideally you should put some diagnostic code in. For example set a bit that will later trigger an alarm on your HMI / SCADA. Or you could record a time and date of the event that triggered the OB. Worst case you can leave it completely empty! It will still serve its purpose, which is not letting the PLC go in to STOP mode.

Last important thing to consider. There might actually be applications in which you will want the PLC to go in to STOP mode when a serious error occurs, but you can do this via a software command placed within an OB.


  1. Thanks for the good work you are doing over here.

    could you pliz take us through PID programing without using OB35.

    I am looking at designing my own PID function block that i can later call in OB1.

    Iam stil confused how to go about it.

  2. Thank you for the words of encouragement!
    Unfortunately my expirience with PID is limited and I would not like to deep dive in to topic I don not know inside out.
    I might do some PID basics tutorial in the furute tough.