LLM-based code generation could save significant manual efforts in industrial automation, where control engineers manually produce control logic for sophisticated production processes. Previous attempts in control logic code generation lacked methods to interpret schematic drawings from process engineers. Recent LLMs now combine image recognition, trained domain knowledge, and coding skills. We propose a novel LLM-based code generation method that generates IEC 61131-3 Structure Text control logic source code from Piping-and-Instrumentation Diagrams (P&IDs) using image recognition. We have evaluated the method in three case study with industrial P&IDs and provide first evidence on the feasibility of such a code generation besides experiences on image recognition glitches.
翻译:基于大语言模型(LLM)的代码生成可显著减少工业自动化领域的人工投入——在该领域中,控制工程师需手动为复杂的生产过程编写控制逻辑。以往的控制逻辑代码生成方法缺乏对工艺工程师所绘示意图的解读能力。当前,最新LLM已整合图像识别、领域知识训练及编程技能。我们提出一种新颖的LLM代码生成方法,通过图像识别从管道与仪表流程图(P&ID)中直接生成符合IEC 61131-3标准的结构化文本控制逻辑源代码。通过在三个工业级P&ID案例上的评估,我们首次验证了此类代码生成的可行性,并总结了图像识别异常问题的实践经验。