IndustryIndustrial automation / PLC programming / Engineering productivity

Siemens SCL Auto-Generation Agent

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

Core capabilities

01

Dual-model orchestration

Planning (Qwen 3.x) + code generation (DeepSeek code model) + review (Qwen code model). Three models, each in its lane — beats any single-model attempt.

02

Three-layer RAG knowledge base

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.

03

Three-step validation chain

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).

04

Deterministic I/O-table parser

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.

05

TIA-Portal Openness with graceful degradation

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.

06

Industrial-safety red lines + quality gates

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

AI-generated SCL vs hand-written by an engineer vs copying an old template

DimensionHand-written by an engineerCopying an old project templateSCL agent with engineer review
Time to a first draft for one machineThree to five days from a blank fileDepends entirely on whether a close-enough old project can be foundAI drafts and an engineer reviews — the target is half a day to one day
Where team know-how ends upIn individual heads — it walks out with the personScattered across project files, retrievable only from memoryCaptured in a three-layer RAG knowledge base (language / template / convention) that juniors can also recall
Naming and convention consistencyRests on personal discipline; hard to align across projectsInherits whatever the source project carried — the more copies, the messierThe convention layer enforces variable prefixes, FB numbering and comment format
When errors surfaceAt compile time — logic problems often wait until commissioningThe same, plus the old project's bugs come along for the rideMillisecond static syntax checks, LLM logic review and up to five auto-repair rounds, then escalation to a human

Quantified before / after

Measured impact

Electrical engineer
BeforeHand-writing SCL for one machine takes 3-5 days
AfterAI drafts an 80-point baseline + engineer reviews → half a day to one day
Project manager
BeforeLong delivery cycles bottlenecked on senior engineers
AfterDraft and regression automated, engineers focus on review and exceptions
Head of automation
BeforeSame processes rewritten over and over; tacit knowledge lives in individuals
AfterA RAG template library captures team know-how; even juniors can recall it
Customer factory
BeforeWait weeks just to schedule a single retrofit
AfterFrom spec to draft in under a day, faster iteration loop

Subjects and capability matrix

Covered modules

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

System architecture (conceptual)

source

Engineer

agent

Planner agent

agent

Generator agent

agent

Reviewer agent

human

Engineer review

output

TIA Portal

Flow

  • EngineerPlanner agentReqs / process / I/O
  • Planner agentGenerator agentFB task pool
  • Generator agentReviewer agentSCL draft
  • Reviewer agentGenerator agent5-round auto-repair
  • Reviewer agentEngineer reviewPass / escalate
  • Engineer reviewTIA PortalOpenness write / manual import
  • TIA PortalPlanner agentSuccess → RAG

Verifiable facts

Numbers and sources

Three models split the work: Qwen 3.x for requirement understanding, a DeepSeek code model for generation and a Qwen code model for review.

Self-reportedSCL Agent solution design notes (conceptual design), verified 2026-082026-08-01

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).

Self-reportedSCL Agent solution design notes (conceptual design), verified 2026-082026-08-01

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.

Self-reportedSCL Agent solution design notes (conceptual design), verified 2026-082026-08-01

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.

Self-reportedSCL Agent phase plan (target values, not measured results), verified 2026-082026-08-01

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.

Self-reportedSCL Agent ROI estimate (projected value for a conceptual design, baselined on hand-written code, not field-validated), verified 2026-082026-08-01

Where it fits

When this approach does not apply

  • This page sets out the architecture and capabilities of the SCL Agent design; it is not a product that can be purchased and delivered today. No factory process details, variable tables or production code appear on it, and real-world results have to be assessed against how much template material each engineering team has already accumulated.
  • AI-generated SCL must never go straight onto a production PLC. In the MVP and V1 stages a qualified electrical engineer has to sign it off first — a non-negotiable industrial-safety boundary. Projects unwilling to accept that constraint are not a fit.
  • The numbers in the phase gates are entry targets, not measured results. MVP's syntax >90% / first-pass >60% and V1's logic >85% / first-pass >75% are hard stops — automation does not advance until they are met — and should not be quoted as delivered performance figures.
  • The template layer caps the payoff. Where processes are highly bespoke and almost no reusable function blocks exist, the AI can only produce a syntactically valid skeleton, and the time saved falls well short of standard motor, valve, PID or sequential-control work.
Written by: YGG Technology solutions teamPublished: 2026-05-08Last reviewed: 2026-08-01