PLC Timer Value Converter
Use this PLC Timer Value Converter to convert timer preset values and PLC timer ticks into milliseconds, seconds, minutes and formatted duration. Reverse-calculate timer presets from a required delay, or encode and decode Siemens S5TIME values.
-
What Is a PLC Timer Value Converter?
A PLC Timer Value Converter translates the numerical preset used by a programmable logic controller timer into an actual duration. Many PLC timer implementations represent time as a number of increments rather than storing seconds directly.
For example, a timer with a 100 millisecond time base and preset value 250 represents 25 seconds. Changing the time base to 10 milliseconds would make the same numerical preset represent only 2.5 seconds.
This calculator can also perform the reverse operation by determining the preset required for a desired delay.
PLC Timer Preset Formula
How to Convert PLC Timer Preset to Seconds
First convert the timer base to milliseconds and multiply it by the preset value.
PLC Timer Time Base
A timer time base specifies how much real time is represented by one timer increment or tick.
| Time Base | One Tick | Preset 100 | Preset 1000 |
|---|---|---|---|
| 1 ms | 0.001 s | 0.1 s | 1 s |
| 10 ms | 0.01 s | 1 s | 10 s |
| 100 ms | 0.1 s | 10 s | 100 s |
| 1 second | 1 s | 100 s | 1000 s |
These are useful generic bases, but the actual timer representation depends on the controller family and instruction.
Convert Required Time to PLC Timer Preset
To calculate a timer preset, divide the required duration by the timer base.
Why Timer Preset Rounding Matters
A timer can normally represent only multiples of its configured resolution. If the requested duration is not an exact multiple of the timer base, the PLC cannot represent that time exactly using an integer tick count.
The calculator reports the actual resulting duration and resolution error when rounding is necessary.
What Is IEC TIME?
IEC 61131-3 programming environments commonly provide a TIME data type for representing durations. Modern PLC timer instructions such as TON, TOF and TP often use a TIME value rather than an old-style timer-base preset.
A human-readable duration may appear in forms similar to:
Exact syntax and supported ranges can vary between PLC programming systems, but the underlying idea is a duration rather than a traditional timer counter.
TON, TOF and TP Timers
TON
On-delay timer. Its output becomes active after the configured input condition has remained true for the preset duration.
TOF
Off-delay timer. Its output remains active for the configured delay after the input condition changes.
TP
Pulse timer. Generates an output pulse having the configured duration.
Preset Time
The configured target delay or pulse duration used by the timer instruction.
What Is Siemens S5TIME?
S5TIME is a 16-bit time representation used by classic Siemens timer instructions. Instead of storing an arbitrary millisecond count directly, the word contains a time-base code and a three-digit BCD value.
S5TIME Time Bases
| Base Code | Resolution | BCD 001 | BCD 999 |
|---|---|---|---|
| 0 | 10 ms | 10 ms | 9.99 s |
| 1 | 100 ms | 100 ms | 99.9 s |
| 2 | 1 second | 1 s | 999 s |
| 3 | 10 seconds | 10 s | 9990 s |
How to Decode S5TIME
Consider hexadecimal S5TIME:
S5TIME BCD Encoding
The lower three digits of an S5TIME word are Binary Coded Decimal rather than a normal 12-bit hexadecimal integer.
For this reason an S5TIME value containing a BCD digit A through F in the lower three nibbles is invalid.
S5TIME Maximum Duration
The largest standard S5TIME value uses time base 10 seconds and BCD value 999.
How S5TIME Encoding Is Selected
When converting a duration into S5TIME, the tool searches the available time bases and selects the smallest resolution that can represent the value exactly with a BCD count from 0 through 999.
Timer Resolution vs Accuracy
Timer resolution is the smallest increment a particular representation can express. A 100 millisecond timer base cannot represent a requested delay of 1050 milliseconds exactly.
Higher Resolution
A smaller timer base provides finer control over the requested delay.
Larger Range
A larger timer base permits longer delays using the same numerical preset range.
Timer Preset vs Accumulated Value
The preset is the target timer value, while the accumulated or elapsed value represents progress toward that target during execution.
Milliseconds, Seconds and Minutes Conversion
| Unit | Milliseconds |
|---|---|
| 1 millisecond | 1 ms |
| 1 second | 1,000 ms |
| 1 minute | 60,000 ms |
| 1 hour | 3,600,000 ms |
| 1 day | 86,400,000 ms |
Common PLC Timer Conversion Mistakes
Assuming Preset Means Seconds
A preset has meaning only when its timer base or timer data type is known.
Confusing 10 ms and 100 ms
The same preset differs by a factor of ten when the timer base changes.
Treating S5TIME as Hex Integer
The lower S5TIME digits are BCD digits, not a normal hexadecimal number.
Ignoring Timer Resolution
Requested delays may require rounding when they are not exact multiples of the base.
Mixing Legacy and IEC Timers
Modern IEC TIME-based timers and older preset/time-base timers use different representations.
Assuming Every PLC Is Identical
Timer ranges, resolutions and storage formats vary between PLC families and instructions.
PLC Timer Value Converter FAQs
How do I convert a PLC timer preset to seconds?
What does a 100 ms PLC timer base mean?
What preset gives 30 seconds with a 100 ms timer base?
What preset gives 10 seconds with a 10 ms base?
What is IEC PLC TIME?
What is S5TIME?
What does S5TIME 0x2250 mean?
What are the S5TIME time bases?
What is the maximum S5TIME duration?
Why does S5TIME use BCD?
Can S5TIME represent 1 millisecond?
What happens if my desired time is not divisible by the timer base?
What is timer resolution error?
Is PLC timer preset the same as accumulated time?
Do all PLC timers use the same time base?
Can this calculator use a custom timer base?
Convert PLC Timer Presets, Time Bases and S5TIME
Calculate real timer duration from PLC ticks, determine the preset needed for a required delay, inspect resolution error and encode or decode Siemens S5TIME timer words.