Guide · 6 min read · Free to try

PLC timers explained: on-delay, off-delay and retentive

A timer makes a controller wait. There are three kinds, and the difference is when they start counting and what happens when the rung turns off. Each one is shown below scan by scan, then you build it in your browser.

Free in FORGE, the online PLC simulator. No install, and no account to start.

The three timers at a glance

TimerStarts timingDone bit (DN)When the rung turns offUse it to
On-delay (TON)When the rung turns onOn once ACC reaches PREResets to 0Wait before starting something
Off-delay (TOF)When the rung turns offOn at once, off after PREStarts timingKeep something running after a stop
Retentive (RTO)When the rung turns onOn once ACC reaches PRE, and stays onKeeps its timeAdd up time across stops

What is inside a timer

Every timer is one TIMER tag with five parts you read in your rungs.

  • PRE, the preset: the time to reach, in milliseconds. 3 seconds is 3000.
  • ACC, the accumulated time so far.
  • EN, enabled: on while the rung is true.
  • TT, timing: on while ACC is still climbing.
  • DN, done: the bit your output usually follows.

On-delay timer (TON): wait, then act

An on-delay timer counts while its rung is true. When ACC reaches PRE, DN turns on. If the rung turns off before then, ACC goes straight back to 0 and the wait starts over next time.

TON with PRE 1500 and a 500 ms scan. Run turns on at scan 2. ACC is still 0 that scan and adds 500 on each scan after. At 1500, DN turns on and TT turns off. When Run turns off, ACC returns to 0.Scan12345678910Run.EN.TT.DN.ACC0050010001500150015001500002 First true scan5 ACC = PRE

Recorded from a real run in FORGE: PRE 1500, one scan every 500 ms. ACC is still 0 on the first true scan.

Example: sound a horn before a conveyor starts

Start turns on a warning horn and a timer. The conveyor follows the timer’s done bit, so it moves only after the horn has sounded for the full preset.

TagValue
StartPB1
HornTimePRE 1200 ACC 1200 EN 1 TT 0 DN 1
Conveyor1

StartPB has been on for 1.2 s. HornTime.DN turned Conveyor on.

Off-delay timer (TOF): keep going after a stop

An off-delay timer turns DN on as soon as its rung is true. When the rung turns off, it starts counting, and DN turns off once ACC reaches PRE.

TOF with PRE 1500 and a 500 ms scan. DN turns on at scan 2, with Run. Run turns off at scan 5: DN stays on and ACC is still 0 that scan. ACC adds 500 on each scan after, and at 1500 DN turns off.Scan12345678910Run.EN.TT.DN.ACC0000050010001500150015002 DN on at once5 First false scan8 ACC = PRE

Recorded from a real run in FORGE: PRE 1500, one scan every 500 ms.

Example: run a cooling fan after the motor stops

The fan follows DN. While the motor runs, the fan runs. When the motor stops, the fan keeps going for the preset, then stops on its own.

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

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

Retentive timer (RTO): add up the time

A retentive timer counts while its rung is true and keeps ACC when the rung turns off. It carries on from there next time. Only a reset (RES) puts it back to 0.

RTO with PRE 1500 and a 500 ms scan. ACC is 0 on the first true scan and adds 500 on each true scan after. When Run turns off at scan 4, ACC keeps 500. It adds again when Run turns on, and DN turns on at 1500 and stays on.Scan12345678910Run.EN.TT.DN.ACC00500500500100015001500150015002 First true scan4 Run off: ACC kept7 ACC = PRE

Recorded from a real run in FORGE: PRE 1500, one scan every 500 ms. Run turns off at scan 4 and ACC keeps 500.

Example: a service lamp after one hour of pump running

The pump’s run contact drives the timer with a preset of 3,600,000 ms. Stops lose no time. The lamp follows DN, and the maintenance button resets the timer.

Which timer do I need?

  • Something should happen after a signal has been on for a while: on-delay.
  • Something should keep going for a while after a signal turns off: off-delay.
  • The total time matters, even across stops: retentive, with a reset.
  • A light should flash: two on-delay timers that restart each other. See the flasher.

Three mistakes beginners make

The preset typed in seconds

PRE is in milliseconds. A preset of 3 times out almost at once.

Expecting an on-delay timer to remember

A TON starts from 0 every time its rung goes false. Use an RTO to keep the time.

Two timers on one tag

Each timer writes ACC, TT and DN, so the second one overwrites the first. Give each timer its own tag.

Practise timers for free

Each exercise opens in FORGE and checks your rungs in simulation.

  • Delay the startUse an on-delay timer so the motor starts only after the button has been held for 3 seconds.Easy · 8 minFree
  • Run on after stopA cooling fan must keep running for 10 seconds after the motor stops. Use an off-delay timer.Medium · 10 minFree
  • Flash the warning lightFlash a warning light while a machine door is open: on for half a second, off for half a second.Medium · 9 minFree
  • Total running timeTrack how long a pump has run in total across starts and stops, and turn on a service lamp after one hour.Hard · 14 minFree
  • Traffic light sequenceRun a red, amber and green sequence with correct timings and a pedestrian request that is handled safely.Challenging · 28 minFree
  • The timer that never finishesA timer starts timing but never sets its done bit. Something resets it every scan. Find it and fix it.Hard · 15 minPro

Learn it in a course

Each course has a video, short steps, a quiz and a hands-on practical checked in FORGE.

On-delay timing

Wait a set time after an input turns on, then read the timer done bit. A reset clears it.

Intermediate · 25 min · Pro

Off-delay and retentive timers

Keep an output on after an input turns off, and keep a timer count when its input stops. A reset clears that count.

Intermediate · 25 min · Pro

Chained timers and a flasher

Start one timer when another is done, then loop two timers to flash a light.

Intermediate · 15 min · Pro

Courses are in the Pro and Student plans, with a 7-day free trial. See plans

Questions

What are the three types of PLC timer?

On-delay (TON) waits before turning on, off-delay (TOF) waits before turning off, and the retentive on-delay timer (RTO) adds up time across stops until it is reset.

What is the difference between an on-delay and an off-delay timer?

An on-delay timer delays the output turning on after its rung goes true. An off-delay timer turns the output on at once and delays it turning off after its rung goes false.

Why does my timer start again from zero?

An on-delay timer resets whenever its rung goes false, even for one scan. If the time should carry over, use a retentive timer and reset it yourself.

Can I practise PLC timers without a PLC?

Yes. FORGE runs ladder logic scan by scan in your browser. Five of the timer exercises are free and need no account to start.

Build your first timer now.

Open the Delay the start exercise, add an on-delay timer and watch ACC climb.