Skip to content

TOF — Timer Off Delay

Category
Timer / Counter
Type
Output
Availability
All platforms

TOF instruction block: Timer TOF[0], Preset 10000, Accum 0, with the EN and DN indicators lit and TT dark, as it sits while its rung is true


TOF (Timer Off Delay) keeps its done bit on for a preset time after its rung goes false. While the rung is true, DN is on and nothing is timing. When the rung goes false the accumulator starts counting; DN stays on until the accumulator reaches the preset, then drops. Use TOF to hold something on after its command disappears: a cooling fan that runs on after the heater stops, a light that stays lit after the door closes, a pump that runs on to clear a line. Do not use TOF to delay a turn-on; that is TON. Do not reset a TOF with RES, see Notes.


Operand Type Format Valid Range Required Description
Timer TIMER Tag name or Array[n] A TIMER tag owned by no other timer instruction Yes The structure that holds this timer’s preset, accumulator and status bits. One TOF per tag.
Preset DINT Whole milliseconds 1 to 2,147,483,647 (about 24.8 days) Yes How long DN stays on after the rung goes false. Stored in the tag as .PRE; editable online.
Accum DINT Milliseconds Read-only on the face — Time elapsed since the rung went false, .ACC.

The time base is always milliseconds.


EN, TT and DN are cleared and ACC is 0. A TOF whose rung is false at start-up does not time and its DN stays off; it must see a true rung first.

EN and DN set, TT clears, ACC is held at 0. The timer is armed but not timing.

On the first false scan after a true one, timing starts: EN clears, TT sets, and ACC counts up from 0 while DN remains on. When ACC reaches the preset, DN and TT clear and ACC stops at the preset. The timer then waits, with DN off, until the rung is true again.

Nothing special. The status bits and accumulator carry into the next scan.


Member Type Set when Cleared when
.EN BOOL The rung is true The rung is false
.TT BOOL The rung is false and ACC is below PRE ACC reaches PRE, or the rung goes true
.DN BOOL The rung is true ACC reaches PRE after the rung went false
.PRE DINT The preset, in milliseconds —
.ACC DINT Milliseconds since the rung went false; stops at PRE The rung goes true

XIC TOF[0].DN is the usual output: it is true while the rung is true and for one preset afterwards.


Scenario: An exhaust fan must run for ten seconds after the motor stops.

Tags:

  • MotorRun — Motor run output, BOOL
  • TOF[0] — element 0 of a TIMER array, Preset 10000
  • Fan — Exhaust fan, BOOL

Rung 1 (the off delay):

—|XIC MotorRun|———[TOF TOF[0] Preset 10000]———

Rung 2 (the output):

—|XIC TOF[0].DN|———(OTE Fan)———

Values while the motor runs: MotorRun = 1, TOF[0].DN = 1, TOF[0].ACC = 0, Fan = 1. The EN and DN indicators are lit.

Turn MotorRun off. The rung goes grey, but DN stays lit and Fan stays on. TT lights and the Accum climbs from 0. The screenshot below was taken partway through that ten seconds.

Figure 1 — Off delay in progress: MotorRun off, TOF TOF[0] with the Accum climbing toward 10000, DN and TT lit, EN dark

Values after ten seconds: TOF[0].DN = 0, TOF[0].ACC = 10000, Fan = 0. DN and TT both dark.

Turn MotorRun on again at any point and DN sets at once, the Accum returns to 0, and the fan runs. The ten seconds start over the next time the motor stops.


  • TON — Timer On Delay (delays the turn-on)
  • RTO — Retentive Timer On (accumulates across rung transitions)
  • TP — Pulse Timer (a fixed-width pulse independent of the rung)
  • XIO — Examine If Open (the condition in the screenshot project is an XIO)
  • Timer and Counter Instructions — Category index

DN is on while the rung is true. A TOF’s done bit does not mean “finished”; it means “on, or still within the off delay”. Wire outputs from .DN and read .TT when you need to know the delay is in progress.

Do not use RES on a TOF. RES clears DN and ACC immediately, cutting the off delay short and turning the output off with no delay at all. The SLC 500 manual carries the same warning. If a TOF must be cancelled, make its rung true instead.

The accumulator stops at the preset. After the delay has expired ACC reads exactly PRE until the rung is next true. It never runs past it.

Range. PRE and ACC are DINT (32-bit) on every board, so an off delay can be as long as 24.8 days.

Timer arrays. The example uses TOF[0], element 0 of a TIMER array named TOF. Each element is an independent timer with its own members; TOF[0].DN and TOF[1].DN are different bits.

Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-10 · Screenshots verified 2026-09-10