Case study

Manual vs. program: 36 PLCSIM tests and 11 deviations found in a cold-storage controller

A storage plant with seven identical sections. The owner wanted to know whether the PLC program really did what the 5,000-line controller manual promised.

7 sections S7-PLCSIM Advanced WinCC Unified SCL
5000
lines of controller manual read and cross-checked
36
automated tests in PLCSIM
11
deviations from the manual found
28PASS 8FAIL
after fixes: 8 FAILs are deviations the owner chose to keep

Anonymised: plant, customer, people and file names are not published. Figures are from the actual engineering session.

The situation

The plant ventilates, cools and conditions stored produce in seven sections. Each section has phases — drying, curing, cooling and heating — and uses outside air, recirculation, a compressor and a defrost heater.

The program had grown over years. The manual of the original controller described the intended behaviour in detail; nobody had compared the two systematically. Testing on the live plant was not an option.

How the AI worked

All work happened on a copy of the project, loaded into S7-PLCSIM Advanced. The plant project was never changed.

tia_retrieve_project · tia_export_program

Copy and read

Archived the project, opened a copy and exported the program as SCL sources for analysis.

manual · 5,000 lines

Requirements from the manual

Extracted every rule for each phase — set-points, hysteresis, interlocks, alarms — and mapped it to blocks and DB variables.

tia_download · tia_plcsim_instances

Simulate

Downloaded the copy to a PLCSIM Advanced instance in deterministic mode: 100 ms of virtual time per cycle, so timers behave as on the real CPU.

tia_plcsim_test

Test every phase

Wrote tests that set inputs, run cycles and check outputs. Tests for real program behaviour must pass; tests marked per manual fail exactly where the program deviates.

tia_import_source · tia_compile

Fix and re-verify

After the owner decided what to change, the AI fixed the copy, recompiled PLC and HMI, and re-ran the whole suite as a regression.

What was found

Eleven deviations, each confirmed by a failing test on the simulated PLC — not just by reading code.

#DeviationImpact
1Curing phase held no temperature: only recirculation, no outside-air or compressor coolingSelf-heating produce is not cooled
2Dampers only 0 / 100 %, no regulation on channel temperatureRisk of under-cooling with cold outside air
3Minimum thermostat and external stop only raised an alarmProtective functions did not protect
4Heating with outside air without demand check; limits hard-codedProduce warmed beyond the final temperature
5One final temperature shared by cooling and heatingWrong heating set-point
6Compressor and outside air ran at the same timeAgainst the either/or rule; wasted energy
7No compressor feedback monitoring (watchdog declared, never called)A failed compressor goes unnoticed
8Fans ran permanently in all phasesEnergy use and fan heat in the produce
9Defrost by calendar time, in any phase, even on a stopped sectionUnneeded heating of the evaporator
10Product temperature alarm on the average, not per sensorLocal hot or cold spots missed
11Drying: no hysteresis on minimum outside temperature; heater assist never calledDamper chatter; no heating support

The fix

The owner chose which deviations to fix. The AI changed the copy in two small batches — 12 files, about 170 lines added — and documented every change in git: curing now cools with outside air or the compressor, dampers regulate the channel temperature step by step, a software minimum thermostat stops fans and compressor, and the compressor is monitored by its feedback signal, with a new run-hours counter.

A new alarm for a double channel-sensor failure was added for all seven sections, with matching HMI tags and messages. PLC and HMI compiled with no new warnings.

Results

StageTestsPASSFAIL
First run: program vs. manual311516
After fixes, with new tests342212
Final regression36288

The 8 remaining failures are deliberate: equipment the plant doesn't have (heater, external stop) or decisions the owner postponed. They stay in the suite as documented open points — all 15 originally passing tests still pass.

What it shows

  • Tests, not opinions. Every finding is a reproducible test that fails on the simulated PLC.
  • The plant project stayed untouched. All work on a copy in PLCSIM; the human decided what to change.
  • Regression for free. The same suite re-runs after every change and becomes the basis of an acceptance report.
  • Traceable. Every tool call is in the audit log; every code change is a git commit.
Reading the manual and testing every phase by hand would have taken days. Here the work was reviewing results and making decisions.