Turn "requirements + process notes + I/O table" into Siemens SCL code automatically — a 10× lever for electrical engineers.
About this page
This page describes the architecture and capabilities of the SCL Agent design. No real factory or customer process details, variable tables, or production code are shown. During MVP / V1 stages, every AI-generated SCL must be reviewed by a qualified electrical engineer before being deployed to a production PLC — a non-negotiable industrial-safety boundary.
In short
The Siemens SCL Auto-Generation Agent is a PLC programming assistant for electrical engineers. Hand it the requirements, the process notes and the I/O table, and a planner, a generator and a reviewer agent take turns producing an SCL draft — first through an ANTLR4 static syntax check, then through LLM logic review, with up to five automatic repair rounds before escalation to a human. Its defining property is that it deliberately keeps the engineer in the loop: in the MVP and V1 stages, no AI-generated SCL may be downloaded to a production PLC until a qualified electrical engineer has reviewed it.
What the agent takes off people's plates
Planning (Qwen 3.x) + code generation (DeepSeek code model) + review (Qwen code model). Three models, each in its lane — beats any single-model attempt.
Language layer (SCL syntax + IEC 61131-3) / Template layer (motor, valve, PID, sequential, safety FBs) / Convention layer (variable prefixes, FB numbering, comments). The template layer is the moat.
Static syntax check (ANTLR4 + SCL grammar, milliseconds) → LLM logic review (refs / types / FB calls / interlocks) → auto-repair loop (5 rounds max, then escalate to human).
I/O tables are parsed deterministically into JSON (var_name / data_type / address / direction) before reaching the LLM. Anything code can do deterministically must not be left to the model.
Linux/Mac core + Windows Agent + Siemens Openness API. Always start with "export .scl + manual import" as a safety net; transactional rollback protects the TIA project; full auto-write to program blocks comes last.
MVP / V1 require mandatory engineer review. Phase gates (syntax / logic / first-pass rates) are hard requirements — no automation advance until they are met. Out-of-bound cases are fully logged to refine the template library.
Side by side
| Dimension | Hand-written by an engineer | Copying an old project template | SCL agent with engineer review |
|---|---|---|---|
| Time to a first draft for one machine | Three to five days from a blank file | Depends entirely on whether a close-enough old project can be found | AI drafts and an engineer reviews — the target is half a day to one day |
| Where team know-how ends up | In individual heads — it walks out with the person | Scattered across project files, retrievable only from memory | Captured in a three-layer RAG knowledge base (language / template / convention) that juniors can also recall |
| Naming and convention consistency | Rests on personal discipline; hard to align across projects | Inherits whatever the source project carried — the more copies, the messier | The convention layer enforces variable prefixes, FB numbering and comment format |
| When errors surface | At compile time — logic problems often wait until commissioning | The same, plus the old project's bugs come along for the ride | Millisecond static syntax checks, LLM logic review and up to five auto-repair rounds, then escalation to a human |
Quantified before / after
Subjects and capability matrix
MVP
Syntax >90% · 1st-pass >60%
V1
Logic >85% · 1st-pass >75%
V2
Fine-tune + full auto-link
V3
Self-improving · quarterly delta
How the agent and human supervision collaborate
source
Engineer
agent
Planner agent
agent
Generator agent
agent
Reviewer agent
human
Engineer review
output
TIA Portal
Flow
Verifiable facts
Three models split the work: Qwen 3.x for requirement understanding, a DeepSeek code model for generation and a Qwen code model for review.
The RAG knowledge base has three layers: language (SCL syntax + IEC 61131-3), templates (motor, valve, PID, sequential and safety-interlock function blocks) and conventions (variable prefixes, FB numbering, comments).
Validation runs in three steps: a millisecond static syntax check with ANTLR4 and an SCL grammar, an LLM logic review, then an auto-repair loop capped at five rounds before escalation to a human.
The phase quality gates are targets, not measurements: MVP requires syntax accuracy >90% and a first-pass rate >60%; V1 requires logic accuracy >85% and a first-pass rate >75%. Automation does not advance until they are met.
The claim that a machine's SCL goes from 3–5 days of hand-writing to half a day or one day is a projected benefit, baselined against an engineer starting from scratch, and has not yet been validated on a field project.
Where it fits
Further reading
FuGuang Smart Phosphorus Control
Agent-driven dosing decisions for water treatment, with human supervision — out-of-range actions require human confirmation.
YggLab AI Agent Desktop
One desktop where 20+ CLI agents actually collaborate — assign work solo, form a team, or command them from your phone while work keeps moving 24/7.