S5 Timer Calculator
Convert Siemens S5 KT timer values instantly to seconds, IEC format and S7 code.
Result
Enter a KT value or seconds to see results.
Why This Calculator?
If you have an old Siemens S5 program in front of you and need to migrate it to S7, the timers are almost always the first stumbling block. S5 uses the proprietary KT format with BCD encoding and four different time bases. S7 instead uses IEC timers (TON, TOF, TP) with the TIME data type (T#30s). There is no automatic 1:1 conversion between these two worlds — every single timer must be translated individually.
This calculator handles exactly that conversion. Enter a KT value and instantly receive: the time value in seconds, the IEC equivalent in T# format, the matching SCL call for TIA Portal, and the S7 STL function call. The calculator also works in reverse: enter a time in seconds and receive all possible S5 KT variants with the best available resolution.
How Is the S5 KT Format Structured?
An S5 timer value consists of two parts: a time value (BCD-encoded) and a time base. The notation is always KT [value].[time base]. In memory, it is stored as a 16-bit word — shown here for KT 030.2 (= 30 seconds):
The upper two bits (15–14) are unused. Bits 13–12 contain the time base as a 2-bit value (here 10 binary = 2, corresponding to 1 second resolution). The remaining 12 bits encode the numeric value as three BCD nibbles: 0000 (hundreds) / 0011 (tens = 3) / 0000 (ones = 0).
S5 was developed in 1979, when displays and inputs were often directly BCD-encoded. For S7 this is irrelevant — IEC timers use the binary TIME data type in milliseconds. This architectural decision from the 70s is the only reason why the conversion is so error-prone today.
Which Timer Type to Use?
The S5 → IEC mapping is not trivial because two S5 types are each mapped to one IEC type. As a rule of thumb for migration:
- SI → TPSimple pulse, resettable via reset input.
- SE → TPIdentical to SI in IEC semantics. The S5 behavior of extending on a new edge is built into TP.
- SD → TONThe standard on-delay. 90 % of all S5 timers in practice are SD.
- SS → TON with flag logicTON resets when the input drops. SS retained the elapsed time in S5. Solution: TON with an additional flag that stores the state — or the IEC block TONR in S7-1500.
- SA → TOFOff-delay, direct 1:1 conversion.
Real-World Conversion Examples
These values are taken from actual S5 programs and show the typical patterns found in legacy plants:
1. Conveyor Belt Startup: KT 030.2
30 × 1 s = 30 seconds. Time base 2 is the most common choice for medium delays in the seconds range.
Typical use: startup delay of a conveyor belt, on-delay for a pump.
U E 1.0
L KT 030.2
SD T 1
U T 1
= A 4.0"Timer_Conveyor"(
IN := "Start_Button",
PT := T#30s
);
"Motor_Conveyor" := "Timer_Conveyor".Q;2. Input Debounce Time: KT 020.1
20 × 100 ms = 2000 ms = 2 seconds. Time base 1 (100 ms) instead of 2 (1 s) because debouncing needs finer resolution.
Typical use: debouncing a mechanical switch, filtering short signal spikes.
U E 0.5
L KT 020.1
SD T 5"Timer_Debounce"(
IN := "Input_Switch",
PT := T#2s
);3. Fast Pulse Monitoring: KT 050.0
50 × 10 ms = 500 ms = 0.5 seconds. Time base 0 offers the best resolution but a maximum duration of 9.99 seconds.
Typical use: monitoring an incremental encoder, short timeout windows in fast processes.
U E 2.0
L KT 050.0
SE T 10"Timer_Pulse"(
IN := "Start_Condition",
PT := T#500ms
);4. Long-Duration Shutdown: KT 600.3
600 × 10 s = 6000 s = 1 h 40 min. Time base 3 is the only way to express such long durations in a single S5 timer.
Typical use: heating system cooldown, drying time for a process, standby timeout.
UN E 3.0
L KT 600.3
SA T 20"Timer_Cooldown"(
IN := NOT "Stop_Signal",
PT := T#1h40m
);5. Maximum Duration: KT 999.3
999 × 10 s = 9990 s = 2 h 46 min 30 s. This is the upper limit of the S5 timer.
For longer times, S5 programmers cascaded multiple timers or combined timers with counters. In S7-1500 you can use T#24h or longer directly — no cascading required.
L KT 999.3
SD T 100"Timer_Long"(
IN := "Start_Condition",
PT := T#2h46m30s
);Common Mistakes in Timer Migration
From analyzing hundreds of S5 programs, these are the five mistakes that keep appearing during migration:
Mistake 1: Confusing the Time Base
The .0 at the end of a KT constant is time base 0 (= 10 ms), not 0 = seconds. This error leads to timers that run 100× too fast: a KT 500.0 is 5 seconds, not 500 seconds.
Mistake 2: Treating Retentive Timers (SS) Like TON
SS retains the elapsed time in S5, even if the input briefly drops. TON in S7 resets completely. Anyone migrating SS directly to TON creates subtle errors in step chains that only appear under load (during power cycles or brief power outages).
Solution: Create a custom function block with a flag for the elapsed state, or use TONR (retentive on-delay) in S7-1500.
Mistake 3: BCD Overflow in Manual Calculation
Anyone calculating the KT value programmatically (e.g. from an MW input) must respect BCD encoding. A value of KT 100.2 is not the same as the binary value 100 — it is the BCD value 0001 0000 0000. For programmed timer adjustments, this is the most common cause of: the timer runs incorrectly even though the program looks right.
Mistake 4: Off-Delay (SA) Migrated Incorrectly
SA turns the output off with delay after the input drops. Migrating this with TON instead of TOF completely inverts the behavior. The machine test looks plausible — until the first emergency stop button fails to reliably de-energize a hazardous area.
Solution: Always use TOF for SA, never TON.
Mistake 5: Timers in Step Chains Forgotten
S5 step chains (step advancement with time monitoring) are structured completely differently in S7 (GRAPH or custom SCL structure). Anyone translating the timers 1:1 without adapting the surrounding step logic ends up with a step chain that runs, but fails to reset correctly in error situations.
Related Tools and References
S5 → S7 Address Converter→
Convert I, Q, M, DB addresses between S5 and S7
AWL Command Lookup→
All 40 S5 AWL commands with S7 equivalents and SCL examples
S5 AWL Command Converter→
Translate entire AWL code lines automatically into S7 STL and SCL
Timer Conversion Tables→
Complete KT → IEC conversion tables with 50+ examples
S5 Command Reference→
Complete technical reference of all S5 AWL instructions
S5 to S7 Migration: Complete Guide→
Step-by-step guide for the complete S5→S7 migration
S5 Timer Types & S7 Equivalents
| S5 | Function | S7 Function | IEC Type |
|---|---|---|---|
| SI | Pulse | S_PULSE | TP |
| SE | Extended Pulse | S_PEXT | TP |
| SD | On-Delay | S_ODT | TON |
| SS | Retentive On-Delay | S_ODTS | TON |
| SA | Off-Delay | S_OFFDT | TOF |
Time Base Reference
| Code | Resolution | Max Value | Max Duration |
|---|---|---|---|
| 0 | 10 ms | 999 | 9.99 s(9.99 s) |
| 1 | 100 ms | 999 | 99.9 s(1 min 39.9 s) |
| 2 | 1 s | 999 | 999 s(16 min 39 s) |
| 3 | 10 s | 999 | 9990 s(2 h 46 min 30 s) |
Frequently Asked Questions
What does KT 030.2 mean in Siemens S5?
How does S5 encode timer values in BCD format?
How do I convert S5 timers to S7?
What time bases exist for S5 timers?
What is the maximum S5 timer duration?
What is the difference between SD and SS in S5?
Can I use S5 timers unchanged in TIA Portal?
How do I identify a timer in an S5 program?
How many timers does an S5 system have?
What happens with KT values above 999?
Can the calculator also convert from seconds back to KT?
Does the calculator also convert between S7 timers?
Convert an entire S5 program?
PLCcheck Pro analyzes your complete S5 code — all timers, counters, addresses and function blocks — and generates S7 SCL with full documentation and a complete IEC timer list for the entire program.
Try PLCcheck Pro →Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7 and TIA Portal are trademarks of Siemens AG.