Multi-Agent System for Cross-Platform PLC Code Generation with Domain Adaptation

  • Pei P
N/ACitations
Citations of this article
4Readers
Mendeley users who have this article in their library.

Abstract

Programmable Logic Controllers (PLCs) are fundamental to industrial automation systems. However, traditional PLC programming requires extensive domain expertise and significant time investment, while code reusability remains limited and cross-platform adaptation poses substantial challenges. With the rapid advancement of Large Language Models (LLMs), LLM-based code generation offers a promising approach to address these issues. Nevertheless, existing methods still face challenges when handling complex industrial scenarios, including insufficient domain knowledge, unstable code quality, and weak cross-platform adaptation capabilities. This paper presents a multi-agent system for intelligent cross-platform PLC code generation, featuring a collaborative framework consisting of four specialized agents: requirement analysis, architecture design, code generation, and verification-optimization. The method injects domain knowledge through a Retrieval-Augmented Generation (RAG) mechanism, employs multi-stage prompt engineering strategies to guide code generation, and integrates a three-layer verification mechanism comprising static analysis, dynamic simulation, and expert review to ensure code quality. Experiments on the constructed PLC-MultiTask dataset demonstrate that our method significantly outperforms existing approaches across multiple metrics, achieving 90.3% compilation success rate, 87.6% test pass rate, and 75.4 CodeBLEU score. In an industrial case study involving robotic arm handling of refractory bricks, the system successfully generated approximately 800 lines of structured text code. Field testing over 720 hours demonstrated stable operation with 99.2% handling success rate, reducing development time by 73.3% compared to traditional methods. These results indicate that multi-agent-based PLC code generation significantly enhances development efficiency, ensures code quality, and strengthens cross-platform adaptation capabilities, offering a novel paradigm for industrial automation software development.

Cite

CITATION STYLE

APA

Pei, P. (2025). Multi-Agent System for Cross-Platform PLC Code Generation with Domain Adaptation. International Journal of Emerging Technologies and Advanced Applications, 2(10), 1–8. https://doi.org/10.62677/ijetaa.2510141

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free