FAILURE MAP
← Case archive

FA-92250 / PLC ladder logic scan cycles / Member archive

Any signal above 20 mA is reported as over-range · case 05

A transmitter calibrated slightly high trips over-range at full scale.

Member previewVariant 5 · 3 implementations · 8 checks per implementation

Case contract

Scale a 4-20 mA analog channel read once per scan. Raw counts are proportional to 0-20 mA with 20 mA = 31208 counts, so 4 mA = 6242. Below 3.6 mA (raw*200 < 36*31208) the channel reports open wire and above 20.5 mA (raw*40 > 41*31208) over-range; in both cases it returns the last good value (None before any). Otherwise the engineering value in tenths is eng_lo*10 + (raw-6242)*(eng_hi-eng_lo)*10 / 24966 rounded half up, clamped to the configured range (reverse-acting ranges allowed). Return [status, tenths] 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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: scenario 5[["ok", 1000], ["ok", 830], ["ok", 528], ["over", 528], ["ok", 477], ["ok", 5], ["ok", 184], ["ok", 604], ["ok", 785], ["ok", 1000]][["ok", 1000], ["ok", 830], ["ok", 528], ["ok", 0], ["ok", 477], ["ok", 5], ["ok", 184], ["ok", 604], ["ok", 785], ["ok", 1000]]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 ↗