Very critical and important tool that could really advance your code and make you really professional programmer is how to use and configure cyclic interrupts using TIA portal that is launched by siemens, it would help your code so much making it more reliable and more efficient.
How does the TIA Portal work?
First of all, we should understand some basic concepts about TIA portal
Organization Block (OB)
The TIA portal software has different kinds of organization blocks, Each type of these blocks have its own
usage and application, all of them are optional (which means that you can use it or not) except one of them that contains the main program called Main OB (OB 1), our article will not explain the usage of all of them, we will just work with the cyclic OBs (OB 30+)
This word is not specialized for siemens, interrupts are some specified and Critical Routines that the programmer wants to be executed at a certain time and events.
So interrupts do not wait for the main program to finish its cycle then it will be executed, Absolutely Not once interrupts are occurred it stops the main OB at the breakpoint and execute its routine then the main OB resumes the program from the breakpoint again.
Priority of an interrupt
Very important note that you should be aware about it, is the priority of the interrupt that you are using.
Every interrupts in the TIA portal has a number called the priority that refers to the arrangement of that interrupt between the whole interrupts, assume that two interrupts occur at the same time.
The PLC will execute the higher one in priority at first then the Second interrupt(that has lower priority) then it will go back again to Main OB.
Cyclic Interrupts (OB 30+)
The idea behind that interrupt, that you can configure one of them to be executed with certain cyclic times that is independent on the time of the scan cycle of your main program.
Cyclic interrupts in TIA portal generally have the priority of (30 : 38) that depends into the CPU that you have, Not all of them have the same cyclic interrupt, some CPUs have just (32 : 35) other CPUs may have another group of cycle interrupts, do not let that make you to be confused.
Application of Cyclic Interrupts
- Safety, in your project safety is first so during your process you may need some safety actions that should be checked periodically with certain times.
2. PID controllers, the time of the main scan cycle may affect at the accuracy of your PID actions, so you do not want to relate its actions with the time of the scan cycle, so you push your PID instructions into a cyclic interrupt to be executed periodically with certain cyclic times.
One of the best PLC interview questions “How could you make a program that controls two alternative loads without using any timer” ……
Note that this example is used just for examine that you really can configure and use cyclic interrupts.
Cyclic Interrupts in TIA Portal
First of all, select your desired CPU from “configure a new device”
1. Select add new block
2. Select add new organization block
3. Then select any interrupt of them, then press OK
4. After you select the desired one it will be shown under your program blocks
5. Then select your CPU properties to configure the execution time
6. Then write your program as shown in the next Figure.
Finally, you will never get 100% of understanding till you try something by your self so please try to make it
on your TIA and feel free to send me back to discuss that.
With my best wishes
Mail me on: [email protected]
If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.