Large language models (LLMs) providing generative AI have become popular to support software engineers in creating, summarizing, optimizing, and documenting source code. It is still unknown how LLMs can support control engineers using typical control programming languages in programming tasks. Researchers have explored GitHub CoPilot or DeepMind AlphaCode for source code generation but did not yet tackle control logic programming. The contribution of this paper is an exploratory study, for which we created 100 LLM prompts in 10 representative categories to analyze control logic generation for of PLCs and DCS from natural language. We tested the prompts by generating answers with ChatGPT using the GPT-4 LLM. It generated syntactically correct IEC 61131-3 Structured Text code in many cases and demonstrated useful reasoning skills that could boost control engineer productivity. Our prompt collection is the basis for a more formal LLM benchmark to test and compare such models for control logic generation.
翻译:大语言模型(LLMs)提供的生成式人工智能已广泛用于支持软件工程师进行源代码的创建、总结、优化和文档编写。然而,LLMs如何支持控制工程师使用典型控制编程语言完成编程任务仍不明确。研究者已探索GitHub CoPilot或DeepMind AlphaCode进行源代码生成,但尚未涉及控制逻辑编程。本文的贡献在于开展了一项探索性研究,我们创建了10个代表性类别的100条LLM提示,用于分析从自然语言生成可编程逻辑控制器(PLC)和分布式控制系统(DCS)控制逻辑的过程。我们通过使用基于GPT-4的ChatGPT生成答案来测试这些提示。ChatGPT在许多情况下生成了语法正确的IEC 61131-3结构化文本代码,并展示了实用的推理能力,这有望提升控制工程师的生产力。我们的提示集合为建立更正式的LLM基准测试奠定了基础,可用于测试和比较此类模型在控制逻辑生成中的表现。