The Secrets of PLC Timers: 8 Examples to Master TON, TOF, and TP Functions

The Secrets of PLC Timers: 8 Examples to Master TON, TOF, and TP Functions

Hello everyone, I am Maple Leaf. Today, let’s talk about the amazing timers in PLCs—TON, TOF, and TP. These three brothers are the “time management masters” of industrial control, and when used correctly, they can make your programs stable and flexible.

What Do the Three Timer Brothers Look Like?

First, let’s get to know these three:

  • TON: On-delay timer, it activates after waiting for a period of time once the signal is received.
  • TOF: Off-delay timer, it remains active for a period of time after the signal is lost.
  • TP: Pulse timer, regardless of how long the input signal lasts, the output is fixed for a certain duration.

I remember when I was teaching my apprentice, he could never distinguish between these three. One time, I pointed to the automatic door in the factory and said, “Look, these are real examples of the three types of timers.”

TON Example: The Patient Waiter

Example 1: Debounce Start

In the workshop, the button is frequently mispressed, so we add a TON to make the device less “sensitive”:

// The button signal lasts for 0.5 seconds before starting the motor
|--[Start Button X0]--|--[TON T1,K50(0.5s)]--|---(Motor Start Y0)---|

Example 2: Process Wait

The injection molding machine needs to wait until the temperature is up to standard before it can start:

// After the heater starts, wait 30 seconds before allowing injection
|--[Heater Running M0]--|--[TON T2,K3000(30s)]--|---(Injection Allowed M1)---|

Example 3: Safety Interlock

After the safety door opens, the device must completely stop before it can be unlocked:

// After the safety door opens, the device decelerates, and completely powers off after 5 seconds
|--[Safety Door Open X1]--|--[TON T3,K500(5s)]--|---(Device Power Off Y1)---|
|--[Safety Door Open X1]--|---(Device Decelerate M2)---|

TOF Example: The Reluctant Farewell

Example 4: Delayed Light Off

The bathroom light stays on for a while after someone leaves:

// After a person leaves, the light stays on for 3 minutes
|--[Human Sensor X2]--|--[TOF T4,K18000(180s)]--|---(Lighting Y2)---|

Example 5: Cooling Fan Control

After the motor stops, the fan continues to run for a while to dissipate heat:

// After the main motor stops, the cooling fan runs for another 2 minutes
|--[Main Motor Running X3]--|--[TOF T5,K12000(120s)]--|---(Cooling Fan Y3)---|

TP Example: The Stubborn One

Example 6: Fixed Spraying Time

Agricultural irrigation, no matter how long you press, it sprays water for 10 seconds:

// Press the button, the water pump runs for a fixed 10 seconds
|--[Start Button X4]--|--[TP T6,K1000(10s)]--|---(Water Pump Y4)---|

Example 7: Conveyor Belt Pulse Control

Timed tapping of products on the packaging line to maintain spacing:

// Each time a product is detected, the push rod acts for 0.2 seconds
|--[Product Detection X5]--|--[TP T7,K20(0.2s)]--|---(Push Rod Y5)---|

Example 8: Alarm Pulse (Flashing Effect)

The fault indicator light flashes:

// When there is a fault, the alarm light flashes on for 0.5 seconds and off for 0.5 seconds in a loop
|--[Fault Status M3]--|--[TP T8,K50(0.5s)]--|---(Alarm Light Y6)---|
|--[Fault Status M3]--[T8 Output Inverted]--|---(Indicator Light Y7)---|

Practical Tips

  1. Remember Trigger Conditions: TON and TOF are level-triggered, while TP is edge-triggered.
  2. Don’t Forget the Units: Some PLCs use 100ms as a unit, while others use 10ms; setting it incorrectly could lead to a tenfold error!
  3. Don’t Rush During Debugging: Timers don’t lie, but people can misread the display. I like to test logic with short durations first during debugging.
  4. Combined Use: TON + TOF can create “interval delays,” such as executing an operation between 3 to 5 minutes after startup.

Finally, let me emphasize: don’t set timer durations too short (to avoid interference) or too long (to avoid affecting production rhythm). Generally, in industrial settings, debounce for buttons should be 0.1-0.2 seconds, safety delays should be at least 1-2 seconds, and process delays should be based on actual needs.

Alright, that’s it for today’s lesson on timers. Some say PLC programming is “the art of managing industry with time,” and that couldn’t be more accurate! Mastering timers will make your programs much more flexible.

Next time, we’ll talk about counters, so stay tuned!

Leave a Comment