The Magician of Time: The Timer in Siemens PLC TIA Portal Platform

Introduction

Time is often viewed as a magician by people, quietly integrating all changes into its flowing water. In modern industrial automation, time also plays a crucial role. And in the Siemens PLC TIA Portal platform, timers are these magicians of time. They can precisely control the process flow and ensure the normal operation of equipment. This article will reveal the wonders of timers and explain them with official case studies.



The most commonly used timers in PLC programming are pulse timers, ON-delay timers, TONR (Retain ON-delay) timers, and OFF-delay timers. Some PLCs may include more than these four timers, but they are essentially some combination of these four basic types.

You can find these four timers in the Instruction tab of the Siemens TIA Portal. See the image below.





   TP Timer


When the result of the logical operation (RLO) at the input IN changes from "0" to "1" (positive signal edge), the pulse timer will set the programmed duration of the Q output.

The programmed time PT starts at the beginning of the instruction. While the output Q is set for a duration of PT, the detection of a new positive signal edge at the IN input has no effect on the signal state of the Q output.

You can scan the current time value at the ET output. The timer value starts from T#0s and ends when it reaches the value of the duration PT. When the time exceeds PT and the signal state at input IN is "0", the ET output is reset.

The pulse timer instruction can be placed inside or at the end of a network. It requires preceding logical operations.

Each invocation of the pulse timer instruction must be assigned to instance data that stores the timer data. The timing diagram of the pulse timer is shown in the figure below.


Example:

'TP_DB'.TP(IN := 'Tag_Start',           PT := 'Tag_PresetTime',           Q => 'Tag_Status',           ET => 'Tag_ElapsedTime');
    When the signal state of the "Tag_Start" operand changes from "0" to "1", the time preset by the PT parameter starts counting, and the "Tag_Status" operand is set to "1". The current time value is stored in the "Tag_ElapsedTime" operand.




      TON Timer


You can use the TON (ON-Delay) timer instruction to delay the setting of the Q output to the programmed time PT. The instruction starts when the result of the logical operation (RLO) at the input IN changes from "0" to "1" (positive signal edge). The programmed time PT begins at the start of the instruction.

When the time exceeds PT, the signal state of the output Q is "1". The output Q remains set as long as the start input remains "1". When the signal state of the start input changes from "1" to "0", the Q output resets.

When a new positive signal edge is detected at the start input, the timer function starts again.

The TON instruction can be placed inside or at the end of a network. It requires preceding logical operations.

Each invocation of the ON-Delay timer instruction must be assigned to instance data that stores the timer data. The timing diagram of the TON is shown in the figure below.



Example:

'TON_DB'.TON(IN := 'Tag_Start',             PT := 'Tag_PresetTime',             Q => 'Tag_Status',             ET => 'Tag_ElapsedTime');
When the signal state of the "Tag_Start" operand changes from "0" to "1", the time preset by the PT parameter starts counting. After this time period elapses, the signal state of the "Tag_Status" operand is set to "1". As long as the signal state of the "Tag_Start" operand remains "1", the "Tag_Status" operand will remain set to "1". The current time value is stored in the "Tag_ElapsedTime" operand. When the signal state of the "Tag_Start" operand changes from "1" to "0", the "Tag_Status" operand will be reset.



TOF Timer


You can use the Turn-Off Delay Timer (TOF) instruction to delay the reset of the Q output to the programmed time PT.

When the logical result (RLO) at the input IN changes from "1" to "0" (negative signal edge), the Q output will be set. When the signal state at input IN changes back to "1", the programmed time PT begins.

The output Q will remain set for as long as the PT is running. When the PT duration expires, the Q output resets. If the signal state of input IN changes to "1" before the PT duration expires, the timer is reset, and the signal state of output Q continues to be "1".

The Turn-Off Delay Timer instruction can be placed within a network or at the end of a network. It requires previous logical operations.

Each invocation of the "Generate Turn-Off Delay" instruction must be assigned to a data instance that stores the timer data. The TOF timing diagram is shown in the figure below.



EXAMPLE:

'TOF_DB'.TOF(IN := 'Tag_Start',             PT := 'Tag_PresetTime',             Q => 'Tag_Status',             ET => 'Tag_ElapsedTime');
When the signal state of the "Tag_Start" operand changes from "0" to "1", the "Tag_Status" operand will be set. When the signal state of the "Tag_Start" operand changes from "1" to "0", the time preset by the PT parameter starts counting. As long as the time is still counting, the "Tag_Status" operand will remain set. After the time has elapsed, the "Tag_Status" operand will be reset. The current time value is stored in the "Tag_ElapsedTime" operand.



TONR Timer


The Retentive On-Delay Timer (TONR) instruction is used to accumulate time values within the time period set by the parameter PT. When the signal state at the IN input changes from "0" to "1" (positive signal edge), time measurement is performed, and time PT begins.

While time PT is running, the recorded time value will accumulate as long as the signal state at the IN input remains "1".

The accumulated time will be written to the ET output. When the duration PT expires, the signal state of the output Q will be "1".

Even if the signal state of the IN parameter changes from "1" to "1" (negative signal edge), the Q parameter remains set to "0".

The R input resets ET and the Q output, regardless of the signal state of the start input.

The TONR instruction can be placed within a network or at the end of a network. It requires preceding logical operations.

A data instance to store timer data must be allocated for each invocation of the TONR instruction. TONR Timing Diagram


Example:

'TONR_DB'.TONR(IN := 'Tag_Start',               R := 'Tag_Reset',               PT := 'Tag_PresetTime',               Q => 'Tag_Status',               ET => 'Tag_Time'); 
When the signal state of the "Tag_Start" operand changes from "0" to "1", the time preset by the PT parameter begins to count. While this time value is being counted, the time values recorded while the signal state of the Tag_Start operand is "1" will be accumulated. The accumulated time value will be stored in the "Tag_Time" operand. When the time value specified in the PT parameter is reached, the signal state of the "Tag_Status" operand will be set to "1". The current time value is stored in the "Tag_Time" operand.



Extended Thinking


  1. Timers are widely used in automation engineering. Can you think of potential applications of timers in other fields?
  2. With the rapid development of PLC technology, the functions of timers are constantly expanding. Please list some emerging timer types and their application scenarios.
  3. Besides timers in PLC platforms, are you familiar with timers in other automated control systems? 
  4. Compare their characteristics and application areas.Timers can not only be used for time control but also combined with other sensors or devices to achieve more complex control logic. For example, how can we use timers and temperature and humidity sensors to control the irrigation system in a greenhouse?
  5. Timers also play an important role in the transportation field. For instance, timers on ships and aircraft can be used for tasks such as navigation timing, route planning, and positioning. Can you imagine the role of timers in these scenarios and how they are implemented?
  6. In industrial production, the accuracy of timers is crucial for ensuring product quality and production efficiency. Can you think about how to utilize the dynamic adjustment and calibration functions in PLC systems to improve the accuracy of timers?


Summary


Time, as an indispensable part of industrial automation, plays a crucial role in Siemens PLC TIA Portal through timers. Different types of timers can meet various control needs. This article introduces the basic principles and application examples of timers to readers, and stimulates deeper thinking about timers through extended discussions. It is hoped that through reading this article, readers can better understand and apply timer technology, contributing to the development of the industrial automation field.

Like my work? Consider a donation! 👇


FF