Method and device for generating programmable logic controller program
By generating class model and instance information files and automatically correlating PLC program source files, the problems of low development efficiency and high error rate of medium and large control systems are solved, and efficient and accurate PLC program development is achieved.
Patent Information
- Application Number
- CN202410732900.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-11
AI Technical Summary
In the field of industrial control, the PLC program development of medium and large control systems is inefficient and prone to errors. Especially when dealing with a large number of basic equipment, a large number of manual interface variables are required, resulting in large workloads and high error rates.
By generating class model files and instance information files, performing association processing based on interface categories, generating extensible markup language (XML) files, automating the control logical association of basic devices, and reducing manual intervention.
It significantly improves the development efficiency and quality of PLC programs, shortens development time, reduces error rate, and improves work efficiency, especially in large-scale projects such as the application of subway station equipment monitoring systems.
Smart Images

Figure CN118760481A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, industrial control technology, and in particular to a method and device for generating a programmable logic controller (PLC) program. Background Art
[0002] In the field of industrial control, due to the characteristics of the controlled objects, system scale, complexity and functional requirements, there are generally three sizes of control systems: small, medium and large. Medium and large control systems are common in large-scale production and manufacturing (such as chemical, metallurgical, electric power and automobile, etc.), complex continuous process control (such as oil refining, pharmaceutical, papermaking, etc.), large infrastructure (such as water treatment plants, energy management systems, logistics centers, etc.) and comprehensive production parks. The PLC programs of these control systems are usually modularly designed and require the collaboration of professional teams including system architects, senior programmers and field engineers.
[0003] The idea of modular programming is to decompose the entire control program into several independent functional modules, each of which focuses on completing specific tasks or subtasks, such as basic equipment control, communication protocol processing, or specific algorithms. Faced with a large number of basic equipment such as motors and valves in medium and large projects, system architects often plan the control logic of each type of basic equipment into a common control program for repeated calls in various processes to avoid repeatedly writing the same control logic. There are often hundreds of these basic equipment, and the workload of field engineers when calling the control program of the basic equipment multiple times is extremely large. In addition, when calling, they need to manually confirm the associated program interface variables, and it is also very easy to cause errors and other situations that affect the operation of the control program.
[0004] Given that most integrators in the industrial control field have adopted the idea of modular program design during project implementation, which has improved work efficiency to a certain extent, there is still a huge workload and errors that easily affect the operation of the control program. How to improve the development efficiency and quality of PLC programs has become a problem to be solved. Summary of the invention
[0005] The following is a summary of the subject matter described in detail in this application. This summary is not intended to limit the scope of the claims.
[0006] The embodiments of the present disclosure provide a method and device for generating a PLC program, which can improve the development efficiency and quality of the PLC program.
[0007] The present disclosure provides a method for generating a PLC program, including:
[0008] Generate class model files based on the logic between the device interface file and the controlled object;
[0009] Generate instance information file according to the list information of the controlled object;
[0010] The generated class model file and instance information file are associated based on the interface category to obtain an associated file containing basic information of the PLC program source file;
[0011] Generate an extensible markup language XML file according to the obtained associated file containing basic information of the PLC program source file;
[0012] Among them, the XML file is the PLC program source file.
[0013] On the other hand, an embodiment of the present disclosure further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method for generating the PLC program is implemented.
[0014] In another aspect, an embodiment of the present disclosure further provides a terminal, comprising: a memory and a processor, wherein the memory stores a computer program; wherein:
[0015] The processor is configured to execute the computer program in the memory;
[0016] When the computer program is executed by the processor, the method for generating the PLC program as described above is implemented.
[0017] In another aspect, the embodiment of the present disclosure further provides a PLC program generation device, comprising: a first generation unit, a second generation unit, an association unit and a third generation unit; wherein,
[0018] The first generating unit is configured to generate a class model file according to the logic between the device interface file and the controlled object;
[0019] The second generating unit is configured to: generate an instance information file according to the inventory information of the controlled object;
[0020] The association unit is set to: perform association processing on the generated class model file and instance information file based on the interface category to obtain an association file containing basic information of the PLC program source file;
[0021] The third generating unit is configured to generate an extensible markup language XML file according to the obtained associated file containing basic information of the PLC program source file;
[0022] Among them, the XML file is the PLC program source file.
[0023] The disclosed embodiment generates an XML file based on a class model file and an instance information file, thereby improving the development efficiency and quality of a PLC program.
[0024] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0026] Figure 1 It is a flow chart of a method for generating a PLC program according to an embodiment of the present disclosure;
[0027] Figure 2 It is a structural block diagram of a device for generating a PLC program according to an embodiment of the present disclosure;
[0028] Figure 3 The following is a flowchart of an example of application of the present disclosure. DETAILED DESCRIPTION
[0029] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0030] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0031] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0032] Figure 1 Flow chart of the method for generating a PLC program according to an embodiment of the present disclosure, as shown in FIG. Figure 1 As shown, including:
[0033] Step 101, generating a class model file according to the logic between the device interface file and the controlled object;
[0034] Step 102: Generate an instance information file based on the inventory information of the controlled object;
[0035] Step 103: performing association processing on the generated class model file and instance information file based on the interface category to obtain an association file containing basic information of the PLC program source file;
[0036] Step 104: Generate an XML file based on the obtained associated file containing basic information of the PLC program source file;
[0037] Among them, the XML file is the PLC program source file.
[0038] The disclosed embodiments may be applied to a subway station environment and equipment monitoring system (BAS) in rail transit, which uses a large PLC to control electromechanical equipment.
[0039] In the embodiments of the present disclosure, the basic information of the PLC program source file generally includes one or any combination of the following:
[0040] System name: System, device name: EqName, device description: EqDscp, parameter category: ParType, parameter name: ParName, parameter description: ParDscp, data type: DataType, interface parameter: ItfPar, interface category: ItfType, class name: SubName;
[0041] In an exemplary embodiment, the disclosed embodiment defines different controlled objects as different classes, establishes a class model, and then uses different classes to derive multiple different instance objects.
[0042] In an exemplary embodiment, the controlled object of the embodiment of the present disclosure may include one or any combination of the following: a fan, an air volume regulating valve, an elevator, lighting, and a water pump.
[0043] In an exemplary embodiment, the class model file of the embodiment of the present disclosure includes the following information in one or any combination: class name: SubName, class description: SubDscp, parameter category: ParType, parameter name: ParName, parameter description: ParDscp, data type: DataType, interface parameter: ItfPar, interface category: ItfType;
[0044] The interface categories include: system S, array A, device E, and system and array SA; the field of the interface parameter includes characters to be replaced: x, xx, x1, and x2.
[0045] In an exemplary embodiment, the class model file of the embodiment of the present disclosure may be named clsDev and may be stored in Excel or plain text format. The class model file is shown in Table 1:
[0046]
[0047] Table 1
[0048] In an exemplary embodiment, the instance information file of the embodiment of the present disclosure includes the following information in one category or any combination: system name: System, class name: SubName, device name: EqName, device description: EqDscp.
[0049] In an exemplary embodiment, the list information of the controlled object of the embodiment of the present disclosure may be included in the CAD drawing of the design institute, and the CAD drawing of the design institute includes: name, device description, belonging system and other information. The instance information file may be an instance list file, the instance list file may be named lstDev, the instance information file may be stored in Excel or plain text format, and the instance information file may refer to Table 2:
[0050] System SubName EqName EqDscp RVS01 Sub_SF2J TSJH03_SF_a1 Blower TSJH03_SF_a1 RVS01 Sub_SF2J TSJH03_PF_a1 Exhaust fan TSJH03_PF_a1 RVS01 Sub_DDLS DT_PF_a1_1 Electric air volume control valve DT_PF_a1_1 RVS01 Sub_FH2 ZF_SF_a1_1 70℃ smoke and fire damper ZF_SF_a1_1 RVS01 Sub_FH2 ZF_SF_a1_2 70℃ smoke and fire damper ZF_SF_a1_2 RVS01 Sub_FH2 ZF_SF_a1_3 70℃ smoke and fire damper ZF_SF_a1_3 RVS01 Sub_FH2 ZF_SF_a1_4 70℃ smoke and fire damper ZF_SF_a1_4 RVS01 Sub_FH2 ZF_PF_a1_1 70℃ smoke and fire damper ZF_PF_a1_1 RVS01 Sub_FH2 ZF_PF_a1_2 70℃ smoke and fire damper ZF_PF_a1_2 RVS01 Sub_FH2 ZF_PF_a1_3 70℃ smoke and fire damper ZF_PF_a1_3 RVS01 Sub_FH2 ZF_PF_a1_4 70℃ smoke and fire damper ZF_PF_a1_4 RVS02 Sub_SF2J TSJH03_SF_b1 Blower TSJH03_SF_b1 RVS02 Sub_DDLS DT_SF_b1_1 Electric air volume control valve DT_SF_b1_1 RVS02 Sub_SF2J TSJH03_PF_b1 Exhaust fan TSJH03_PF_b1 RVS02 Sub_DDLS DT_PF_b1_1 Electric air volume control valve DT_PF_b1_1 RVS02 Sub_FH2 ZF_SF_b1_1 70℃ smoke and fire damper ZF_SF_b1_1 RVS02 Sub_FH2 ZF_PF_b1_1 70℃ smoke and fire damper ZF_PF_b1_1
[0051] Table 2
[0052] In an exemplary embodiment, the generation method of the embodiment of the present disclosure further includes: preprocessing the class model file clsDev and the instance information file lstDev;
[0053] The preprocessing includes: checking for duplicates and / or processing special characters on the device name. The preprocessing in the embodiment of the present disclosure can be implemented based on relevant technologies including text analysis methods.
[0054] In an exemplary embodiment, during the process of generating an XML file, the embodiment of the present disclosure can display the file processing progress through a preset interactive window.
[0055] In an exemplary instance, the disclosed embodiment preprocesses the class model file clsDev and the instance information file lstDev, including checking the standardization and uniqueness of the device name. When an error is found, an error message can be prompted through a preset interactive window. After the above-mentioned preprocessing of the class model file clsDev and the instance information file lstDev, subsequent processing is continued.
[0056] In an exemplary embodiment, the embodiment of the present disclosure performs association processing on the generated class model file and instance information file based on the interface category to obtain an association file containing basic information of the PLC program source file, including:
[0057] Import the class model file and instance information file into the database;
[0058] Based on the class model file and the instance information file, a cross information file is created through cross query;
[0059] In the cross-information file, filter the records whose ItfType field content contains the interface category E, traverse each filtered record, and replace the "xx" in the ItfPar field content with the EqName field content;
[0060] In the cross-information file, filter the records whose ItfType field content contains the interface type S, traverse each filtered record, and replace the "x" in the ItfPar field content with the System field content;
[0061] In the cross-information file, select the records whose ItfType field content contains interface type A, traverse each selected record, and replace the "x" in the ItfPar field content with an increasing number;
[0062] In the cross-information file, filter the records whose ItfType field content contains the interface category SA, traverse each filtered record, replace "x1" in the ItfPar field content with the System field content, and replace "x2" in the ItfPar field content with an increasing digital number.
[0063] In an exemplary embodiment, the database of the embodiment of the present disclosure may be an Access database.
[0064] In an exemplary instance, the embodiment of the present disclosure can associate the interface variables of the control program of the basic equipment according to the logical relationship of the controlled objects in the class model file, thereby avoiding errors caused by manual association; by automatically associating the interface variables for each basic equipment one by one, an XML format file that complies with the rules of the PLC programming software is obtained.
[0065] In an exemplary embodiment, when the embodiment of the present disclosure generates an XML file, the method further includes:
[0066] Filter the records whose ItfType field content contains interface type A from the cross-information file;
[0067] The content of the filtered ItfType field contains the register address assigned to each array in the ItfPar field in the record with interface class A;
[0068] Export the data after address allocation is completed to generate a human-machine interface (HMI) data point table.
[0069] In an exemplary embodiment, the programming software used in the embodiment of the present disclosure may be AutoThink, and the selected PLC may be a PLC used in conjunction with AutoThink. The programming software supports the import and export of user programs in XML format. The embodiment of the present disclosure may generate two types of files, XML and Excel, wherein the XML file is a PLC program source file, and the Excel file is an HMI data point table; the generated XML file is imported into the programming software AutoThink, and the HMI data point table is provided to the upper monitoring platform for use.
[0070] In an exemplary embodiment, the disclosed embodiment can be based on a computer embodiment with the following configuration, and the minimum configuration of the computer is as follows: hardware environment: display: color CRT or LCD screen; input and output: standard keyboard, mouse; graphics card: resolution supports 1280×720; CPU: Intel Pentium 2.4GHz or above; memory: 512MB or above; hard disk: 10GB or above; software environment: operating system: Windows 10Professional 32 / 64 bit; tool software: Microsoft OfficeAccess 2016. The disclosed embodiment is based on the concept of "class, instance, object" in the source high-level programming language, and applies the object-oriented programming method in IT programming to the field of PLC programming, which is different from the method of using Excel formula or Excel VBA to implement PLC programming; the object in the disclosed embodiment refers to the controlled physical equipment in the industrial control system or the process that can be abstracted as a virtual individual, and different objects have different characteristic attributes. The disclosed embodiment can be implemented based on C# high-level programming language and Access database, and can also be implemented through other high-level languages such as C, C++, Java, Python and other databases such as Mysql and SqlServer. Assuming a standard subway station environment control system, including 22 types of electromechanical equipment, the total number of basic equipment is about 500; when calling the packaged basic equipment control program, if the method of manually calling and associating interface variables in the relevant technology is used, an average of 80 devices can be completed per day, which takes at least 6 working days. The method of the embodiment of the present disclosure can shorten the time consumption to less than 0.5 working days, improve the efficiency by more than 90%, and the program interface variable association error rate is 0%.
[0071] The embodiment of the present disclosure further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method for generating the PLC program is implemented.
[0072] The embodiment of the present disclosure also provides a terminal, including: a memory and a processor, wherein a computer program is stored in the memory;
[0073] in,
[0074] The processor is configured to execute the computer program in the memory;
[0075] When the computer program is executed by a processor, the method for generating a PLC program as described above is implemented.
[0076] Figure 2 FIG. 1 is a structural block diagram of a device for generating a PLC program according to an embodiment of the present disclosure, such as Figure 2 As shown, it includes: a first generating unit, a second generating unit, an associating unit and a third generating unit; wherein,
[0077] The first generating unit is configured to generate a class model file according to the logic between the device interface file and the controlled object;
[0078] The second generating unit is configured to: generate an instance information file according to the inventory information of the controlled object;
[0079] The association unit is set to: perform association processing on the generated class model file and instance information file based on the interface category to obtain an association file containing basic information of the PLC program source file;
[0080] The third generating unit is configured to generate an extensible markup language XML file according to the obtained associated file containing basic information of the PLC program source file;
[0081] Among them, the XML file is the PLC program source file.
[0082] In an exemplary embodiment, the class model file of the embodiment of the present disclosure includes one or any combination of the following information: class name, class description, parameter category, parameter name, data type, interface parameter and interface category;
[0083] The interface categories include: system S, array A, device E, and system and array SA; the field of the interface parameter includes characters to be replaced: x, xx, x1, and x2.
[0084] In an exemplary embodiment, the instance information file of the embodiment of the present disclosure includes one or any combination of the following information: system name, class name, device name, and device description.
[0085] In an exemplary embodiment, the association unit of the embodiment of the present disclosure is configured as follows:
[0086] Import the class model file and instance information file into the database;
[0087] Based on the class model file and the instance information file, a cross information file is created through cross query;
[0088] In the cross-information file, filter the records whose ItfType field content contains the interface category E, traverse each filtered record, and replace the "xx" in the ItfPar field content with the EqName field content;
[0089] In the cross-information file, filter the records whose ItfType field content contains the interface type S, traverse each filtered record, and replace the "x" in the ItfPar field content with the System field content;
[0090] In the cross-information file, select the records whose ItfType field content contains interface type A, traverse each selected record, and replace the "x" in the ItfPar field content with an increasing number;
[0091] In the cross-information file, filter the records whose ItfType field content contains the interface category SA, traverse each filtered record, replace "x1" in the ItfPar field content with the System field content, and replace "x2" in the ItfPar field content with an increasing digital number.
[0092] In an exemplary embodiment, the association unit of the embodiment of the present disclosure is further configured as follows:
[0093] Preprocess the class model file and instance information file;
[0094] The preprocessing includes: checking for duplicates and / or processing special characters on the device name.
[0095] In an exemplary embodiment, the third generating unit of the embodiment of the present disclosure is further configured as follows:
[0096] When generating the XML file, filter the ItfType field content from the cross-information file to include records with interface category A;
[0097] The content of the filtered ItfType field contains the register address assigned to each array in the ItfPar field in the record with interface class A;
[0098] Export the data after address allocation to generate the human-machine interface HMI data point table.
[0099] The following briefly describes the embodiments of the present disclosure through application examples. The application examples are only used to illustrate the embodiments of the present disclosure and are not used to limit the protection scope of the present application.
[0100] Application Examples
[0101] Figure 3 A flowchart of an example of application of the present disclosure is shown in FIG. Figure 3 As shown, including:
[0102] Step 301: Generate a class model file and an instance information file;
[0103] Step 302: import the class model file and the instance information file into the database;
[0104] Step 303: Check and process the standardization and uniqueness of the device names in the imported class model file and instance information file;
[0105] Step 304: Create a cross information file through cross query based on the class model file and the instance information file;
[0106] Step 305: Perform association processing based on the interface category to obtain an association file containing basic information of the PLC program source file;
[0107] The disclosed embodiment performs association processing based on interface categories, including: filtering records whose ItfType field contents contain interface category E in the cross-information file, traversing each record, and replacing "xx" in the ItfPar field content with the EqName field content; filtering records whose ItfType field content contains interface category S in the cross-information file, traversing each record, and replacing "x" in the ItfPar field content with the System field content; filtering records whose ItfType field content contains interface category A in the cross-information file, traversing each record, and replacing "x" in the ItfPar field content with an increasing digital number; filtering records whose ItfType field content contains interface category SA in the cross-information file, traversing each record, replacing "x1" in the ItfPar field content with the System field content, and replacing "x2" in the ItfPar field content with an increasing digital number.
[0108] Step 306: Generate an XML file based on the obtained associated file containing basic information of the PLC program source file;
[0109] Step 307, exporting the data in the cross information file according to the format rule of the HMI communication point table to generate an HMI data point table;
[0110] The disclosed embodiment generates an HMI data point table, including: filtering records whose ItfType field contents contain interface category A from a cross information file; among the filtered records whose ItfType field contents contain interface category A, assigning register addresses to each array in the ItfPar field; and exporting the data after the address assignment is completed to generate a human-machine interface (HMI) data point table.
[0111] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A method for generating a programmable logic controller (PLC) program, characterized in that: include: Generate class model files based on the logic between the device interface file and the controlled object; Generate instance information file according to the list information of the controlled object; The generated class model file and instance information file are associated based on the interface category to obtain an associated file containing basic information of the PLC program source file; Generate an extensible markup language XML file according to the obtained associated file containing basic information of the PLC program source file; Among them, the XML file is the PLC program source file.
2. The generation method according to claim 1, characterized in that: The class model file includes one or any combination of the following information: class name, class description, parameter category, parameter name, data type, interface parameter and interface category; The interface categories include: system S, array A, device E, and system and array SA; the field of the interface parameter includes characters to be replaced: x, xx, x1, and x2.
3. The generation method according to claim 1, characterized in that: The instance information file includes one or any combination of the following information: system name, class name, device name and device description.
4. The generation method according to any one of claims 1 to 3, characterized in that: The generated class model file and instance information file are associated based on the interface category to obtain an associated file containing basic information of the PLC program source file, including: Import the class model file and instance information file into the database; Based on the class model file and the instance information file, a cross information file is created through cross query; In the cross-information file, filter the records containing E in the interface category field content, traverse each record, and replace "xx" in the interface parameter field content with the device name field content; In the cross-information file, filter the records whose interface category field content contains S, traverse each record, and replace the "x" in the interface parameter field content with the system name field content; In the cross-information file, filter the records whose interface category field content contains A, traverse each record, and replace the "x" in the interface parameter field content with an increasing number; In the cross-information file, filter the records whose interface category field content contains SA, traverse each record, replace "x1" in the interface parameter field content with the system name field content, and replace "x2" in the interface parameter field content with an increasing number.
5. The generation method according to any one of claims 1 to 3, characterized in that: Before the generated class model file and instance information file are associated based on the interface category to obtain an associated file containing basic information of the PLC program source file, the generation method further includes: Preprocess the class model file and instance information file; The preprocessing includes: checking for duplicates and / or processing special characters on the device name.
6. The generation method according to any one of claims 1 to 3, characterized in that: When generating the XML file, the method further includes: Filter the records whose interface category field content contains A from the cross-information file; The field content of the filtered interface category contains the record of A, and the register address is assigned to each array in the field of the interface parameter; Export the data after address allocation to generate the human-machine interface HMI data point table.
7. A computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the method for generating a PLC program according to any one of claims 1 to 6 is implemented.
8. A terminal, comprising: A memory and a processor, wherein the memory stores a computer program; wherein, The processor is configured to execute the computer program in the memory; When the computer program is executed by the processor, the method for generating a PLC program according to any one of claims 1 to 6 is implemented.
9. A PLC program generating device, comprising: A first generating unit, a second generating unit, an associating unit and a third generating unit; wherein, The first generating unit is configured to generate a class model file according to the logic between the device interface file and the controlled object; The second generating unit is configured to: generate an instance information file according to the inventory information of the controlled object; The association unit is set to: perform association processing on the generated class model file and instance information file based on the interface category to obtain an association file containing basic information of the PLC program source file; The third generating unit is configured to generate an extensible markup language XML file according to the obtained associated file containing basic information of the PLC program source file; Among them, the XML file is the PLC program source file.
10. The generating device according to claim 1, characterized in that The class model file includes one or any combination of the following information: class name, class description, parameter category, parameter name, data type, interface parameter and interface category; The interface categories include: system S, array A, device E, and system and array SA; the field of the interface parameter includes characters to be replaced: x, xx, x1, and x2.
