What are the simplest functions in PLC? (Part-1)
I have given a lot of information about PLC-HMI-SCADA in the articles I have published so far. We also examined the types of communication, which is one of the most important issues. Now it's time to dig a little deeper... Today we will examine common functions used in PLC programming. Timers, counters and many more... Let's get started.
But first of all, I should point out that each PLC is coded through its own programs. Although some use common platforms, companies such as Siemens, Beckhoff and Mitsubishi have their own programs. Today, we will examine it through TIA Portal, Siemens' platform. Remember that TIA Portal is one of the most widely used programs in the world. But my advice is to use as many different PLC programming platforms as possible and learn about each PLC.
1.Timers
There are 4 types of timers in PLC programming. These are TP, TON, TOF and TONF. Let's briefly touch on these;
TP:
TP timer starts counting in the specified time with the signal it receives at its input and becomes active. When it becomes active, it activates the relay at its output. The time given to the TP timer starts counting as soon as it receives a signal. If the signal is cut off before the time is up, it stops counting, resets to zero and becomes passive. But if the signal continues to arrive for the given period of time, the TP timer remains active and keeps its output active until the end of this period. When the time expires, it deactivates the output and itself. In order for it to become active again, the signal at the input must be interrupted and re- introduced.
TON:
The TON timer is somewhat similar to the TP timer, but there is a clear difference. Unlike the TP timer, when the TON timer receives a signal to its input, it does not become active but starts counting. If the signal is interrupted before the given time expires, it resets the counter. Again, like the TP timer, the TON timer does not activate its output as soon as it receives a signal. It signals the output after the given time has passed. After the time has expired, just like the TP timer, it keeps the output active as long as it receives a signal at its input.
In short, the TON timer is a time function that delays the input signal from reaching the output. We call this "On-Delay".
TOF:
TOF timers are the exact opposite of the TON timer in structure. So it is an Off-Delay timer. The TOF timer becomes active when it receives a signal at its input and activates its output. But it doesn't start counting. If the signal at the input of the TOF timer is interrupted, it starts counting. It continues to keep the output and itself active for the duration it counts. (You can think of it as a coil.) At the end of the period, it turns the output and itself into passive. If a signal is applied to the input again while the time is counting, the counter is reset and its output and output remain active.
TONR:
TONR timer is the smartest among timers. Because it does not forget the time it counts, it records it in memory. When a signal is applied to the input of a TONR timer, it acts like a TON timer. It does not activate and does not activate the output. However, unlike the TON timer, if the input signal is cut off before the time expires, it keeps the counted time in its memory. If the signal comes again, it continues where it left off. When the time expires, it activates its output and this output remains active even if the input signal is cut off. There is a "Reset" input to deactivate the output and timer. When a signal is applied to the "Reset" input, the time in the TONR memory is deleted, if the output and the timer itself are active, they become passive.
In the first part of our series, we examined Timer functions. I hope you enjoyed coming here. I will continue to explain to you the most common function types and sub-functions used in PLC programming. In the next article, I will try to explain Counters to you. Maybe the automation software developer in you will emerge. If you are curious about the continuation of the series, please follow me and subscribe, and if you liked my article, do not forget to like and comment.
If you would like to take a look at my previous articles, you can access them from the links below or from my profile.
What is Modbus TCP?
What is ProfiBUS/ProfiNET?
What is CanOPEN and CanBUS? (Controller Area Network)
What are PLC programming languages (Part-2)
What are PLC programming languages (Part-1)
What is PLC? What is its structure? What are its areas of use?
What is SCADA?
What is HMI Panel/Display?
What is EtherCAT?