AIEPCO · LLM Agent FDE☎ 18923740759
Aiepco Industrial AI Agents

Field Note 003 | A duty/standby pump package I will not call "working"

We ran one of our own deliverables — a duty/standby pump control package — through our own seven-stage gate. Stages 0/1/2 passed. Stage 3 failed outright: no TIA Portal on this machine, therefore no compile log. This note publishes three things: why it stops there, why 7 of the 20 test cases are race and safety cases, and the fourth time our own analyzer was caught giving a false verdict.

The one-sentence conclusion

"It works" can only be proven by a TIA compile log plus PLCSIM or on-machine traces. Without those two artefacts, the professional answer is not "it should be fine" — it is "not passed". We put that sentence inside the deliverable, not on a marketing page.

What the package actually contains

Spec — 9 ASSERT lines
Every assertion is decidable in simulation or on the machine. Example: when the safety circuit opens, both outputs must be FALSE within the same scan — not "quickly", same scan.
I/O table — 11 DI / 2 DO
Fault inputs are wired normally-closed and inverted in code, so a broken wire counts as a fault. It also states that the instance DB must be retain-enabled, otherwise run hours reset on power loss and rotation stops happening.
4 SCL blocks — call depth 2
Coordination (interlocks, state machine, output mapping) / duty selection (fault transfer plus rotation) / runtime counting (1 Hz pulse) / fault-code mapping. Each block has a one-line job description.
20 test cases — 7 of them race or safety
E-stop in the same scan as a start command, stop dominance, both pumps failing together, reset and fault in the same scan, mode-toggle chatter, missing second pulse. These are the cases that actually bite in the field.
8 open items — 3 blocking
Safety rating (is SIL 2 required?), real hardware and addresses, starting method (soft starter for larger motors). Until those three close, this is a reviewable sample, not a runnable download.
Four-layer self-check — archived analysis
Syntax / type / logic / hardware, each stating what a tool checked, what a human reasoned through, and what was not done. The static report is produced by the tool itself, so it can be audited.

Why it is four blocks, not one

The first version was a single block. Static analysis returned McCabe≈26, which hits our own hard threshold (over 20 must be split). After splitting it is 11. We did not split further to get under 10: the block is now a coordination layer, and splitting again would separate the state machine from the output mapping, forcing a reader to assemble one scan across two files. 11 is a documented judgement, recorded in the self-check — not an oversight.

The tool output that day (verbatim)

[FB310_PumpDutyStandby.scl]
  LOC=190 SLOC=118 comments=33% McCabe~11 nesting=3 magic numbers=0
  WARNING CPLX001 L1  McCabe ~11 > 10, consider splitting
[FB311_DutySelector.scl]
  no static issues
[FB312_RuntimeCounter.scl]
  no static issues
[FB313_FaultCodeMap.scl]
  no static issues
FAIL: 0

Why none of the 7 race cases can be dropped

  • E-stop in the same scan as start: safety must override the start intent with zero-scan delay
  • Stop dominates start: if both arrive in one scan, outputs must go FALSE
  • Both pumps faulting together: the logic must not oscillate between pumps — oscillation welds contactors
  • Reset and a new fault in the same scan: reset must not swallow the fault raised in that scan
  • Mode-toggle chatter: flip auto/manual ten times, the duty-pump memory must not change
  • Missing second pulse: run hours must never fall back to scan-cycle counting — one time base only
  • Rotation due but standby unavailable: report pending, do not switch, do not zero the counters
A tool saying "pass" still needs a spot check. While checking our own deliverable, the analyzer flagged a standard multi-line PLC call as "unbalanced parentheses". After the fix, the regression run was 45/45 on the tool self-test and PASS on the golden dataset. That is the fourth self-inflicted tool defect we have caught — a checker that lies is worse than no checker, because it turns "not checked" into "checked".

The boundary is on page one, not the last page

E-stop, overload and short-circuit protection must be hardwired. The program block only performs software interlocks, status indication and runtime statistics. If SIL 2 or higher is required on site, the safety function belongs in the F-runtime of an F-CPU, and this package cannot stand in for it. Electrical design, panel building and functional-safety sign-off are outside our scope — that is a division of labour, not a disclaimer.

Put your production programs on a verifiable engineering process
相关站点 阿帕氪集团 · 咨询与预约 · 中间件 · FDE 前线部署
Related