LLM-based and Retrieval-Augmented Control Code Generation
Open Access
- 20 April 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 22-29
Abstract
Control code is designed and implemented for industrial automation applications that manage power plants, petrochemical processes, or steel production. Popular large language models (LLM) can synthesize low-level control code in the Structured Text programming notation according to the standard IEC 61131-3, but are not aware of proprietary control code function block libraries, which are often used in practice. To automate control logic implementation tasks, we proposed a retrieval-augmented control code generation method that can integrate such function blocks into the generated code. With this method control engineers can benefit from the code generation capabilities of LLMs, re-use proprietary and well-tested function blocks, and speed up typical programming tasks significantly. We have evaluated the method using a prototypical implementation based on GPT-4, LangChain, Open-PLC, and the open-source OSCAT function block library. In several spot sample tests, we successfully generated IEC 61131-3 ST code that integrated the desired function blocks, could be compiled, and validated through simulations.Keywords
This publication has 11 references indexed in Scilit:
- ChatGPT for PLC/DCS Control Logic Generation2023
- Expectation vs. Experience: Evaluating the Usability of Code Generation Tools Powered by Large Language Models2022
- A classification framework for automated control code generation in industrial automationJournal of Systems and Software, 2020
- Digitalization of the IEC PAS 63131 Standard with AutomationML2018
- Formal representation of GRAFCET to automatically generate control codeControl Engineering Practice, 2014
- OpenPLC: An open source alternative to automation2014
- Rule-based engineering using declarative graph database queries2014
- Model-driven engineering of process control software – beyond device-centric abstractionsControl Engineering Practice, 2013
- Automated code generation for programmable logic controllers based on knowledge acquisition from engineering artifacts: Concept and case study2012
- Model-driven development of industrial process control applicationsJournal of Systems and Software, 2011