Off-delay timer TOF

Keeps DN on for PRE after the rung goes false.

TagAfter two scans
FanRunOnPRE 5000 ACC 0 EN 0 TT 1 DN 1
Run0

How it works

DN is 1 while the rung is true. After the rung goes false it times; DN stays 1 until ACC reaches PRE, then clears.

How it's used

Use TOF to keep something on after its rung goes false, such as a cooling fan after a motor stops.

TagValue
Motor0
FanRunOnPRE 5000 ACC 0 EN 0 TT 1 DN 1
Fan1

Motor is off. Fan stays on until ACC reaches 5000.

Operands

OperandData typeRead or write
TimerTIMERReads and writes

Inside a TIMER tag

MemberTypeMeaning
.PREDINTPreset: the time to reach, in ms
.ACCDINTAccumulated: the time so far, in ms
.ENBOOLOn while the rung is true
.TTBOOLOn while the timer is timing
.DNBOOLOn while the rung is true and through the off delay; clears when the delay ends

Common mistakes

  • Waiting for DN to come on laterA TOF turns DN on at once. The delay happens after the rung goes false.
  • Using one TIMER tag in two timersEach timer writes ACC, TT and DN, so the first one in the scan changes them before the next one runs. Problems shows this as written by 2 timers. Give each timer its own tag, unless you want that order.

Learn it in a lesson

Related