In Siemens S7-1200 and S7-1500 PLCs, timers play a crucial role. They enable precise time measurement in control programs, making them useful for signal filtering, pulse generation, delay, or signal hold functions.
This article describes the four main types of timers used in TIA Portal: TON (Timer On Delay), TOF (Timer Off Delay), TP (Pulse Timer), and TONR (Retentive On Delay).
All examples refer to S7-1200 and S7-1500 PLCs, although the timer logic remains identical for both families.
General Structure and Parameters of Timers
Timers in TIA Portal are implemented as IEC_TIMER structures, which are stored inside data blocks (DBs).
Each timer needs its own instance of this structure (an instance DB, a multi-instance or a tag in a global DB), which allows timers to operate independently.

The TP, TON, TOF, and TONR instructions share similar parameters:
- IN - Boolean input signal. Depending on the timer type, a signal of 1 (TRUE) or 0 (FALSE) starts or stops time counting.
- In TP, TON, and TONR timers, a rising signal (1) starts counting, while 0 stops it.
- In the TOF timer, the behavior is reversed.
- R - Reset input (Bool), available only in TONR. A signal of 1 resets the accumulated time and sets output Q to 0.
- PT - Preset Time (TIME). Defines how long the timer should run before Q changes state. The value is entered as T#<time> (e.g., T#5s) and internally stored as a 32-bit DInt value in milliseconds.
Changing PT during timing does not affect TP, TON, or TOF timers. For TONR, the new preset takes effect at the next start. - Q - Logical output (Bool). Indicates whether the preset time has elapsed. It can be used in further logic or for visualization purposes.
- ET - Elapsed Time (TIME). Displays the current elapsed time in milliseconds.

⚙️ Each IEC_TIMER structure should be assigned to only one timer to avoid unwanted interactions.
When programming in LAD, timer instructions should be placed at the end of the network, and it is recommended to use tag outputs (Q, ET) instead of directly accessing DB variables.
How the TON Timers in TIA Portal Works - On-Delay Timer
Principle of Operation
TON is the most commonly used timer in PLC programming. Timing starts when the input signal IN changes from 0 to 1.
If IN returns to 0 during timing, the timer is reset - both accumulated time and output Q return to 0 (ET = 0, Q = 0).
When ET reaches the preset time PT, output Q switches to 1. As long as IN remains high, Q also stays at 1. Once IN goes low again, the timer resets.

Typical Applications
Delayed signal activation is useful for:
- Filtering short pulses
- Soft-starting devices
- Delaying motor start after a start signal
- Ignoring short disturbances (e.g., button press must last longer than T#200ms to be accepted)
- Triggering actions after a defined delay
How the TOF Timers in TIA Portal Works - Off-Delay Timer
Principle of Operation
The TOF timer works opposite to TON. When the signal at IN changes from 1 to 0, the timer starts counting the preset time PT.
Output Q is already 1 while IN is 1 and stays active during the countdown. After the preset time expires, Q returns to 0.
If IN goes back to 1 during counting, the elapsed time is reset instantly and Q simply stays at 1.

Typical Applications
The TOF timer is used when a signal or device must remain active for a while after the control signal is removed, such as:
- A fan running for 30 s after being switched off
- Lighting turning off with a delay after motion sensor deactivation
- A valve remaining open for a defined period after signal loss
How the TP Timers in TIA Portal Works - Pulse Timer
Principle of Operation
The TP timer generates a pulse of fixed duration. Timing begins on the rising edge of IN (transition from 0 to 1).
When triggered, Q switches to 1 and remains in that state for the preset time PT.
Further changes at IN during the pulse are ignored and do not extend the timing period.
After PT elapses, Q automatically resets to 0. Changing PT while the timer is active has no effect on the ongoing pulse.

Typical Applications
TP timers are useful when you need to generate a short, fixed-length pulse, regardless of input duration, for example:
- Turning on an indicator lamp for 1 s after a button press
- Generating a one-shot start pulse for a drive
- Debouncing sensors or pushbuttons
How the TONR Timers in TIA Portal Works - Retentive On-Delay Timer
Principle of Operation
The TONR timer behaves similarly to TON but retains the elapsed time even after the input signal is turned off.
When IN = 1, the timer starts counting toward PT.
If IN goes back to 0 before PT elapses, counting pauses, but the elapsed time ET is stored.
When IN is set to 1 again, timing resumes from where it left off.
The timer resets only when R = 1.
Changing PT during timing does not affect the current cycle, but the new value is applied at the next start.

Typical Applications
Retentive timing is useful when total active time needs to be accumulated, such as:
- Recording total operating time of motors or pumps (hour meter)
- Measuring duration of alarms or limit violations
- Implementing interrupted delay sequences - timer continues after condition returns
How to declare an IEC timer in Siemens TIA Portal
When you drag a TON, TOF, TP or TONR timer instruction from the Basic instructions list into a network, TIA Portal opens the Call options dialog. There you decide where the timer data (IEC_TIMER) is stored:
- Single instance - TIA Portal creates a separate instance data block for the timer. You will find it in the project tree under Program blocks > System blocks. This is the simplest option for timers called in an OB or FC.
- Multi-instance - available when you call the timer inside a function block (FB). The timer is declared as a static variable of the FB, so every FB instance gets its own timer. This keeps the project tree clean and is the recommended way to build reusable blocks.
- Tag in a global DB - you can declare a variable of type IEC_TIMER (or TON_TIME, TOF_TIME and so on) in a global DB and use it as the timer instance.
The timer instruction is an FB internally, so the same rules apply as for any FB instance: one instance per timer call. On S7-1500 you can also use IEC_LTIMER with the LTIME data type for very long or very precise time values. Legacy SIMATIC (S5) timers are still available on S7-1500 for migrated STEP 7 code, while the S7-1200 uses IEC timers.
Timer in SCL - multi-instance example
In SCL you declare the timer in the static section and call it like any other function block. This TOF timer keeps a fan running for 30 s after the command is removed:
FUNCTION_BLOCK "FB_Fan"
VAR_INPUT
FanCmd : Bool;
END_VAR
VAR_OUTPUT
FanRun : Bool;
END_VAR
VAR
FanDelay : TOF; // multi-instance IEC timer
END_VAR
BEGIN
#FanDelay(IN := #FanCmd, PT := T#30S);
#FanRun := #FanDelay.Q;
END_FUNCTION_BLOCK
To reset timer values from the program, use the RESET_TIMER (RT) instruction. PRESET_TIMER (PT) loads a new time duration into the timer instance. For more SCL examples, see timers in SCL.
Why TIA Portal timers are not working - common problems
If a timer does not behave as expected, check these points first:
- The timer is not called every scan. If the timer instruction sits inside an IF branch, a jump or a block that is not called cyclically, IN is not evaluated and ET does not change as you expect. Call the timer in every CPU cycle and put the condition on IN.
- The same instance is used twice. Two timer calls with the same IEC_TIMER instance overwrite each other. Each timer needs its own instance.
- The input pulse is shorter than PT. A TON timer only sets Q if IN stays TRUE for the whole preset time. For short pulses, use TP or TOF.
- Wrong contact type. A normally closed contact on IN inverts the logic, so the timer starts when the signal disappears.
- Retentive data. A TONR timer accumulates time until R = 1. If the elapsed time should survive a power cycle, set the timer data as retain in the DB.
- PT = 0 or a wrong time format. Use the T# format, for example T#500MS or T#2S.
The easiest way to test timer logic is to simulate the program in PLCSIM and watch IN, Q and ET online in a watch table.
TIA Portal timers - FAQ
What is the difference between TON and TONR?
TON resets the elapsed time as soon as IN goes to 0. TONR (time accumulator) keeps the elapsed time when IN goes to 0 and continues counting when IN returns to 1. It is reset only with the R input.
How many timers can I use in an S7-1200 CPU?
IEC timers in S7-1200 and S7-1500 are limited only by the available memory of the CPU, because each timer is just an instance of a structure in a data block.
Can I use the same timer instruction in LAD, FBD and SCL?
Yes. TON, TOF, TP and TONR are the same IEC timer function blocks in all languages. Only the way you call them looks different. Counters work in a very similar way, see counters in TIA Portal. To practice timers on real projects, check our Siemens TIA Portal LAD/FBD course.
Summary
Timers in Siemens PLCs are powerful tools for time-based logic.
Understanding the behavior of TON, TOF, TP, and TONR allows you to create more reliable, stable, and flexible automation programs in TIA Portal.
If you want to learn more about PLC programming and timers in TIA Portal, check out our Premium Siemens S7-1200/1500 Programming course with certificate and teacher's support.


