Introduction
Programmable Logic Controllers (PLCs) serve as the essential "brains" of modern industrial automation. However, PLC programming methodologies have largely failed to keep pace with advancements in software engineering. Industrial code is frequently burdened by legacy structures, difficult to verify formally, and susceptible to manual errors during development.
While computer science has long utilized "formal methods"—mathematical techniques to prove code correctness or generate it from specifications—these tools remain rare in the PLC domain. This research addresses the "major gap" between theoretical formal methods and practical engineering by introducing "self-configuring blocks." This abstraction allows PLC engineers to leverage automated code synthesis and verification within familiar industrial toolchains, such as the Siemens TIA Portal, without requiring specialized knowledge of formal logic.
Methodology and Technical Implementation
The researchers developed a functional integration between the Siemens TIA Portal and Fastsynth, an open-source inductive synthesis tool. The implementation relies on the Counterexample Guided Inductive Synthesis (CEGIS) algorithm. In this loop, the tool proposes a program candidate, which a model checker (CBMC) then tests against defined constraints. If the code fails, the resulting counterexample is used to refine the next iteration of the synthesis.
To make this accessible, the team created "self-configuring blocks." Instead of writing imperative logic, engineers define a "constraint list" (e.g., "If Sensor A is active, Motor B must be off"). The integration was achieved using the TIA Openness library, which enables the synthesis tool to read project data and inject the generated, verified code directly back into the PLC project environment.
Evaluation and Results
The system was evaluated using the iStorage (Intelligent Warehouse) benchmark, a production plant component at the University of Stuttgart involving complex logic for carrier control and collision prevention.
Performance results indicated that synthesis latency is highly dependent on logic complexity:
- Simple Logic: Magnet actuation logic was synthesized in approximately 128 ms.
- Medium Complexity: A "Row Control" block required 379 ms.
- High Complexity: A "SignalLight" control block with 8 inputs took roughly 73 seconds.
While the synthesis time for complex blocks is notably higher, expert feedback suggested these durations remain "tolerable" within standard engineering workflows, especially given the benefit of guaranteed correctness in safety-critical systems.
Expert Insights and Use Cases
A survey of 10 PLC professionals was conducted to identify high-value applications for this technology. The results showed a strong preference for using formal methods not just for generation, but for maintaining existing systems.
Key takeaways from the expert evaluation include:
- Code Simplification as a Priority: Engineers identified the automatic simplification of messy legacy code into its most concise form as a high-value "killer app."
- Preferred Constraint Sources: Professionals favored defining logic through familiar formats like Truth Tables or Cause and Effect Matrices over writing formal mathematical specifications.
- Mental Model Success: By wrapping formal methods in the familiar terminology of "blocks" and "constraints," the technology received an average potential rating of 4/5.
Limitations and Future Work
Despite promising results, challenges remain regarding the "state space explosion"—as input variables increase, synthesis time grows exponentially. Future work will focus on deeper, native integration as a plugin within the TIA Portal environment and expanding the tool's capability to handle complex non-Boolean PLC program components.
Summary updated