TON — On-Delay Timer

TON in rungs.dev is the on-delay timer — starts timing when the rung goes true, sets the .DN bit when .ACC reaches .PRE, and resets when the rung goes false.

TON

Timer

timer

(EN)

Preset

preset

(DN)

Accum

accum

On-delay timer. Starts timing when the rung goes true; sets .DN when .ACC reaches .PRE. Resets the moment the rung goes false.

Operands

NameType
timerTIMER
presetDINT
accumDINT

preset and accum are pseudo-operands: they hold the value of .PRE and .ACC on the timer tag.

How It Works

Rung state.EN.TT.ACC.DN
True, .ACC < .PRE11counting up0
True, .ACC ≥ .PRE10stops at its current value1
False00reset to 00

Going false at any point resets the timer. TON is not retentive — use RTO if you need the accumulator to survive interruptions. The timer checks for completion only when the instruction runs. This means .ACC can pass .PRE before stopping; it is not forced back to .PRE.

Example — Delayed Alarm

Turn on an alarm five seconds after a fault appears.

0

Fault

TON

Timer

FaultTimer

(EN)

Preset

5000

(DN)

Accum

0

1

FaultTimer.DN

Alarm

  • Rung 1 runs the timer while Fault is active.
  • Rung 2 energizes Alarm once FaultTimer.DN is set.

Practice

Try TON in the On Delay exercise — switch an output on a set time after its input.

Common Mistakes

  • Referencing FaultTimer instead of FaultTimer.DN on a contact — the whole structure is not a BOOL.
  • Expecting the accumulator to survive a dropped rung — TON resets to zero. Use RTO for retentive timing.
  • Writing 0 to .ACC to restart a finished timer — .DN stays 1 while the rung remains true. Let the rung go false or use RES to clear and re-arm the timer.
  • Timers overview — members, units, and shared behaviour
  • TOF — off-delay counterpart
  • RTO — retentive timer

On this page