Lessons · Industrial control · a timer adds up time
A timer adds up time
An on-delay timer accumulates while its input is true and sets its done bit when it reaches the preset.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
The done bit is a claim that the input has been CONTINUOUSLY true for that long, and the word continuously is where the faults live.
How to think about it
A timer cannot be finer than a scan. At 100 ms a scan, a 300 ms preset is done on the third scan, and a 5 ms preset is not a 5 ms delay -- it is one scan.
Worked example
[Run] [TON T1 300ms] [T1.DN] (Ready)Run held from the first scan, 100 ms a scan. Ready: 0 0 1 1
Your turn
A 300 ms timer at 100 ms a scan is done on which scan?
the
Run a rung and watch the scan
The trap
A preset shorter than the scan will also move if somebody adds logic and the scan lengthens. A delay that changes when unrelated code is added is genuinely nasty to chase.