# ChatGPT for PLC/DCS Control Logic Generation

arXiv: https://arxiv.org/abs/2305.15809 · HTML: https://mlsanity.com/paper/2305.15809/

## Key facts

- Cited by 9 papers in the map (data through 14 Oct 2026).
- Builds on 7 of its 22 references that are in the map.
- First posted on arXiv 25 May 2023.

## Builds on (most cited first, 7 of 7)

- [Competition-Level Code Generation with AlphaCode](https://mlsanity.com/paper/2203.07814/) (2022)
- [A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT](https://mlsanity.com/paper/2302.11382/) (2023)
- [A Comprehensive Survey on Pretrained Foundation Models: A History from BERT to ChatGPT](https://mlsanity.com/paper/2302.09419/) (2023)
- [The Impact of AI on Developer Productivity: Evidence from GitHub Copilot](https://mlsanity.com/paper/2302.06590/) (2023)
- [A Categorical Archive of ChatGPT Failures](https://mlsanity.com/paper/2302.03494/) (2023)
- [ChatGPT Prompt Patterns for Improving Code Quality, Refactoring, Requirements Elicitation, and Software Design](https://mlsanity.com/paper/2303.07839/) (2023)
- [Automatic Code Documentation Generation Using GPT-3](https://mlsanity.com/paper/2209.02235/) (2022)

## Built on by (most cited first, 9 of 9)

- [Agents4PLC: Automating Closed-loop PLC Code Generation and Verification in Industrial Control Systems using LLM-based Agents](https://mlsanity.com/paper/2410.14209/) (2024)
- [Large Language Model-Enabled Multi-Agent Manufacturing Systems](https://mlsanity.com/paper/2406.01893/) (2024)
- [AutoPLC: Generating Vendor-Aware Structured Text for Programmable Logic Controllers](https://mlsanity.com/paper/2412.02410/) (2024)
- [Retrieval-Augmented Fine-Tuning With Preference Optimization For Visual Program Generation](https://mlsanity.com/paper/2502.16529/) (2025)
- [Capability-Driven Skill Generation with LLMs: A RAG-Based Approach for Reusing Existing Libraries and Interfaces](https://mlsanity.com/paper/2505.03295/) (2025)
- [Natural Language based Context Modeling and Reasoning for Ubiquitous Computing with Large Language Models: A Tutorial](https://mlsanity.com/paper/2309.15074/) (2023)
- [Beyond touch-based human-machine interface: Control your machines in natural language by utilizing large language models and OPC UA](https://mlsanity.com/paper/2510.11300/) (2025)
- [Navigating Ethical AI Challenges in the Industrial Sector: Balancing Innovation and Responsibility](https://mlsanity.com/paper/2601.09351/) (2026)
- [An LLM-Driven Workflow for Automated Process Control Strategy Generation and Tuning from Dynamic Process Models](https://mlsanity.com/paper/2607.21292/) (2026)

## Abstract (arXiv)

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.
