PLC program automatic creation method based on industrial agent
By automatically creating PLC programs using industrial agents and industrial AI models, the problem of high professional skill threshold in traditional PLC development is solved, thus simplifying the development process and improving efficiency.
Patent Information
- Application Number
- CN202511678602.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-17
AI Technical Summary
Traditional PLC program development has a high skill threshold, requiring engineers to master multiple programming languages and hardware architectures, resulting in high training costs and a complex development process.
By analyzing natural language through industrial agents and industrial AI models, PLC programs are automatically created. The industrial AI models generate structured data and call PLC program creation tools to achieve automated program generation.
It lowers the professional skill requirements for PLC program development, improves development efficiency and simplifies the process, and reduces reliance on hardware knowledge.
Smart Images

Figure CN121541564A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial automation control technology, specifically relating to a method for automatically creating PLC programs based on industrial agents. Background Technology
[0002] Programmable Logic Controllers (PLCs) are core control devices in industrial automation systems, and their program development has long relied on specialized programming languages. Therefore, traditional PLC development suffers from a high skill threshold; engineers need to master multiple programming languages specified in the IEC 61131-3 standard and have a deep understanding of the hardware architecture of specific PLC brands (such as Siemens S7 series and Rockwell ControlLogix). Training a qualified PLC engineer requires a significant amount of time and financial investment, and the development process necessitates frequent consultation of hardware manuals and programming specifications from various manufacturers. For example, to implement a basic function like motor start-stop control, engineers must precisely configure hardware-related data such as contactor coil addresses and overload protection relay parameters.
[0003] This paper proposes an automatic PLC program creation method based on industrial agents. This method relies on industrial AI model technology to analyze natural language and uses MCP technology to enable programmable logic software to automatically create PLC programs. Summary of the Invention
[0004] This invention aims to provide a method for automatically creating PLC programs based on industrial agents, including the following:
[0005] The user inputs natural language information describing the PLC program creation requirements through the industrial agent's dialog window; the industrial agent converts the natural language information and PLC program creation tool information into structured data and sends it to the industrial AI model; the industrial AI model analyzes the data sent by the industrial agent and generates the PLC program and instructions for calling the PLC program creation tool, which are also returned to the industrial agent as structured data; the industrial agent parses the content generated by the industrial AI model and calls the PLC program creation tool to enable the programmable logic software to automatically create the POU file and the corresponding program.
[0006] The natural language information includes a description of the PLC program functions, file names, and the name of the programmable logic software.
[0007] The industrial AI model performs the following operations: it identifies user intent based on natural language and generates structured data containing tool call parameters, which is then returned to the industrial agent.
[0008] The industrial agent is used to translate natural language into structured data, interact with industrial AI models, and invoke PLC program creation tools.
[0009] The programmable logic software enables the automatic creation and display of PLC programs. Attached Figure Description
[0010] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the solution description will be briefly introduced below.
[0011] Figure 1 This is a structural diagram of an automatic PLC program creation method based on an industrial agent according to the present invention.
[0012] Figure 2 This is a schematic diagram illustrating the operation process of an automatic PLC program creation method based on an industrial agent according to the present invention.
[0013] Figure 3 This is a client operation flowchart of the automatic PLC program creation method based on industrial agent of the present invention. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0015] Figure 1 This diagram illustrates the structure of a method for automatically creating PLC programs based on an industrial agent. The method primarily comprises three parts: an industrial agent, an industrial AI model, and programmable logic software. The industrial agent consists of a visual interface, a client, and a server. The client is mainly used for natural language structuring, parsing the content returned by the industrial AI model, and invoking tools within the server. The server sends action execution instructions to the programmable logic software to deploy the PLC program. The visual interface includes user input boxes and a dialog display interface, primarily used for user input of natural language and displaying content generated by the industrial AI model. The industrial AI model generates the PLC program and tool invocation strategy based on the user's dialogue. The programmable logic software automatically deploys the aforementioned PLC program.
[0016] Figure 2This is a schematic diagram illustrating the operation process of an automatic PLC program creation method based on an industrial agent. First, the user enters natural language information describing the PLC program creation in a dialog box on the industrial agent's visual interface. The client then converts this information, along with the PLC program creation tool information in the server, into structured data and sends it to the industrial AI model. The structured data information is shown in Table 1.
[0017] Table 1. Structured data converted by the Client.
[0018] Serial Number property describe 1 messages Includes user questions and roles, etc. 2 model The name of the industrial AI model invoked 3 temperature Controlling the randomness of content generated by industrial AI models The industrial AI model sends the data from the tool that creates the PLC program in the server and the generated PLC program to the client. This data information is shown in Table 2.
[0019] Table 2. Structured data generated by industrial AI models.
[0020] Serial Number property describe 1 id Unique identifier for industrial AI model invocation 2 model The name of the industrial AI model invoked 3 choices Information such as PLC programs generated by industrial AI models and tools created by calling PLC programs. 4 usage It records the resource consumption of each call to the industrial AI model. The client parses the structured data generated by the industrial AI model and calls the PLC program creation tool `write_to_prosys_file` in the server. This tool converts the names and parameters of the interfaces that need to call the programmable logic software into structured data and sends it to the programmable logic software via inter-process communication. The structured data in `write_to_prosys_file` is shown in Table 3.
[0021] Table 3. Structure data for write_to_prosys_file.
[0022] Serial Number property describe 1 funcName The name of the function to be called 2 params The parameters required by the called function include the project name, POU file name, and PLC program. Finally, the programmable logic software receives the data sent by write_to_prosys_file, calls the function named funcName, and passes the data in params as parameters to the called function. The programmable logic software then automatically displays the PLC program.
[0023] Figure 3This is a flowchart illustrating the client operation of an automated PLC program creation method based on an industrial agent. First, the client configures the industrial AI model using its URL, model name, and API Key. Then, before the user initiates a dialogue, the client establishes communication with the server, including constructing server parameters, establishing stdio communication, reading data returned by the server, sending requests to the server, and creating a client session object. Finally, when a user inputs query information, the client converts the query information into structured data, retrieves information about available tools, sends this information to the large model to obtain tool invocation requests, executes the tool invocation operation based on the large model's feedback, and finally submits all information to the large model to generate the content and provide feedback to the user.
Claims
1. A method for automatically creating PLC programs based on industrial agents, characterized in that, Includes the following steps: The user inputs natural language information describing the PLC program creation requirements through the industrial agent's dialog window; the industrial agent converts the natural language information and PLC program creation tool information into structured data and sends it to the industrial AI model; the industrial AI model analyzes the data sent by the industrial agent and generates the PLC program and instructions for calling the PLC program creation tool, which are also returned to the industrial agent as structured data; the industrial agent parses the content generated by the industrial AI model and calls the PLC program creation tool to enable the programmable logic software to automatically create the corresponding PLC program.
2. The method according to claim 1, characterized in that, The natural language information includes a description of the PLC program functions, file names, and the name of the programmable logic software.
3. The method according to claim 1, characterized in that, The industrial AI model performs the following operations: it identifies user intent based on natural language and generates structured data containing tool call parameters, which is then returned to the industrial agent.
4. The method according to claim 1, characterized in that, The industrial agent is used to translate natural language into structured data, interact with industrial AI models, and invoke PLC program creation tools.
5. The method according to claim 1, characterized in that, The programmable logic software enables the automatic creation and display of PLC programs.