Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: OB1 – Main Cyclic Organization Block in TIA Portal
Share
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
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 !

Continue Reading

How to import GSD files into the TIA Portal? – Siemens PLC
Design a Program Using Studio 5000 and FactoryTalk View Studio
Difference Between NO and NC Contacts
Tia Portal – OB30 Cyclic Interrupt Organization Block
ControlLogix Architecture – Rockwell Automation
Basic Conveyor System for Product Handling in Omron PLC
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
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

Value Assignments in SCL Language – Single, Multiple, Combined
Automatic Car Washing using PLC
Modbus Communication between PLC and Energy Meter
Comparison Instructions in PLC Programming
SCADA Software and their Comparison
What is a GSD File and Why it is required?
Automation System for Hazardous Environments
Pulse Generation using Timer in Siemens PLC

Keep Learning

Using Clock Memory Bits in TIA Portal - Siemens PLC

Using Clock Memory Bits in TIA Portal – Siemens PLC

PLC Program Backup in Siemens Tia Portal

How to Take Program Backup from Physical PLC? – Siemens PLC

PLC Programmer Unknown Do's

Unknown Do’s Need to Know as a PLC Programmer

Function Block Programming in Studio 5000

Introduction to Functional Block Diagram in Studio 5000

Power Supply Sizing for Industrial Automation Systems

Power Supply Sizing for Industrial Automation Systems

Concept of DCS in Industrial Automation

Concept of DCS in Industrial Automation

Simatic Hardware Configuration

Configuration of Profibus Network in Siemens PLC

Fixed PLC

#19 PLC Best Practices – Monitor PLC Memory Usage

Learn More

What is VLAN?

Difference Between Subnet and VLAN

Radar and Ultrasonic Level Transmitter Problems Troubleshooting

Radar and Ultrasonic Level Transmitter Practical Problems Troubleshooting

Gamp 5 Compliance in Pharmaceutical Industry

What is Gamp 5 Compliance in Pharmaceutical Industry?

Pulverizer Electrical Problem Solved

Pulverizer Electrical Problem Solved

Electrical Engineers Basics

Basic Electrical Engineering Questions & Answers

Machine Indicator Lights PLC Programming Solution

Machine Indicator Lights: PLC Programming Solution

Pyrometer

Pyrometers Handbook

Motor Maintenance

Motor Maintenance, Troubles, Regular Checks, Performance

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

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?