SCL Timer Functions: TON, TOF, TP, TONR
SCL timer function reference for Siemens TIA Portal. IEC timers TON (on-delay), TOF (off-delay), TP (pulse), TONR (accumulating). Syntax, timing diagrams, and examples.
SCL Timer Functions: TON, TOF, TP, TONR
Siemens S7-1200/1500 supports IEC 61131-3 timer function blocks. Each timer instance requires its own instance data (either a named instance or multi-instance in an FB).
TON — On-Delay Timer (Einschaltverzögerung)
Output Q goes TRUE after the input IN has been continuously TRUE for the duration PT.
Syntax:
#TON_Instance(IN := #Start_Condition,
PT := T#5s);
#Delayed_Output := #TON_Instance.Q;
#Elapsed := #TON_Instance.ET;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| IN | BOOL | Start input — timer runs while TRUE |
| PT | TIME | Preset time (duration) |
| Q | BOOL | Output — TRUE after PT has elapsed |
| ET | TIME | Elapsed time (0 to PT) |
Behavior:
- IN goes TRUE → timer starts counting
- ET reaches PT → Q goes TRUE
- IN goes FALSE before PT → timer resets, Q stays FALSE
- IN goes FALSE after Q is TRUE → Q goes FALSE, ET resets
S5 equivalent: SD (Einschaltverzögerung) — exact match.
TOF — Off-Delay Timer (Ausschaltverzögerung)
Output Q goes TRUE immediately when IN goes TRUE. When IN goes FALSE, Q stays TRUE for the duration PT.
Syntax:
#TOF_Instance(IN := #Motor_Running,
PT := T#10s);
#Fan_Output := #TOF_Instance.Q; // Fan runs 10s after motor stops
Behavior:
- IN goes TRUE → Q goes TRUE immediately
- IN goes FALSE → timer starts counting
- ET reaches PT → Q goes FALSE
- IN goes TRUE before PT → timer resets, Q stays TRUE
S5 equivalent: SA (Ausschaltverzögerung) — exact match.
TP — Pulse Timer (Impulstimer)
Output Q goes TRUE for exactly the duration PT after a rising edge on IN. The output runs for the full duration regardless of the input state.
Syntax:
#TP_Instance(IN := #Trigger,
PT := T#2s);
#Pulse_Output := #TP_Instance.Q; // TRUE for exactly 2 seconds
Behavior:
- Rising edge on IN → Q goes TRUE, timer starts
- ET reaches PT → Q goes FALSE
- IN state during timing has NO effect on Q (differs from S5 SI!)
- New rising edge while timer is running is ignored (NOT retriggerable, differs from S5 SE!)
S5 equivalent: SI and SE are approximately TP, but with important differences:
- S5 SI is "cut short" when input goes FALSE → TP is not
- S5 SE is retriggerable → TP is not
- For exact S5 behavior, use S_PULSE (for SI) or S_PEXT (for SE)
TONR — Accumulating On-Delay Timer (S7-1500 only)
Accumulates time across multiple input pulses. The timer does NOT reset when IN goes FALSE — it pauses and continues when IN goes TRUE again.
Syntax:
#TONR_Instance(IN := #Condition,
R := #Reset,
PT := T#60s);
#Total_Output := #TONR_Instance.Q;
#Accumulated := #TONR_Instance.ET;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| IN | BOOL | Run input — timer counts while TRUE |
| R | BOOL | Reset input — resets ET to 0 |
| PT | TIME | Preset time (total accumulated duration) |
| Q | BOOL | Output — TRUE when ET reaches PT |
| ET | TIME | Accumulated elapsed time |
Behavior:
- IN TRUE → timer counts up
- IN FALSE → timer pauses (ET keeps its value)
- IN TRUE again → timer continues from where it paused
- ET reaches PT → Q goes TRUE
- R pulse → ET resets to 0, Q goes FALSE
S5 equivalent: There is NO S5 equivalent. S5 SS (speichernde Einschaltverzögerung) is sometimes confused with TONR, but SS does NOT accumulate — it starts once and runs to completion. TONR accumulates across multiple pulses.
Availability: TONR is available on S7-1500 only (not on S7-300, S7-400, or S7-1200).
Timer Summary Table
| Timer | Full Name | Q goes TRUE | Q goes FALSE | S5 Equivalent |
|---|---|---|---|---|
| TON | On-Delay | After IN=TRUE for PT | When IN goes FALSE | SD (exact) |
| TOF | Off-Delay | Immediately when IN=TRUE | PT after IN goes FALSE | SA (exact) |
| TP | Pulse | On rising edge of IN | After PT (always full duration) | SI/SE (approximate) |
| TONR | Accumulating | When accumulated ET ≥ PT | On R (reset) | None |
Declaration Example (FB with Multi-Instance)
VAR
#Delay_Timer : TON; // On-delay instance
#Fan_Timer : TOF; // Off-delay instance
#Pulse_Timer : TP; // Pulse instance
#Accum_Timer : TONR; // Accumulating instance (S7-1500 only)
END_VAR
Part of the SCL Reference. See also: S5 Timer Types to S7 Equivalents. Maintained by PLCcheck.ai.
Convert Your AWL Code to SCL
PLCcheck Pro analyzes your S5/S7 AWL code and generates SCL equivalents automatically. Upload your program and see the conversion side by side.
Related Articles
S5 Timer Conversion: KT Values to IEC Timers
Complete guide to converting Siemens S5 KT timer values to S7 IEC timers (TON, TOF, TP). Includes BCD format explanation, conversion table with 20+ examples, and behavior differences between S5 and IEC timers.
12 min read
migration-guideS7-300 to S7-1500 Migration: Complete Guide
Step-by-step guide for migrating Siemens S7-300 PLC programs to S7-1500 using TIA Portal. Covers hardware mapping, software migration wizard, optimized data blocks, AWL→SCL conversion, and common pitfalls.
15 min read
migration-guideSTL/AWL Deprecation in S7-1500: Why You Must Convert to SCL
Why AWL/STL runs only in emulation mode on S7-1500, what that means for performance and maintainability, and how to convert your STL code to SCL. Includes conversion strategy and code examples.
10 min read
Analyze your PLC code with AI
PLCcheck Pro explains, documents, optimizes, and migrates PLC code — automatically.
Try PLCcheck Pro →Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7, and TIA Portal are trademarks of Siemens AG.