News

AI-supported programming assistant for the automation industry

news article

AI-supported programming assistant for the automation industry

How can developers program programmable logic controllers more efficiently – without transferring sensitive data to the cloud? On behalf of Mitsubishi Electric, the Machine Learning team at Fraunhofer IOSB-INA has developed a specialized AI assistant that generates and validates manufacturer-specific code. The project exemplifies how the transfer approach of the Engineering Automation High-Performance Center solves industrial challenges.

 

Challenge: Proprietary systems meet data protection

Programming programmable logic controllers (PLCs) is time-consuming and error-prone. Each manufacturer uses its own dialects and proprietary function blocks – what works with a Siemens controller cannot be easily transferred to a Mitsubishi Electric system. Modern AI models such as GPT-4 can write code in principle, but they do not know the specific syntax rules of individual manufacturers. This information is documented in extensive manuals and is not accessible to the models' training data. At the same time, cloud-based solutions are out of the question for many industrial companies for data protection reasons.

 

Solution: Intelligent knowledge database with compiler integration

The GeneriST project resulted in an AI assistant that is specifically tailored to Mitsubishi Electric's Structured Text implementation. The system uses Retrieval-Augmented Generation (RAG): a specialized knowledge database contains function modules, syntax rules, and code examples that are retrieved specifically for each query and provided to the language model as context.

A special feature is the direct integration of the GX Works3 compiler. Generated code is automatically compiled and iteratively corrected in case of errors. The added value: users receive validated, immediately executable code. The system supports both cloud-based models and a locally executable model that can be run completely offline on a standard laptop.

 

Results: High hit rate and practicality

The evaluation with 100 test tasks shows impressive results:

Variants and their compilation rate

RAG-supported system: up to 87%

Without knowledge base: 38%

Local model (offline): 86%

 

“The local model enables use in safety-critical environments without external dependencies – a decisive factor for acceptance in industry,”

explains Dr. Joschka Kersting, who implemented the project in the Machine Learning team at Fraunhofer IOSB-INA. The solution is currently being piloted by Mitsubishi Electric; a follow-up project for further development is planned.

 

Transferability: Blueprint for industry

The architecture developed is not limited to Mitsubishi Electric. By exchanging the knowledge database and adapting the prompt templates, the system can be transferred to other PLC manufacturers. GeneriST thus offers a blueprint for companies that want to develop AI-supported programming assistants for proprietary systems.

Are you interested in this topic? Please contact Dr. Gesa Benndorf, head of the Machine Learning team at Fraunhofer IOSB-INA.