Automatic Generation of PLC Code Based on Finetuned Large Language Models

Programmable Logic Controllers (PLCs) are fundamental components of modern industrial automation, enabling precise control, monitoring, and data processing of complex production systems. Structured Text (ST), defined by the IEC 61131–3 standard, is a high-level language widely used for developing sophisticated PLC software. This study proposes an automated ST code generation workflow based on large language models (LLMs) to improve the efficiency of PLC programming. We first construct a domain-specific dataset that aligns ST code with corresponding natural language descriptions and fine-tune pretrained LLMs to adapt them to the industrial control domain. Next, we employ prompt engineering techniques to enhance both the functional correctness and domain relevance of the generated code. Finally, we integrate a verification mechanism that utilizes compiler-based syntax checking to detect errors and iteratively refine model outputs through feedback. Experimental results demonstrate that our platform significantly improves the quality of generated ST code while reducing overall development time.

Authors

Institutions

Publication Details

Published
2025-07-11
DOI
https://doi.org/10.1109/ieeeconf65522.2025.11136984
Citations
1
Primary Topic
Advanced Computational Techniques and Applications
Type
article
Field-Weighted Citation Impact
2.48

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Automatic Generation of PLC Code Based on Finetuned Large Language Models

Xiaojun Liang, Wenfeng Deng, Linghao Ren, Shuai Liu et al.
1 citations
Advanced Computational Techniques and Applications
2.48
article

Automatic Generation of PLC Code Based on Finetuned Large Language Models

Xiaojun Liang, Wenfeng Deng, Linghao Ren, Shuai Liu, Nan Zhou, Chunhua Yang
article en
1 citations

Abstract

Programmable Logic Controllers (PLCs) are fundamental components of modern industrial automation, enabling precise control, monitoring, and data processing of complex production systems. Structured Text (ST), defined by the IEC 61131–3 standard, is a high-level language widely used for developing sophisticated PLC software. This study proposes an automated ST code generation workflow based on large language models (LLMs) to improve the efficiency of PLC programming. We first construct a domain-specific dataset that aligns ST code with corresponding natural language descriptions and fine-tune pretrained LLMs to adapt them to the industrial control domain. Next, we employ prompt engineering techniques to enhance both the functional correctness and domain relevance of the generated code. Finally, we integrate a verification mechanism that utilizes compiler-based syntax checking to detect errors and iteratively refine model outputs through feedback. Experimental results demonstrate that our platform significantly improves the quality of generated ST code while reducing overall development time.

Central South University (CN), Southern University of Science and Technology (CN), Peng Cheng Laboratory (CN)
National Natural Science Foundation of China
Openalex Percentile: Top 9%
Advanced Computational Techniques and Applications
2.48
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.

Automatic Generation of PLC Code Based on Finetuned Large Language Models — Xiaojun Liang, Wenfeng Deng, et al. · (2025) | TGRS Research Map | TGRS