TOF — Timer-Off-Delay

Pin layout

DirectionNameTypeDescription
InputINBOOLDrives Q TRUE on rising edge; starts the off-delay on falling edge
InputPTTIMEHow long Q stays TRUE after IN returns to FALSE
OutputQBOOLTRUE while IN is TRUE OR within PT after IN’s last falling edge
OutputETTIMEElapsed since IN’s last falling edge (0 while IN is TRUE)

Semantics

IN goes FALSE → TRUE  : Q := TRUE; ET := T#0s
IN stays TRUE         : Q stays TRUE; ET stays at 0
IN goes TRUE → FALSE  : start counting ET
ET reaches PT          : Q := FALSE
IN goes FALSE → TRUE again before PT : Q stays TRUE; ET reset

TOF is the symmetric opposite of TON: TON delays the rising edge of Q, TOF delays the falling edge.

Common use: drag-out time on a pump after a sensor signal disappears, debounce of a falling level, “stay armed for X seconds after the trigger releases”.

Example

VAR
    releaseDelay : TOF;
END_VAR

releaseDelay(IN := xLevelOk, PT := T#5s);

(* Q is TRUE while xLevelOk is TRUE, AND for 5s after it goes FALSE *)
xPump := releaseDelay.Q;

IEC reference

IEC 61131-3 third edition (2013), Annex F.7.2.

matiec conformance

Implemented per the standard.