In siemens PLC, to execute the PLC programs the Organisational Block is used.
In OB1 which is used to execute logic and we call other programming blocks from this OB1.
In many small applications only requires OB1 block. But In the large application, you require to use other organization blocks too which siemens offer within the programming software.
Types of Interrupt OB
There are four types of interrupt OB is used which are listed below.
- Cyclic Interrupt
- Hardware Error Interrupt
- Time of day Interrupt
- Start-up Interrupt
All the above-listed OBs don’t need to call from the main OB. They are used to execute based on events occur.
There are many other types of interrupt OB that exists like diagnostic error interrupt, io access error, and many more. But the above listed four are very useful in some events.
Let understand the above four listed interrupts OBs and when to use them in programming.
1) Cyclic interrupt (OB 30, OB 35)
Cyclic interrupt OB is used when there is a requirement of cyclic execution.
For example, we have our main program written in OB1, we have used cyclic interrupt block in between the ladder when execution occurs block turns to Interrupt OB for define time interval and return to main OB where it left off.
Cyclic OB is mainly used with PID controller and when there is a calculation is required.
Default Interrupt time in s7 PLC is of 100 milliseconds. But you can change it from Hardware view.
To add cyclic interrupt the OB open TIA portal and follow the below steps.
create a new project and select CPU type. Click on “project view”.
In the following window expand “program block” and double click on “Add new block”.
A new window will popup. Select “organisational block” and you can find all type of hardware interrupt which are available. Double click on any one take you to the programming environment.
2) Hardware Interrupt (OB 40)
This type of interrupt OB executes when CPU detect any error in the signal module.
A hardware interrupt is only generated by circuitry resides in the signal module.
In the above window, you can find Hardware interrupts. To add in the programming environment do follow the same step as above.
To avail this facility, you must have to select the signal module which contains hardware interrupt facility.
3) Time delay Interrupt (OB 20)
This type of interrupt will execute based on a certain time of day to perform a task.
This type of interrupt must require a block start time delay interrupt. You have to add this block to OB1.
In this block, you can specify a time and write the logic of execution of time-delay interrupt.
To add this block, click on Time interrupt delay to add Organisation block.
4) Start-up interrupt (OB 100)
Due to power failure if your PLC goes to stop mode when power is available from CPU’s transition from stop to run Start-up OB will execute, which will reset input to not start equipment automatically.
This type of interrupt is used to perform a start-up of the CPU more smoothly.
You can add this block as shown above the window in your programming block section.
Author: Suhel Patel
If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.
- Up Down Counter Instruction
- Extended Timer Logic in PLC
- Field instrument to Control Room
- Industrial Automation Protocols
- Download Free HMI software