Beyond Compilation with Runtime Diagnosis and Repair of Function Block Diagrams Generated by LLMs

Function Block Diagrams (FBDs) generated by large language models (LLMs) can compile in an industrial integrated development environment (IDE) while still violating the intended control behavior. We present a runtime diagnosis and repair pipeline that connects a topology with typed pins, PLCopen XML import, CODESYS compilation, and SoftPLC execution. The pipeline returns structured compilation diagnostics and runtime state observations that guide localized repair. Across a benchmark of 20 cases, the full configuration achieves 20/20 compilations on the first pass, compared with 8/20 without retrieval and 5/20 for a naive baseline. Repair raises the setting without retrieval to 13/20 within five attempts. The ablation shows that retrieved function block interfaces are the main driver of first pass compilation, while repair provides complementary recovery. For runtime evidence, a compiled pump cascade program initially passed 2 of 6 diagnostic assertions. After two cycles of diagnosis and repair, it passed all 18 assertions in an expanded final verification suite. Across the benchmark suite, 118/118 executed assertions derived from requirements were satisfied after repair. A targeted defect injection study detected 7/8 defects not visible at compilation across four mechanisms. These results demonstrate a practical path for compiling, testing, and repairing control logic generated through FBD workflows.

Authors

Institutions

Publication Details

Journal
Electronics
Published
2026-11-02
DOI
https://doi.org/10.3390/electronics15215079
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Beyond Compilation with Runtime Diagnosis and Repair of Function Block Diagrams Generated by LLMs

Jun Ting Lin, Qunxin Liu, Yue Liu, Hao Yuan et al.
Electronics
Software Testing and Debugging Techniques
article

Beyond Compilation with Runtime Diagnosis and Repair of Function Block Diagrams Generated by LLMs

Jun Ting Lin, Qunxin Liu, Yue Liu, Hao Yuan, Yuyi Wang
article en

Abstract

Function Block Diagrams (FBDs) generated by large language models (LLMs) can compile in an industrial integrated development environment (IDE) while still violating the intended control behavior. We present a runtime diagnosis and repair pipeline that connects a topology with typed pins, PLCopen XML import, CODESYS compilation, and SoftPLC execution. The pipeline returns structured compilation diagnostics and runtime state observations that guide localized repair. Across a benchmark of 20 cases, the full configuration achieves 20/20 compilations on the first pass, compared with 8/20 without retrieval and 5/20 for a naive baseline. Repair raises the setting without retrieval to 13/20 within five attempts. The ablation shows that retrieved function block interfaces are the main driver of first pass compilation, while repair provides complementary recovery. For runtime evidence, a compiled pump cascade program initially passed 2 of 6 diagnostic assertions. After two cycles of diagnosis and repair, it passed all 18 assertions in an expanded final verification suite. Across the benchmark suite, 118/118 executed assertions derived from requirements were satisfied after repair. A targeted defect injection study detected 7/8 defects not visible at compilation across four mechanisms. These results demonstrate a practical path for compiling, testing, and repairing control logic generated through FBD workflows.

ElectronicsVol. 15(21)
Hunan University (CN), China Railway Rolling Stock Corporation Zhuzhou Institute (China) (CN)
Openalex Percentile: Top 6%
Software Testing and Debugging Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
Beyond Compilation with Runtime Diagnosis and Repair of Function Block Diagrams Generated by LLMs — Jun Ting Lin, Qunxin Liu, et al. · Electronics (2026) | TGRS Research Map | TGRS