FA-92268 / PLC ladder logic scan cycles / Member archive
Free-running clock timer reports raw elapsed ticks after completion · case 03
The reported accumulated time keeps changing (and wraps) after the timer is done.
Case contract
Delay timer built on a 16-bit free-running clock register (ticks wrap from 65535 to 0). samples is a list of [enable, clock] read each scan. The first enabled scan captures the start tick; elapsed is (clock - start) modulo 65536. Done latches once elapsed >= preset and stays set while enabled even if the elapsed value later wraps. A disabled scan clears start and done. Return [done, elapsed capped at preset once done] per scan, [False, 0] when disabled.
Why this case matters
Ladder programs are executed as repeated scans; each defect here changes what a rung, timer, counter or data-table instruction reports on a particular scan, which is how commissioning and field faults are actually observed.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: enable after idle | [[false, 0], [false, 0], [false, 0], [false, 30], [true, 60]] | [[false, 0], [false, 0], [false, 0], [false, 30], [true, 50]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗