Loading local progress…
Course
Practise in
Level 1, 0 XP · your progress
← Course
Stage 4 · Wait, then act · 6 min

Make time explicit

I can predict an on-delay and an off-delay scan by scan.

Practise it now: Wait for the process Free, no sign-up. New to this? Read the lesson first.

1. Why it matters

If a pump starts on every accidental tap of a button, water goes where nobody wanted it. If a pipe wash stops too soon, liquid is left behind.

2. The idea in plain words

A measures time. It keeps counting across many . Call the same declared timer every scan, so it remembers the time so far.

An waits before it turns on. An keeps its on for a while after its goes off.

Example: a 200 ms on-delay ignores a quick accidental tap on Start. The tap never lasts 200 ms, so the pump stays off.

In Siemens, Delay is a TON_TIME instance: the timer’s own block of memory. You call it as #Delay(IN := #Start, PT := T#200ms).

Q is the done output: it turns when the time is up. ET is the elapsed time so far. TOF_TIME is the Siemens off-delay.

Logix uses TON and TOF with TIMER . (ST) and use TONR and TOFR with FBD_TIMER tags.

In ST, set TimerEnable, PRE (the time) and Reset first. Then call the instruction.

The R in TONR means it has a reset. It does not mean retentive, which is a timer that keeps its time when its input goes off.

3. See it happen

Siemens SCL · TIA Portal V20
// Delay is already a Static TON_TIME instance.
#Delay(IN := #Start, PT := T#200ms);
#PumpOn := #Delay.Q;

On the first scan with Start TRUE, has 20 ms already passed?

Decide your answer first. Then step through the scans to check it.

Input or eventResult
First scan with Start TRUE?
Nine more scans?
Eleventh scan overall?
On-delay: Start FALSE?
Off-delay: Start TRUE, then FALSE?
Off-delay: Start TRUE again before expiry?

A mistake to look for

Using a new timer instance every scan, so it never builds up time. Or thinking TONR is retentive because its name ends in R. The R means it has a reset.

4. Vendor notes

Siemens notes

The mission already declares Delay as a Static timer instance.

TON_TIME (on-delay): IN TRUE starts timing. Q turns TRUE when the time reaches PT. ET shows the time so far.

TOF_TIME (off-delay): Q turns on with IN. When IN goes FALSE, Q stays on for PT. A fresh IN TRUE cancels that off-delay.

An on-delay loses its time when IN goes FALSE. A retentive timer keeps its time until you reset it. This lesson explains the difference, but there is no retentive timer exercise yet.

5. On site

At a factory wash station, the operator must hold Start for a moment before the pump runs. A quick tap should do nothing.

If every accidental tap starts the pump, water sprays into the wash area. The delay tells a deliberate hold from a brush of the button.

Where you'd find thisWater for the top floors

In a block of flats, a basement tank holds water from the mains. Two pumps push it up to the taps above. One runs while the other waits as a spare. A low-water switch stops the pumps before the tank runs dry.

  1. Street mainsWater enters the building
  2. Storage tankHolds a supply for the pumps
  3. Water pumpsPush water to the floors aboveYou are here
  4. Taps upstairsResidents use the water they need
On a real site: places, parts and safety
  • Block of flats — pushing water up to the top floors
  • Brewery — sending hot water to a brewing tank
  • Water-treatment works — moving water between filter tanks
  • Office building — pumping water round the heating pipes

Recognise it on site

  • The reservoir stores the water. On this practice rig the water flows back into it, so normal pumping never empties it.
  • An electric motor spins the pump to push water through the pipe. A guard covers its moving shaft.
  • The standby pump is a spare on the same pipes. It takes over when the main pump cannot run.
  • The flow transmitter, a meter in the pipe, measures how much water passes each second.
  • The pressure gauge shows how hard the water pushes against the pipe walls.
  • The controller cabinet holds the PLC, the industrial computer that runs your code. It also holds the switches that power the motors.

A low-water switch can take away permission to run. The pump must stop before it runs dry and damages its seal.

The PLC can say ON even when a pump has failed. Check the measured flow as well as the command.

The Stop input in these exercises is not an emergency stop. Real machines also need guards, emergency stops and a safe way to cut the power.

The sizes, timings and cutaways are teaching choices, not a drawing of any one real installation.

6. Try it on the rig

In the Inputs tab, switch Start on. Press Step scan, one scan at a time, until you pass the preset time. Watch the elapsed time and the done bit.

Open the mission, make a prediction, run the equipment, then test your programme. Passing the tests completes practice; reading this page alone does not.

07. Wait for the process08. Finish the purge09. Review the AI: A fresh delay

7. Check your understanding

Predict a new case. A wrong answer gives you an explanation and another try.

1. Start has just turned TRUE, and this is the first time the timer runs. What does it show?

Rockwell ST · Delay is FBD_TIMER
Delay.TimerEnable := Start;
Delay.PRE := 200;
Delay.Reset := FALSE;
TONR(Delay);
Choose your answer

2. Start falls FALSE after being TRUE. What does Q do immediately?

Siemens SCL · Delay declared TOF_TIME
#Delay(IN := #Start, PT := T#200ms);
#PumpOn := #Delay.Q;
Choose your answer

3. Does the R in TONR mean it is a retentive timer?

Choose your answer