Method and system for automatically generating PLC program, storage medium and program product
By automatically generating PLC programs, utilizing PLC standard library files and code generation method libraries, and combining them with project control object list files, the rapid generation and efficient writing of PLC programs are achieved, solving the problem of low programming efficiency and reducing labor costs.
Patent Information
- Application Number
- CN202510655118.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-09-12
AI Technical Summary
PLC program writing consumes a lot of time, has low programming efficiency, and the generated program has poor executable performance and cannot conform to the action logic conceived by engineers, resulting in a waste of personnel costs.
By creating PLC standard library files, establishing a code generation method library, and configuring project control object list files, PLC automatic generation software is used to automatically generate PLC programs, reducing manual code writing. Interface code generation files are written in C# language to achieve automatic program generation.
It greatly shortens the project development cycle, improves the readability and maintainability of the program, reduces labor costs, and ensures program accuracy and efficiency.
Smart Images

Figure CN120631321A_ABST
Abstract
Description
Technical field
[0003] With the development of AI, there are many AI applications on the market that automatically generate code. Most of them are based on pure software function codes and are highly accurate. However, for PLC programs, the programs generated by AI based on demand have poor executable properties and high error rates. Moreover, the generated programs cannot conform to the action logic conceived by engineers and cannot be applied to actual projects. Secondly, in large-scale projects, engineers need to spend a lot of time on programming, which is inefficient and results in a waste of personnel costs. [Summary of the invention] In order to solve the technical problem that the current PLC program requires a lot of time to write and the programming efficiency is low, the present invention proposes a method, system, storage medium and program product for automatically generating a PLC program.
[0005] The present invention is achieved by the following technical solutions: A method for automatically generating a PLC program comprises the following steps: Create PLC standard library files; According to the PLC standard library file, a code generation method library is established; Creating a project control object list file, and establishing a corresponding device attribute set according to the attribute information of the project control object list file; The device attribute set is matched with the code generation method library to generate a corresponding PLC program.
[0006] By adopting the above technical solution, PLC programs can be automatically generated on PLC automatic generation software through the code generation method library, without the need for engineers to manually write a large amount of code, which greatly shortens the project development cycle. In addition, the program written using this method greatly improves the readability and maintainability of the program; no matter how large the actual PLC project is, it only needs to configure the project control object list to quickly generate the program, which greatly improves the efficiency of code writing and also greatly reduces labor costs.
[0007] The method for automatically generating a PLC program as described above, wherein the creating of a PLC standard library file comprises: Encapsulate different PLC control objects into corresponding FB function blocks; Create a corresponding ST interface module according to the functional interface of the FB function block, and the ST interface module is used to call the functional control of the FB function block; The FB function block and the ST interface module are made into PLC standard library files.
[0008] The method for automatically generating a PLC program as described above, wherein a code generation method library is established based on the PLC standard library file, comprising: Creating a PLC subroutine, wherein the PLC subroutine is used to call the interface program of the PLC standard library file, and the PLC subroutine includes an input interface program set, an output interface program set, and an operation logic program set; Establishing an attribute information database, wherein the attribute information database is used to store attribute information of the PLC standard library file; Generate a corresponding interface code generation file according to the PLC subroutine; The attribute information database and the interface code generation file are made into a code generation method library.
[0009] In the method for automatically generating a PLC program as described above, the step of creating a project control object list file includes: Obtain device information of the control device, including: the system to which the device belongs, the device abbreviation, the device brand, and the configuration quantity; According to the device information, it is configured as a project control object list file.
[0010] In the method for automatically generating a PLC program as described above, establishing a corresponding device attribute set based on the device information in the project control object list file includes: Traversing the device information of the project control object list file, and classifying the project control objects of different systems to which the devices belong; According to the classification results, a corresponding device attribute set is established.
[0011] The method for automatically generating a PLC program as described above, wherein the device attribute set is matched with the code generation method library to generate a corresponding PLC program, includes: The attribute information database traverses the device attribute set; If there is corresponding attribute information, the corresponding interface code generation file is called to generate the corresponding PLC program; If there is no corresponding attribute information, an empty program is generated.
[0012] An embodiment of the present invention further provides a system for automatically generating a PLC program, the system comprising: Create a module, which is used to create PLC standard library files; An establishment module is used to establish a code generation method library according to the PLC standard library file; A configuration module, which is used to create a project control object list file and establish a corresponding device attribute set according to the attribute information of the project control object list file; A generation module is used to match the device attribute set with the code generation method library to generate a corresponding PLC program.
[0013] In the system for automatically generating a PLC program as described above, the establishment module includes: A second creation unit, which is used to create a PLC subroutine; A first establishing unit, which is used to establish an attribute information database; A first generating unit, configured to generate a corresponding interface code generation file according to the PLC subroutine; The second generating unit is used to convert the attribute information database and the interface code generation file into a code generation method library.
[0014] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the method for automatically generating a PLC program as described above are implemented.
[0015] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program implements the steps in the method for automatically generating a PLC program as described above.
[0016] Compared with the prior art, the method for automatically generating a PLC program proposed in the present invention has the following beneficial effects: 1. The method for automatically generating PLC programs proposed in the present invention can automatically generate PLC programs on PLC automatic generation software through a code generation method library, eliminating the need for engineers to manually write large amounts of code, greatly shortening the project development cycle. In addition, programs written using this method greatly improve program readability and maintainability. No matter how large the actual PLC project is, it only requires configuring a project control object list file to quickly generate the program, greatly improving the efficiency of code writing and also greatly reducing labor costs.
[0017] 2. The project control object list file proposed in the present invention allows engineers to add multiple control devices at one time and quickly complete project configuration, greatly saving the configuration time in the early stage of the project; secondly, the PLC automatic generation software can generate a matching PLC control program based on the configured project control object list file, ensuring the accuracy of the automatic program generation. At the same time, it can also batch generate PLC control programs corresponding to each device based on the project control object list file.
Brief Description of the Drawings
[0019] Figure 1 A flow chart of a method for automatically generating a PLC program according to the present invention; Figure 2 for Figure 1 Specific flow chart of step S1; Figure 3 for Figure 1 Specific flow chart of step S2; Figure 4 for Figure 1 Partial flow chart of step S3; Figure 5 for Figure 1 Another partial flow chart of step S3; Figure 6 for Figure 1 Specific flow chart of step S4; Figure 7 It is a partial schematic diagram of the attribute information database of the present invention; Figure 8 A partial schematic diagram of a configuration control object list file of the present invention; Figure 9 This is a preview interface diagram of the PLC program code of the present invention; Figure 10 The following is a schematic diagram of the system structure for automatically generating a PLC program according to an embodiment of the present invention. [Specific implementation method] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0021] The present invention proposes a method, system, storage medium and program product for automatically generating a PLC program. The PLC program may include but is not limited to Siemens, Omron, Inovance, Keyence and Mitsubishi.
[0022] Please refer to Figures 1 to 9 As shown, the embodiment of the present invention provides a method for automatically generating a PLC program, including steps S1-S4, wherein: S1, create PLC standard library file.
[0023] Specifically, the PLC standard library file is used to store control function modules and control functions, and provides a unified interface. In actual use, the control function of the PLC standard library file can be called directly through the interface without rewriting the program code, which greatly saves programming time.
[0024] Furthermore, as a preferred embodiment of this solution but not a limitation, step S1 includes steps S11-S13, wherein: S11, encapsulate different PLC control objects into corresponding FB function blocks; S12, creating a corresponding ST interface module according to the functional interface of the FB function block, wherein the ST interface module is used to call the functional control of the FB function block; S13, making the FB function block and the ST interface module into a PLC standard library file.
[0025] The FB function block is a standard logic function control block that can perform functional control on a PLC control object. The FB function block mainly includes an FB input interface, an FB output interface, and FB operation logic.
[0026] Specifically, the PLC control objects commonly used in PLC projects are encapsulated into corresponding FB function blocks, and the corresponding ST interface modules are written according to the FB input interface and FB output interface of the FB function block. That is, the ST interface module includes an ST input interface with a mapping relationship with the FB input interface, and an ST output interface with a mapping relationship with the FB output interface. Then, the FB function block and the ST interface module are written into the library file to make the corresponding PLC standard library file, which lays the foundation for the subsequent automatic generation of programs.
[0027] It should be understood that in PLC programming, the above-mentioned PLC control objects are simplified into programmable models through abstraction, so that the PLC control objects can be programmed. The abstraction method refers to extracting common, essential features from many things and discarding their non-essential features. Taking the control object as an example, the cylinder diameter, stroke, material, shape and other features that are not related to the cylinder motion control are discarded; while the main information such as the cylinder valve block interface information and sensor configuration information is retained. The above-mentioned PLC control objects may include but are not limited to cylinders, motors, barcode scanners, sensors, flow meters, solenoid valves and other control devices in the PLC project, and this application does not specifically limit this.
[0028] In addition, since the PLC standard library file is written based on the PLC control object, the PLC standard library file contains attribute information such as the device ID, the workstation to which it belongs, interface information, alarm method, function block calling method, and warning method of the PLC control object.
[0029] In this embodiment, by encapsulating different control objects into independent FB function blocks, they can be reused in different PLC projects or control systems. Engineers only need to perform simple parameter configuration according to actual conditions without having to rewrite the program. Secondly, an ST interface module with a mapping relationship to the FB function block interface is created, which provides a consistent interface specification for calling the FB function block, reduces errors and failures caused by inconsistent interfaces, and also lays the foundation for subsequent automatic program generation.
[0030] To supplement the above embodiment, the FB input port of the FB function block is defined with the device abbreviation and ID number of the PLC control object and the related control instructions for starting, stopping or resetting the FB function block; the FB output port is defined with the related output instructions for sending signals to external devices or other function blocks; and the FB operation logic processes the data received by the FB function block and generates output data.
[0031] S2, establishing a code generation method library according to the PLC standard library file.
[0032] Specifically, according to the interface and attribute information of the PLC standard library file, a code generation method library is established on the PLC automatic program generation software, so that engineers can automatically generate corresponding PLC programs on the PLC automatic program generation software according to actual project requirements.
[0033] Among them, the PLC automatic generation program software is software that supports C# language writing. The PLC automatic generation software of this embodiment is preferably Visual Studio software.
[0034] In this embodiment, the PLC automatic program generation software is used to automatically generate the PLC program instead of generating it in the PLC's own programming software. The purpose is to avoid interfering with the main control program of the PLC project, thereby affecting the normal operation of the PLC project. Secondly, the PLC automatic program generation software can support the use of multiple members, ensuring the consistency of the project process and improving the efficiency of collaboration between teams.
[0035] Furthermore, as a preferred embodiment of this solution but not limiting, step S2 includes steps S21-S24, wherein: S21, create a PLC subroutine; S22, establishing an attribute information database; S23, generating a corresponding interface code generation file according to the PLC subroutine; S24, creating a code generation method library by converting the attribute information database and the interface code generation file.
[0036] Among them, the PLC subroutine is used to call the interface program of the PLC standard library file, and the PLC subroutine includes an input interface program set Act_in, an output interface program set Act_out and an operation logic program set Act_logic; the attribute information database is used to save the attribute information of the PLC standard library file, and the attribute information includes the device ID, system to which it belongs, device abbreviation, device Chinese name, brand name, function block name, interface name and other information of each PLC control object.
[0037] The above-mentioned input interface program set Act_in stores the calling program for calling the FB input interface of the FB function block. The calling program is written according to the relevant instructions defined by the FB input interface and can realize the comprehensive calling of the FB input interface; The output interface program set Act_out stores a calling program for calling the FB output interface of the FB function block. The calling program is written according to the relevant instructions defined by the FB output interface and can realize the comprehensive calling of the FB output interface. The above-mentioned operation logic program set Act_logic stores a program for realizing the establishment of a mapping relationship between the ST interface module and the FB function block interface.
[0038] Specifically, based on the PLC standard library file, a PLC subroutine is created that can call the FB function block program in the PLC standard library file, and based on the created PLC subroutine, an interface code generation file corresponding to the PLC subroutine is written in C# language on the PLC automatic generation software, that is, the interface code generation file also includes generation files corresponding to the input interface program set Act_in, the output interface program set Act_out, and the operation logic program set Act_logic. The interface code generation file can perform program calls on the FB function block according to the interface of the PLC standard library file, that is, the FB function block can be called on the PLC automatic generation software only through the interface code generation file to complete the automatic generation of the program; Also, please refer to Figure 7 As shown, the attribute information of the PLC standard library file is also saved in the attribute information database, so that when the program is automatically generated later, the corresponding PLC standard library file can be matched according to the attribute information saved in the attribute information database, so that a matching PLC program can be generated. The above-mentioned interface code generation file and the above-mentioned attribute information database are made into a code generation method library, which can facilitate engineers to generate corresponding PLC programs directly through the code generation method library according to actual project requirements.
[0039] In this embodiment, the code generation method library can be used to automatically generate a PLC program corresponding to the PLC standard library file on the PLC automatic generation software, without the need for engineers to manually write a large amount of code, which greatly shortens the development cycle; secondly, since the C# language supports object-oriented programming, the code production logic can be encapsulated into classes and methods. Therefore, the interface code generation file is written in the C# language on the PLC automatic generation software, making the code structure clearer, simpler and more modular. At the same time, the C# language is compatible with the communication protocols and library files of different PLC brands, so that the code generation method library can be applied to PLCs of different brands, and can realize the automatic generation of programs for PLCs of different brands.
[0040] S3: Create a project control object list file, and establish a corresponding device attribute set according to the device information in the project control object list file.
[0041] Specifically, engineers add the required PLC control objects to the PLC program automatic generation software based on the actual needs of the PLC project, and select and input the device information of each PLC control object to configure it into the project control object list file of the PLC project. Subsequently, the PLC program automatic generation software will generate the PLC program of the PLC project based on this project control object list file.
[0042] Furthermore, as a preferred embodiment of this solution but not limiting, step S3 includes steps S31-S32, wherein: S31, obtaining device information of the control device, wherein the device information includes: the system to which the device belongs, the device abbreviation, the device brand, and the configuration quantity; S32: According to the device information, configure it into a project control object list file.
[0043] For details, please refer to Figure 8 As shown, engineers select the required PLC control object based on actual project requirements in the configuration list interface of the PLC automatic generation software and enter the device information for the PLC control object. Taking the medium-frequency power supply as an example, after entering the required system for the medium-frequency power supply as the process system, the device abbreviation MF, the brand Hottinger, and the configuration quantity as 5, they click Add to generate the list file for the PLC control object. Similarly, after adding all the required PLC control objects, the engineer can configure the project control object list file for the PLC project.
[0044] In this embodiment, engineers can add multiple control devices at one time on the PLC program automatic generation software, quickly complete the project configuration, and greatly save the configuration time in the early stage of the project; secondly, the PLC automatic generation software can generate a matching PLC control program based on the configured project control object list file, ensuring the accuracy of the automatic program generation, and can also batch generate PLC control programs corresponding to each device based on the project control object list file.
[0045] As a better implementation method, in order to facilitate engineers to quickly modify and generate PLC control programs corresponding to PLC control objects when facing new design requirements or functional requirements in the later stage of the project, the configuration list interface also has a delete function for deleting PLC control objects and an add function for adding PLC control objects.
[0046] Specifically, when you need to delete a redundant PLC control object, you only need to enter the device information of the corresponding PLC control object and click Delete to delete it. Similarly, when adding a new PLC control object, you only need to enter the device information of the corresponding PLC control object and click Add to add it.
[0047] As a preferred implementation, the step S3 further includes steps S33-S34, wherein: S33, traversing the device information of the project control object list file, and classifying the project control objects of different systems to which the devices belong; S34: Establish a corresponding device attribute set based on the classification result.
[0048] Specifically, after configuring the project control object list file, the PLC program automatically generates software to traverse the device information in the project control object list file, using the system to which the device belongs as the screening condition during the traversal. That is, the project control object list file is traversed, and during the traversal process, PLC control objects with the same device system are classified into the same category, and a corresponding device attribute set is established. Taking the vacuum system as an example, if the project control object list file is found to contain three PLC control objects, namely, a mechanical pump, a Roots pump, and a molecular pump, which all belong to the vacuum system, during the traversal process, the PLC program automatically generates software to classify these three PLC control objects into the same category, and establish a device attribute set for the vacuum system to store the device information of these three PLC control objects.
[0049] It is understandable that the above traversal using the system to which the device belongs as the filtering condition is only a preferred implementation method. In actual applications, other device information can also be used as the filtering condition for traversal, such as the brand of the device.
[0050] In this embodiment, the project control object list files are classified according to the systems to which the equipment belongs, and a PLC control program that matches the corresponding systems can be generated according to the characteristics of each system and the equipment attribute set, thereby ensuring the accuracy of program generation; secondly, the equipment attribute set established according to the classification result enables the PLC program automatic generation software to generate programs in a modular manner, which not only ensures the accuracy of program automatic generation, but also reduces the complexity and error rate of program design, thereby improving the reliability of the automatic program generation method.
[0051] S4, matching the device attribute set with the code generation method library to generate a corresponding PLC program.
[0052] Furthermore, as a preferred embodiment of this solution but not limiting, step S4 includes steps S41-S43, wherein: S41, the attribute information database traverses the device attribute set; S42, if the corresponding attribute information exists, then call the corresponding interface code generation file to generate the corresponding PLC program; S43: If there is no corresponding attribute information, an empty program is generated.
[0053] Specifically, based on the device attribute set established after the above classification, the code generation method library will traverse each device attribute set to determine which PLC control objects in the attribute information database match the device attribute set. After determination, the attribute information database will call the corresponding interface code generation file according to the function block name attribute in the device attribute set to generate a PLC program corresponding to the function block name attribute.
[0054] To better understand this process, please refer to Figure 9 As shown, in the PLC program code preview interface of the PLC program automatic generation software, a program preview code box matching the above-mentioned device attribute set will be generated. Taking the vacuum system as an example, the engineer first clicks the main program button in the preview vacuum system code box, and the attribute information database of the code generation method library is traversed to filter out the PLC control objects belonging to the vacuum system; then clicks the ACT_In button, ACT_Out button or ACT_Logic button, and the attribute information database obtains the function block name attribute of the device attribute set. The code generation method library calls the corresponding interface code generation file according to the function block name attribute to generate a PLC program corresponding to the device attribute set.
[0055] In this embodiment, by traversing the device attribute set and matching it with the attribute information database, the PLC control object corresponding to each device attribute set can be accurately identified. After the corresponding PLC control object is identified, the corresponding interface code generation file is called according to the function block name attribute in the device attribute set. This avoids confusion or errors in the program generation process, improves program generation accuracy, and ensures that the generated PLC program closely corresponds to the actual functional requirements of the control device, ensuring the program's logical and functional accuracy. In addition, programs written using this method greatly improve the readability and maintainability of the program; no matter how large the actual PLC project is, it only takes time to configure the project control object list file to quickly generate the program, which greatly improves the efficiency of code writing and greatly reduces labor costs.
[0056] A method for automatically generating a PLC program according to an embodiment of the present invention is described in detail. Figure 10 As shown, an embodiment of the present invention further provides a system for automatically generating a PLC program. The system 100 for automatically generating a PLC program includes: A creation module 101 is used to create a PLC standard library file; Establishing module 102, which is used to establish a code generation method library according to the PLC standard library file; Configuration module 103, which is used to create a project control object list file and establish a corresponding device attribute set according to the attribute information of the project control object list file; The generating module 104 is configured to match the device attribute set with the code generation method library to generate a corresponding PLC program.
[0057] Furthermore, as a preferred embodiment of this solution but not a limitation, the creation module 101 includes: Encapsulation unit, which is used to encapsulate different PLC control objects into corresponding FB function blocks; A first creating unit, which is used to create a corresponding ST interface module according to the functional interface of the FB function block, and the ST interface module is used to call the functional control of the FB function block; A production unit is provided, wherein the FB function block and the ST interface module are produced into a PLC standard library file.
[0058] Furthermore, as a preferred embodiment of this solution but not limiting, the establishment module 102 includes: A second creation unit, which is used to create a PLC subroutine; A first establishing unit, which is used to establish an attribute information database; A first generating unit, configured to generate a corresponding interface code generation file according to the PLC subroutine; The second generating unit is used to convert the attribute information database and the interface code generation file into a code generation method library.
[0059] Furthermore, as a preferred implementation of this solution but not limiting, the configuration module 103 includes: An acquisition unit, configured to acquire device information of a control device, wherein the device information includes: the system to which the device belongs, the device abbreviation, the device brand, and the configuration quantity; A configuration unit is used to configure the input device information into a project control object list file.
[0060] Furthermore, as a preferred implementation of this solution but not limiting, the configuration module 103 further includes: A first traversal unit is used to traverse the device information of the project control object list file and classify the project control objects of different systems to which the devices belong; The second establishing unit is used to establish a corresponding device attribute set according to the classification result.
[0061] Furthermore, as a preferred embodiment of this solution but not limiting, the generating module 104 includes: A second traversal unit, configured to traverse the device attribute set in the attribute information database; A calling unit is used to call the corresponding interface code generation file and generate the corresponding PLC program if the corresponding attribute information exists; The third generating unit is configured to generate an empty program if there is no corresponding attribute information.
[0062] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the method for automatically generating a PLC program provided in an embodiment of the present invention or the application-side application and the various processes of the method for automatically generating a PLC program, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0063] An embodiment of the present invention further provides a computer program product, which, when executed by a processor, implements the method for automatically generating a PLC program provided by an embodiment of the present invention.
[0064] Those skilled in the art should understand that the above description is provided as an example of an implementation method in conjunction with specific content, and the specific implementation of the present invention is not limited to these descriptions. Furthermore, due to differences in industry nomenclature, the present invention is not limited to the above nomenclature, nor is it limited to English nomenclature. Any similarity or similarity to the methods and structures of the present invention, or any technical deduction or substitution based on the concept of the present invention, shall be considered within the scope of protection of the present invention.
Claims
1. A method for automatically generating a PLC program, characterized in that: include: Create PLC standard library files; According to the PLC standard library file, a code generation method library is established; Creating a project control object list file, and establishing a corresponding device attribute set according to the attribute information of the project control object list file; The device attribute set is matched with the code generation method library to generate a corresponding PLC program.
2. A method for automatically generating a PLC program according to claim 1, characterized in that: The step of creating a PLC standard library file includes: Encapsulate different PLC control objects into corresponding FB function blocks; Create a corresponding ST interface module according to the functional interface of the FB function block, and the ST interface module is used to call the functional control of the FB function block; The FB function block and the ST interface module are made into PLC standard library files.
3. The method for automatically generating a PLC program according to claim 1, wherein: The code generation method library is established according to the PLC standard library file, including: Creating a PLC subroutine, wherein the PLC subroutine is used to call the interface program of the PLC standard library file, and the PLC subroutine includes an input interface program set, an output interface program set, and an operation logic program set; Establishing an attribute information database, wherein the attribute information database is used to store attribute information of the PLC standard library file; Generate a corresponding interface code generation file according to the PLC subroutine; The attribute information database and the interface code generation file are made into a code generation method library.
4. The method for automatically generating a PLC program according to claim 1, wherein: The step of creating a project control object list file includes: Obtain device information of the control device, including: the system to which the device belongs, the device abbreviation, the device brand, and the configuration quantity; According to the device information, it is configured as a project control object list file.
5. The method for automatically generating a PLC program according to claim 4, characterized in that: The establishing of a corresponding device attribute set according to the device information in the project control object list file includes: Traversing the device information of the project control object list file, and classifying the project control objects of different systems to which the devices belong; According to the classification results, a corresponding device attribute set is established.
6. The method for automatically generating a PLC program according to claim 3, characterized in that: The matching of the device attribute set with the code generation method library to generate a corresponding PLC program includes: The attribute information database traverses the device attribute set; If there is corresponding attribute information, the corresponding interface code generation file is called to generate the corresponding PLC program; If there is no corresponding attribute information, an empty program is generated.
7. A system for automatically generating PLC programs, characterized in that: include: Create a module, which is used to create PLC standard library files; An establishment module is used to establish a code generation method library according to the PLC standard library file; A configuration module, which is used to create a project control object list file and establish a corresponding device attribute set according to the attribute information of the project control object list file; A generation module is used to match the device attribute set with the code generation method library to generate a corresponding PLC program.
8. The system for automatically generating a PLC program according to claim 7, characterized in that: The establishment module includes: A second creation unit, which is used to create a PLC subroutine; A first establishing unit, which is used to establish an attribute information database; A first generating unit, configured to generate a corresponding interface code generation file according to the PLC subroutine; The second generating unit is used to convert the attribute information database and the interface code generation file into a code generation method library.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method for automatically generating a PLC program according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in the method for automatically generating a PLC program according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
PLC project description method and system
CN121300215A
A method and system for describing a PLC project
CN121300215B
