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.

What the agent takes off people's plates

Core capabilities

01

Dual-model orchestration

Planning (Qwen2.5-72B) + code generation (DeepSeek-Coder-V2) + review (Qwen2.5-Coder-32B). 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.

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)

human

Engineer review

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