Sunday 02 February 2025
The quest for efficient code generation has long been a challenge for software developers, particularly in industries where automation and precision are paramount. Programmable Logic Controllers (PLCs) are a crucial component of industrial control systems, requiring precise programming to ensure seamless operation. In this field, generating accurate Structured Text (ST) code can be a daunting task, as it requires deep understanding of the underlying PLC system and its intricacies.
Enter AutoPLC, an innovative approach developed by researchers that leverages Large Language Models (LLMs) to automatically generate vendor-specific ST code based on Natural Language (NL) requirements. This breakthrough technology has the potential to revolutionize the way PLCs are programmed, enabling developers to focus on higher-level design and implementation rather than tedious coding.
The AutoPLC system consists of two primary components: a library comprising successful cases (requirements and code) and another containing a public instruction library for the specific ST language variant. This dual-approach allows LLMs to learn from both successful instances and relevant context, thereby generating more accurate code. Furthermore, the system features an integrated syntax and semantic checker tailored to the ST variant, providing feedback on the generated code and enabling refinement.
The researchers conducted a thorough evaluation of AutoPLC by creating three benchmarks encompassing CODESYS’ ST and Siemens’ SCL. The results demonstrate the superiority of AutoPLC over seven leading-edge approaches, particularly regarding the passed compilation ratio and reduced number of errors. Ablation studies also confirm the importance of the retriever (alongside the libraries) and self-improvement process.
Five ST-experienced experts provided feedback on the generated code, acknowledging its usefulness in real-world scenarios. The potential applications of AutoPLC are vast, extending beyond PLC programming to other domains where automated code generation is crucial. With the ever-growing complexity of industrial control systems, this innovative approach has the potential to streamline development processes and enhance overall efficiency.
In the future, researchers plan to expand their work by incorporating complex logic and interfaces with distinct devices, further solidifying AutoPLC’s position as a game-changer in the realm of PLC programming. As the demand for efficient code generation continues to grow, it is likely that AutoPLC will play a significant role in shaping the future of industrial automation.
Cite this article: “AutoPLC: A Breakthrough in Efficient PLC Programming”, The Science Archive, 2025.
Programmable Logic Controllers, Structured Text, Autoplc, Large Language Models, Natural Language, Industrial Automation, Plc Programming, Codesys, Siemens Scl, Code Generation







