Inst ToolsInst ToolsInst Tools
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: OB1 – Main Cyclic Organization Block in TIA Portal
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > OB1 – Main Cyclic Organization Block in TIA Portal

OB1 – Main Cyclic Organization Block in TIA Portal

The OB1 main cyclic organization block in TIA Portal is responsible for cyclically executing your logic by the PLC.

Last updated: March 28, 2023 11:47 am
Mahmoud Salama
PLC Tutorials
1 Comment
Share
10 Min Read
SHARE

In previous articles we discussed different types of Blocks in SIEMENS TIA Portal, we talked about function blocks FBs, functions FCs, and data blocks DBs.

Contents
What is an Organization Block (OB)?Different Types of Organization BlocksMain Cyclic Interrupt OB1Cycle Time MonitoringSimple Program Example in PLCConclusion

In this article we will take about another type of block in SIEMENS PLCs, these are the organization blocks, and in this article, we will discuss the most important organization block of them all, which is the Main Organization Block or OB1.

Contents:

  • What are organization blocks?
  • Different types of OBs.
  • What is OB1?
  • Cycle time monitoring.
  • Simple program example.
  • Conclusion.

What is an Organization Block (OB)?

Organization blocks, you can think of them as functions FCs or function blocks FBs. But the difference is, you don’t call them, the operating system of the PLC calls these organization blocks, whether the operating system calls the OB cyclically as OB1 or whether it gets called when a certain event occurs, either way, the operating system takes care of it. You only need to create the block and add whatever logic you want inside the block. Sometimes you don’t even need to add any code inside the OB, just creating the OB itself can provide many benefits, which we will see when discussing some of those OBs.

Organization blocks are the interface between the PLC operating system and the user program. Any PLC will have two different programs, the runtime program which is the operating system of the PLC, and the user program which is the logic or code that the PLC programmer will write to control a certain process. This two different software need to talk with each other, and the organization blocks OBs are how that is done.

Organization blocks OBs are used to perform a lot of tasks, some of which are listed below:

  • Startup characteristics of the automation system
  • Cyclic program processing
  • Interrupt-driven program execution
  • Error handling.

Different Types of Organization Blocks

As organization blocks are basically the tools of the operating system to perform a lot of tasks.

Different tasks require different OB, and that is why you have many different OBs inside a PLC, how many different OBs will depend on the type of PLC you are using, but here are some of the most common OBs you can find in almost all of SIEMENS PLC:

  • Main Cyclic OB1.
  • Time interrupts OBs.
  • Time of day OBs.
  • Software errors OBs.
  • Hardware errors OBs

Many more Organization blocks are available for use with your logic. See picture 1.

Different Types of Organization Blocks in Siemens PLC
Picture 1 – Different Organization Blocks available in TIA Portal

In this article, we will discuss the most important organization block of them all, which is the Main Cyclic Interrupt OB1.

Main Cyclic Interrupt OB1

The main cyclic OB1 is the organization block which is responsible for cyclically executing your logic by the PLC. Whenever you create a new project and add a PLC, the Main OB1 will be automatically created by the software. These are the minimum needed blocks for a PLC code. See picture 2.

Main Cyclic Interrupt OB1
Picture 2 – Main OB1 is created automatically

Inside this Main OB1, you can either write your whole PLC program if it is a small project. If your project is quite large, then you probably have some functions FCs of function blocks FBs that you need to execute. In that case, you will use the Main OB1 to call them.

Off course, you don’t have to call every FC or FB by the OB1, but if your OB1 is not the first block of your nesting calls, then it will not be executed. See picture 3.

OB1 - Main Cyclic Organization Block in TIA Portal
Picture 3 – Calling your blocks by OB1

The essential basis of your PLC code is the cyclic behavior, meaning you need your code to be executed continuously. When the processing of your logic has been completed, the operating system starts processing it again. That is done through the use of the main OB1, you put and call all of your logic and code inside this OB1 and the operating system will make sure to continuously execute it.

You should know that, even if you can’t create an OB1 block as it is automatically created when adding a new PLC, you can create more than one cyclic interrupt block.

OB1 is a cyclic interrupt, that the operating system will automatically and continuously call and executed whatever logic is inside. However, for large PLC projects where you have so many functions and function blocks in your PLC logic, you can use more than one cyclic interrupt OB to better structure your code to make it easy to read and follow.

In that case, you would create another cyclic interrupt, see picture 4.

OB1 is a cyclic execution organization block
Picture 4 – Creating more than one cyclic OB

When you have created several program cycle OBs, these are called one after the other in the order of their OB numbers.

The program cycle OB with the lowest OB number is called first. See picture 5.

Siemens PLC Programming Blocks
Picture 5 – Program cycle with more than one cyclic OB

After the cyclic program is complete, the operating system updates the process images as follows:

  1. It writes the values from the process image output to the output modules.
  2. It reads the inputs at the input modules and transfers these to the process image input.

The previous two steps plus the execution of the PLC program are called a scan cycle. See picture 6.

Scan cycle of a Siemens PLC
Picture 6 – Scan cycle of a Siemens PLC

Cycle Time Monitoring

Cycle time refers to the runtime of the cyclic program, including the runtime of all nested program parts like FCs, FBs, and higher-priority OBs. If you have created several program cycle OBs, each program cycle OB contributes to the cycle time.

The operating system monitors whether the cycle time remains smaller than the configured maximum cycle time. If it exceeds the maximum cycle time, PLC will either go to STOP mode or call OB80 depending on your programming.

Apart from monitoring the maximum cycle time, it is also possible to guarantee a minimum cycle time. To do this, the operating system delays the start of a new cycle until the minimum cycle time has been reached.

You can configure the minimum and maximum cycle time in the configuration properties of your PLC. See picture 7.

Cycle Time Monitoring in PLC
Picture 7 – Configure the minimum and maximum cycle time

Simple Program Example in PLC

Simple Program Example in PLC
Picture 8 – PLC Program Example

To better understand the PLC program cycle and OB1 execution, let’s create a simple program. This program will use an add instruction that will accumulate a value of 1 into a memory area each 1 scan cycle. See the following simulation.

PLC program cycle and OB1 execution

As you see from the animation, the add instruction is being executed very fast; this is how fast the scan cycle is. It will depend on how powerful your PLC is. But mainly the scan cycle is in the range of milliseconds.

Downloads:

  • Main OB1
  • PLC Logic

Conclusion

  • Organization blocks are the interface between the PLC operating system and your control program.
  • Main Cyclic OB1 is cyclically executed by the operating system.
  • You will execute your logic by including it inside one or more Cyclic OBs.
  •  The scan cycle time is the time used to execute your logic 1 time.

If you liked this article, then please subscribe to our YouTube Channel for Instrumentation, Electrical, PLC, and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • System and Local Time in PLC
  • PLC Programming Tips & Tricks
  • Timers in Siemens Tia Portal
  • SCADA System Architecture
  • Static and Temp Variables in PLC
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !
Cars Garage Counter From the Same Door PLC Logic
Types of Limit Switches – Principle, Advantages, Disadvantages
PLC to Start or Stop 3 Machines using 1 Switch Program
What is Marshalling Cabinet?
Modbus Communication between PLC and Energy Meter
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
1 Comment
  • Tidjani Mohammed says:
    November 5, 2023 at 2:44 pm

    That is very interesting article just keep on

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
208kSubscribersSubscribe
38kFollowersFollow

Categories

Recent Comments

  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals
  • Vaishnavi on Free Instrumentation Course for Trainee Engineers

Related Articles

How to Update the Firmware Version of your PLC

How to Update the Firmware Version of your PLC? – TIA Portal

Comparison of Control Loops - Open, Closed, Cascade, Feedforward, Ratio

Comparison of Control Loops – Open, Closed, Cascade, Feedforward, Ratio

HMI screen for operator

#8 PLC Best Practices – Validate HMI Input Variables at PLC Level

Alarm prioritization

What is Alarm Prioritization? – Types of Alarms

FIFO and LIFO Sequences in PLC

What are FIFO and LIFO Sequences in PLC?

Ladder Logic for Motor Control

PLC Programming for 3 Motors control in Ladder logic

Function Block Programming in Studio 5000

Introduction to Functional Block Diagram in Studio 5000

Automatic Packing of Bottles

Automatic Packing of Bottles Programming

More Articles

Forward Bias

Rectifiers, Forward Bias and Reverse Bias

Generator Protection Interview Questions

Generator Protection Interview Questions & Answers

Basic Digital Building Blocks Objective Questions

Basic Digital Building Blocks Objective Questions

Thermowell Immersion Length

Thermowell Insertion and Immersion Length

Free Omron PLC Programming Course in HINDI

Free Omron PLC Programming Course in HINDI

PLC Program to Control Level of Two Tanks

PLC Level Control of Two Tanks

Ion Analyzers Questions and Answers

Ammonia and Fluoride Electrode Questions & Answers

Wiring Diagram Forward-Reverse for 3 Phase Motor

Motor Forward and Reverse Direction Control using Limit Switches

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?