FA-91847 / PLC ladder logic scan cycles / Member archive
TON accumulator runs past its preset · case 02
After the delay completes the ACC value keeps growing on every true scan instead of holding at PRE.
Case contract
On-delay timer (TON) evaluated once per scan. scans is a list of [rung_in, elapsed_ms since the previous scan]. The accumulator starts on the false-to-true scan without crediting that scan's elapsed time, then adds each later true scan's elapsed time, clamped at preset. A false rung resets the accumulator. DN is rung_in and acc >= preset; TT is rung_in and not DN. Return [DN, TT, ACC] per scan.
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: interrupted timing restarts | [[false, true, 0], [false, true, 40], [false, false, 0], [false, true, 0], [false, true, 40], [true, false, 80]] | [[false, true, 0], [false, true, 40], [false, false, 0], [false, true, 0], [false, true, 40], [true, false, 60]] | 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 ↗