PLC Timer Runs a Thousand Times Too Long? Inspect Duration Conversion
- PLC Play Ground
- 0
- Posted on
A duration value needs both a numerical representation and a unit. If a timer is wrong by a large repeatable factor after an interface change, trace the conversion into the time type before changing the timer preset by trial and error.
Time representation and conversion are platform-specific.
What is happening?
Typed time literals and numerical conversions are not interchangeable across platforms. A raw integer may represent milliseconds, another timebase, or an application-defined quantity. Supported range and signedness also matter.
Check these five things
-
Record the external value and its documented unit.
-
Inspect the exact conversion into the timer preset type.
-
Check intermediate types and supported duration range.
-
Test several known durations offline.
-
Label the interface and HMI with the accepted unit.
Worked example
A teaching interface sends 5 to mean five seconds. A receiver treating the raw value as milliseconds creates a five-millisecond preset. Multiplying or converting is correct only after the interface contract and instruction timebase are verified.
Quick diagnostic reference
| Layer | Record |
|---|---|
| Sender | Value and unit |
| Conversion | Documented timebase |
| Timer | Typed duration |
| Display | Presented unit |
The mistake to avoid
Do not assume that all controllers store TIME identically. A migration can retain familiar type names while changing supported sizes, conversions, or available extended types.
How to verify the fix
Verify representative durations and the maximum accepted value, including rejected negative or excessive inputs. Confirm the displayed preset matches the duration used by the timer.
Field-work boundary: These are educational diagnostic guides. Use the exact equipment manuals and approved site procedures. Electrical testing and machinery changes belong to qualified, authorized personnel; control hazardous energy and validate affected functions before release.
Technical reference
CODESYS: Operators and type behavior. The examples and diagnostic tables above are original teaching material; they do not replace the product manual.
