TON delays an output turning ON, TOF delays an output turning OFF, and TP generates a fixed-duration pulse after a rising edge. In Siemens TIA Portal, each IEC timer needs its own instance memory, a Boolean IN signal, and a TIME preset at PT; Q is the timed output and ET shows elapsed time.
- TON is ideal for start delays, signal validation and fault supervision.
- TOF keeps an output active for a defined time after its input turns OFF.
- TP produces one fixed pulse per valid rising edge; a continuously true input does not retrigger it.
How IEC PLC Timers Work
A PLC timer is a software function block evaluated during every scan. It does not pause the CPU. Instead, the controller compares elapsed time with a configured preset and updates the timer outputs.
The standard IEC interface is easy to recognize:
- IN: Boolean condition that starts or controls timing.
- PT: preset time, such as
T#5sorT#250ms. - Q: timer result used by the rest of the program.
- ET: elapsed time for online monitoring and diagnostics.
Give every timer call a unique instance. Reusing one instance for unrelated calls causes state to be overwritten and produces confusing results.
Want to practice this on real hardware?
Join a live Siemens PLC session with practical TIA Portal exercises—online, Pune classroom or corporate in-plant.
TON: On-Delay Timer
A TON starts accumulating time when IN becomes true. Q remains false while ET increases. When ET reaches PT, Q becomes true. If IN turns false at any point, Q resets and ET returns to zero.
Typical TON applications
- Delay a conveyor start until lubrication pressure is healthy.
- Validate that a level switch remains active before accepting it.
- Generate a no-feedback fault when a motor command is ON but feedback is missing.
- Debounce a noisy field signal with a short confirmation delay.
| IN | ET | Q | Meaning |
|---|---|---|---|
| FALSE | 0 | FALSE | Timer reset |
| TRUE, ET < PT | Increasing | FALSE | Delay in progress |
| TRUE, ET ≥ PT | PT | TRUE | Delay complete |
TOF and TP Timers
TOF: off-delay
When TOF input is true, Q becomes true immediately. When IN changes to false, timing begins and Q stays true until ET reaches PT. TOF is useful for cooling-fan overrun, delayed lamp shutdown and keeping extraction running after a machine stops.
TP: pulse timer
A rising edge at IN turns Q on for exactly PT. After the pulse begins, its duration normally continues even if IN goes false. The input must return false and rise again before another pulse can be triggered.
| Need | Instruction | Example |
|---|---|---|
| Wait before turning ON | TON | Start permissive confirmation |
| Wait before turning OFF | TOF | Ventilation fan overrun |
| Fixed one-shot output | TP | Reject-solenoid pulse |
Programming Workflow and Troubleshooting
- Describe the desired timing in plain language and choose TON, TOF or TP.
- Create meaningful tags for input, preset, output and elapsed time.
- Insert the IEC timer and assign a unique instance.
- Use a TIME literal or validated TIME variable for PT.
- Compile, simulate and monitor IN, PT, Q and ET together.
- Test normal operation, interrupted timing, rapid toggling, power recovery and manual reset.
| Symptom | Likely cause | Check |
|---|---|---|
| Timer never finishes | IN drops during timing or PT is wrong | Trend IN and ET online |
| Two timers affect each other | Shared instance | Assign a unique IEC instance to each call |
| Pulse repeats unexpectedly | No clean edge or logic retriggers IN | Monitor the trigger and add edge detection |
| Unexpected state after restart | Retentivity assumption | Review instance DB retentivity and recovery design |
Hands-On Lab: Compare TON, TOF and TP in TIA Portal
Hands-on- TIA Portal V16 or later with PLCSIM, or an S7-1200/S7-1500 trainer
- Boolean tags Test_Enable and Test_Pulse plus monitored Q/ET tags
- Use only internal bits or indicator lamps for this exercise
- Estimated time: 20 minutes
Create three timer networks
Insert TON with PT=T#5s, TOF with PT=T#3s and TP with PT=T#2s. Give each call a separate instance.
Test TON
Turn Test_Enable ON, watch ET increase and confirm Q turns ON at five seconds. Turn Test_Enable OFF before PT and repeat.
Test TOF
Turn Test_Enable ON and confirm Q is immediate. Turn it OFF and measure how long Q remains true.
Test TP and edge behavior
Create one rising edge on Test_Pulse, hold it true, then return it false and create another edge.
Your monitored values match every expected result, abnormal cases have been tested, no force remains active, and the final project revision and test evidence are saved.
Frequently asked questions
Does a PLC timer stop the program scan?
No. The CPU continues scanning the complete program while the timer function block updates its state each cycle.
Can multiple timer calls use the same instance?
Unrelated timers should not share an instance because the stored state will be overwritten. Assign a unique instance or dedicated multi-instance member to every timer.
Which timer should I use for sensor debounce?
A short TON is commonly used when the signal must remain continuously true before it is accepted. Confirm the delay is compatible with the machine speed and safety requirements.
