LadderLogicOnline

Learn › Instructions

TOF: Timer Off Delay

A TOF is the mirror image of a TON. Its done bit turns on the moment the rung goes true, and stays on for the preset time after the rung goes false. Use it to keep something running for a while after the reason for running has gone.

How a TOF behaves

A TOF uses the same TIMER tag as a TON, with the same members: PRE, ACC, EN, TT and DN. What changes is when they turn on.

So TOF's DN means "the rung is true, or was true less than PRE ago". Before the rung has ever been true, DN is off and the timer sits idle.

A timeline

Here's a TOF named FanT with a 10.0 second preset, driven by a heater bit. The heater runs for a while, switches off, comes back on briefly, then switches off for good.

TimeRung (Heater)ACCENTTDN
0 s (heater on)true0 s101
20 s (heater off)false0 s011
26 sfalse6 s011
27 s (heater on again)true0 s101
30 s (heater off)false0 s011
40 sfalse10 s000

The fan bit (driven by FanT.DN) is on from 0 s all the way to 40 s. The short off period at 20 to 27 seconds never reached the preset, so the fan never stopped.

Common uses

Run-on fans and cooldowns. The classic example. A heater, motor or lamp needs cooling for a while after it switches off:

 |   Heater                                          |
 |----] [------------------------------[TOF  FanT  PRE 10.0s]--|
 |                                                  |
 |   FanT.DN                                  Fan    |
 |----] [------------------------------------( )----|
The fan runs whenever the heater is on, and for 10 seconds after.

Running a conveyor clear. A conveyor that feeds boxes should keep running for a few seconds after the last box passes the photo eye at its start, so the box reaches the end instead of stopping halfway.

 |   PE_In                                           |
 |----] [------------------------------[TOF  ClearT  PRE 4.0s]--|
 |                                                  |
 |   Run          ClearT.DN               Conveyor   |
 |----] [---------] [------------------------( )----|
Each box restarts the 4 second run-on. The belt stops 4 seconds after the last one.

Ignoring short dropouts. If a signal sometimes drops out for a split second (a box with a gap in it passing a photo eye, say), a short TOF on that signal bridges the gap. The DN bit only goes off when the signal has really gone.

TON or TOF?

TONTOF
Delaysturning onturning off
DN when the rung goes trueafter PREimmediately
DN when the rung goes falseoff immediatelyoff after PRE
Times while the rung istruefalse

A good test: ask whether the delay should happen when the condition appears, or when it disappears. "Wait 3 seconds after the button is pressed" is a TON. "Keep going for 3 seconds after the button is released" is a TOF.

You can always build a TOF out of a TON and an XIO (time the rung being false), and some programmers do, but the TOF says what you mean in one instruction.

Try it in the Playground

  1. Open the Playground and add a push button with the tag Heater.
  2. Build rung 0: XIC Heater then TOF FanT, and set the preset to 4.0 seconds.
  3. Build rung 1: XIC FanT.DN then OTE Fan.
  4. Press Run. Tap the button and watch Fan turn on at once, then stay on for 4 seconds after you let go. Tap again halfway through the delay and see ACC jump back to zero.

Common mistakes