FA-91864 / PLC ladder logic scan cycles / Member archive
TON timing bit stays on after the delay completes · case 04
TT and DN are both true on the same scan once the timer has finished.
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: long hold after done | [[false, true, 0], [false, true, 30], [true, true, 50], [true, true, 50], [false, false, 0]] | [[false, true, 0], [false, true, 30], [true, false, 50], [true, false, 50], [false, false, 0]] | 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 ↗