PLCcheck

S5 Timer Calculator

Convert Siemens S5 KT timer values instantly to seconds, IEC format and S7 code.

Quick Presets

Result

Enter a KT value or seconds to see results.

KT-Wert → SekundenSekunden → KT-WertKT-WertKT 030.2100ms1s3s30s100s5minERGEBNISDauer30,0 sIEC-FormatT#30sZeitbasis2 (1 s)Hex (BCD)0x2030SCL (STRUKTURIERTER TEXT)"Timer_Foerderband"(IN := "Start_Taster",PT := T#30s
Umrechnung von KT 030.2: 30 × 1 s = 30 Sekunden → T#30s

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):

Example: KT 030.2 = 0x203001501411301201101009080706151403020100UnusedBit 15-14Time Base= 2 (1s)HundredsBCD = 0TensBCD = 3OnesBCD = 0Zeitbasis 2 × Wert 030 = 1s × 30 = 30 Sekunden→ IEC: T#30s

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.

S5 AWL
      U     E 1.0
      L     KT 030.2
      SD    T 1
      U     T 1
      =     A 4.0
S7 SCL
"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.

S5 AWL
      U     E 0.5
      L     KT 020.1
      SD    T 5
S7 SCL
"Timer_Debounce"(
    IN := "Input_Switch",
    PT := T#2s
);
PLCcheck ProTimer & Zähler · 7 Einträge gefundenTIMERS5-WERTTYPDAUERIEC-CODEIEC-TYPBAUSTEINSTATUST 1KT 030.2SD30,0 sT#30sTONFB 10OKT 2KT 020.1SD2,0 sT#2sTONFB 10OKT 5KT 050.0SE500 msT#500msTPFB 12OKT 10KT 600.3SA1 h 40 minT#1h40mTOFFB 15OKT 15KT 999.3SS2 h 46 min 30 sT#2h46m30sTONFB 20PrüfenT 20KT 150.2SD150,0 sT#2m30sTONFB 22OKT 25KT 004.1SD0,4 sT#400msTONFB 25OK1 Timer mit Hinweis (SS → TON erfordert Merker-Logik) · 6 sauber konvertierbar
PLCcheck Pro analysiert alle Timer eines kompletten S5-Programms automatisch

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.

S5 AWL
      U     E 2.0
      L     KT 050.0
      SE    T 10
S7 SCL
"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.

S5 AWL
      UN    E 3.0
      L     KT 600.3
      SA    T 20
S7 SCL
"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.

S5 AWL
      L     KT 999.3
      SD    T 100
S7 SCL
"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 Timer Types & S7 Equivalents

S5FunctionS7 FunctionIEC Type
SIPulseS_PULSETP
SEExtended PulseS_PEXTTP
SDOn-DelayS_ODTTON
SSRetentive On-DelayS_ODTSTON
SAOff-DelayS_OFFDTTOF

Time Base Reference

CodeResolutionMax ValueMax Duration
010 ms9999.99 s(9.99 s)
1100 ms99999.9 s(1 min 39.9 s)
21 s999999 s(16 min 39 s)
310 s9999990 s(2 h 46 min 30 s)

Frequently Asked Questions

What does KT 030.2 mean in Siemens S5?
KT 030.2 is a timer constant in STEP 5 format. KT stands for Konstante Timer (timer constant). The value 030 is the BCD-encoded count (30), and .2 indicates time base 2 (1-second resolution). So KT 030.2 = 30 × 1 s = 30 seconds. The four time bases are: .0 = 10 ms, .1 = 100 ms, .2 = 1 s, .3 = 10 s.
How does S5 encode timer values in BCD format?
S5 timers are stored as a 16-bit word in Binary Coded Decimal (BCD) format. Bits 13–12 hold the time base (0–3), bits 11–8 the hundreds digit, bits 7–4 the tens digit, and bits 3–0 the ones digit. Bits 15–14 are unused. For example, KT 030.2 encodes as 0x2030.
How do I convert S5 timers to S7?
Three steps: 1) Replace the S5 timer instruction with its IEC equivalent (SI/SE → TP, SD/SS → TON, SA → TOF). 2) Convert the KT constant to IEC time format — KT 030.2 becomes T#30s. 3) In SCL, call the IEC timer function block with the converted time value. The calculator above handles step 2 automatically.
What time bases exist for S5 timers?
S5 timers use four time bases: 0 = 10 ms (max 9.99 s), 1 = 100 ms (max 99.9 s), 2 = 1 s (max 999 s), 3 = 10 s (max 9990 s ≈ 2 h 46 min). The time base is specified after the decimal point in the KT constant.
What is the maximum S5 timer duration?
The maximum S5 timer duration is 9,990 seconds (2 hours, 46 minutes, 30 seconds) set with KT 999.3 — value 999 at time base 3. For longer durations, multiple timers must be chained or combined with counters.
What is the difference between SD and SS in S5?
SD is a simple on-delay: if the input drops, the timer resets. SS is retentive: even if the input briefly drops, the timer retains the already elapsed time. In S7, SD maps directly to TON. SS requires either custom flag logic or the retentive timer TONR (S7-1500 only).
Can I use S5 timers unchanged in TIA Portal?
No. TIA Portal no longer supports the S5 timer commands (SI, SE, SD, SS, SA). For S7-1500, all S5 timers must be migrated to IEC timers (TON, TOF, TP). S7-300/400 offers compatibility blocks (S_ODT, S_OFFDT), but these are also deprecated since S7-1500.
How do I identify a timer in an S5 program?
Timers are addressed in S5 with the prefix T and a number (e.g. T 1, T 15, T 127). The timer load instruction is L KT [value], followed by a timer type instruction (SI, SE, SD, SS, SA) and the timer address.
How many timers does an S5 system have?
Depends on the CPU: S5-90U has 16 timers (T 0 to T 15), S5-100U has 128 timers, S5-115U up to 256 timers, S5-135U and S5-155U have 256 timers by default, expandable via system configuration.
What happens with KT values above 999?
Not possible. The KT value is limited to 999 (three BCD digits). For longer times, time base 3 was used in practice (up to 9990 s) or two timers were cascaded: the first timer starts the second one after completion.
Can the calculator also convert from seconds back to KT?
Yes. The calculator supports both directions. For reverse conversion, the optimal time base is automatically selected — the finest resolution that still fits the desired time within the 999 range. For 500 ms the calculator suggests KT 050.0 (50 × 10 ms), not KT 005.1.
Does the calculator also convert between S7 timers?
This calculator focuses on S5 → IEC. For S7-internal timer conversions (e.g. from S7-Classic S_ODT to S7-1500 TON_TIME) please use the command converter at /tools/command-converter.

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.