Timers and Counters in PLCs: The Building Blocks of Process Control
All articles

Timers and Counters in PLCs: The Building Blocks of Process Control

TON, TOF, CTU — three instructions that control most of industrial automation. Here's how they work and when to use each one.

February 6, 2026·6 min read·PLC Fundamentals

In traditional software development, managing time is a matter of scheduling tasks or setting timers that fire callbacks. In a PLC, time is a tangible resource measured in milliseconds and tied directly to the scan cycle. Timers and counters are not background threads; they are deterministic function blocks that execute every scan and govern the physical sequence of a machine.

Understanding the three core instructions—TON, TOF, and CTU—provides the foundation for nearly every automation sequence, from delaying a conveyor startup to counting parts for packaging.

Timer On Delay (TON)

The TON instruction introduces a waiting period before an action occurs. It is the most frequently used timer in industrial control.

When the enable input to a TON block transitions from false to true, the timer begins accumulating elapsed time. The output bit of the timer remains false during this accumulation. Only when the accumulated value reaches or exceeds the preset value does the timer output become true. If the enable input becomes false at any point, the accumulated time resets to zero and the output turns off.

This behavior is useful in several common scenarios:

Application

Description

Motor Start Delay

Prevent simultaneous starting of large motors to reduce electrical inrush current.

Debounce Input

Ignore a sensor signal unless it remains active for a minimum duration, filtering noise.

Fault Confirmation

Require an alarm condition to persist before triggering a shutdown, avoiding nuisance trips.

The TON timer provides predictable, repeatable delays that are immune to variations in CPU load because they rely on the PLC's internal system clock rather than software loop iterations.

Timer Off Delay (TOF)

The TOF instruction operates in the opposite direction. It is designed to hold an output true for a specified period after the controlling input has become false.

When the enable input of a TOF block becomes true, the output immediately becomes true and the accumulated value is set to zero. The timer does not count while the enable remains true. When the enable input transitions from true to false, the timer begins accumulating time. The output remains true during this counting period. Once the accumulated time reaches the preset value, the output turns false.

This functionality addresses situations where a process must continue briefly after a stop command is issued.

Application

Description

Cooling Fan Run-On

Keep a cooling fan operating for a set time after a machine halts to dissipate residual heat.

Lubrication Cycle

Continue oil flow after a spindle stops to ensure bearings are coated.

Alarm Acknowledgment

Maintain a visual indicator long enough for an operator to notice a transient fault.

Count Up (CTU)

While timers measure duration, counters measure occurrences. The CTU instruction increments an internal integer value each time its count input transitions from false to true.

A CTU block maintains its accumulated count even when the count input is false. The accumulated value only resets when a separate reset input receives a true signal. When the accumulated count reaches or exceeds a preset limit, the counter's output bit becomes true. The counter will continue to count upward beyond the preset unless limited by the data type maximum, though the output bit remains true once the preset is reached.

The CTU instruction is essential for batch processing and production tracking.

Application

Description

Parts Batching

Energize a diverter gate after a specific number of products pass a photo eye.

Maintenance Intervals

Trigger a preventive maintenance warning after a machine completes a set number of cycles

Indexing

Move a rotary table forward by one position after receiving a fixed number of encoder pulses.

Selecting the Correct Instruction

The choice between TON, TOF, and CTU depends entirely on the physical requirement of the process.

Use a TON when the event must follow a delay after the start condition. Use a TOF when the event must persist for a delay after the stop condition. Use a CTU when the event is based on the quantity of discrete occurrences rather than elapsed time.

All three instructions operate synchronously within the PLC scan cycle. Their internal values update once per scan, ensuring consistent and predictable behavior regardless of the complexity of the rest of the program. This deterministic approach to time and counting is what allows industrial systems to coordinate hundreds of interdependent motions with sub-second precision, year after year.

Discussion

Sign in to join the discussion.

Sign in →

No comments yet. Be the first.