AIAny
Icon for item

SemaPLC: A Project-Grounded, Verification-Gated Agent Harness for PLC Code Generation

Turns natural-language PLC requirements into verified, runnable IEC 61131-3 Structured Text by driving a closed loop of generation, compilation, deployment, and behavioral verification on a live OpenPLC runtime. The verification-gated harness forces inputs, traces execution, repairs failures, and renders ladder diagrams plus process simulation to raise dynamic runtime pass rates.

Introduction

Most PLC code generation work judges success by static metrics or compilation alone; execution on a live runtime is the ultimate test. This paper shows that an agentic harness that demands external, logged checks at every completion gate—specification, compile, and runtime behavior—finds and fixes many errors that static scoring misses, substantially improving verified behavior when code actually runs.

Key Findings
  • Verification-gated loop: the system closes the generation loop with automated compilation, deployment to a live OpenPLC runtime, input forcing, and trace-based behavioral checks, and it iteratively repairs until external checks pass. This shifts completion criteria from model self‑assessment to mechanized evidence.
  • Measured improvements: on 117 independent-POU tasks the harness attains a 72.6% mean strict verified pass rate across seven models. On a 65-task project-context track, dynamic behavior scores separate methods sharply (baselines 22.4–31.4 vs. 52.2 for the harness), showing execution-level checks reveal issues static metrics miss.
  • Usable components: the work bundles a web IDE and a PLC tool suite (compiler/upload/run/read/force/trace tools plus an OpenPLC Docker runtime) so the agent can compile, deploy, force inputs, and trace variables end-to-end and present ladder diagrams and process simulations.
Who it's for and tradeoffs

Great fit if you need generated PLC logic to not only compile but demonstrably behave inside an existing project and runtime—automation engineers, researchers building code-generating agents, and teams integrating LLMs into industrial automation workflows. Look elsewhere if your goal is lightweight code sketching or craft-level ST snippets without live verification: the harness adds complexity (tooling, Docker runtime, scenario design) and focuses evaluation on execution rather than only on static or human-review metrics.

Information

  • Websitearxiv.org
  • OrganizationsMidea AIRC, KUKA, SJTU, ZJU
  • AuthorsYanlun Tu, Huacan Wang, Ziyue Zhou, Jie Zhou, Ningyan Zhu, Ge Chen, Wangyi Chen, Tengfei Zhou, Yifan Zhou, Dasheng Yang
  • Published date2026/08/19

More Items

Conducts end-to-end multidisciplinary research directly from heterogeneous raw evidence using lifecycle-wide perception and three autonomous agents (Ideation, Experiment, Writeup). Integrates perceptual analysis, execution provenance, and code-enforced checks to produce executable analyses, validated results, and compiled manuscripts across many modalities.

Enables closed-loop execution for embodied agents by evolving code-based runtime critics and recovery skills online while keeping the base policy frozen. Combines three timescale loops with Z-Infra rollout infrastructure; reports 90.8% on LIBERO-Pro, 93.6% on RoboCasa and an 11.1× inference speedup.

Hugging Face
AI Model2026

A 35B mixture-of-experts LLM tuned for agentic coding and end-to-end self-improvement: it jointly generates tasks, scaffolds, and solution rollouts. Activates ~3B params/token, supports 256K context (extendable), and emits chain-of-thought plus OpenAI-style tool calls.