A compiling method and device of a programmable logic control system and an electronic device
By modularizing and managing programmable logic control systems, the problem of repetitive development caused by differences in bus configuration in wind power equipment manufacturing has been solved. This has enabled efficient modular adaptation and compilation of logic programs, reducing the workload of engineers and the cost of version management.
Patent Information
- Application Number
- CN202511340510.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-09-19
AI Technical Summary
In the manufacturing of wind power equipment, existing technologies require the repeated development of multiple sets of control logic due to differences in bus configurations. This increases the workload of engineers and the cost of version management, and makes it difficult to intuitively identify the impact of logic modifications on different bus configurations.
By determining the configuration settings, communication data format, and IO variable management information of the programmable logic control system, source files of the target version's program organization units are generated, and download files are generated based on these files, realizing component-based modeling and management of the logic program, reducing repeated compilation and version management.
It enables modular plug-in logic adaptation for different wind power equipment, reducing the burden on engineers and improving compilation efficiency and logic program management efficiency.
Smart Images

Figure CN120832151B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of PLC, in particular to a compiling method and device of a programmable logic control system and an electronic device. BACKGROUND
[0002] As a core control device in the field of industrial automation, the programmable logic controller (PLC) has become a basic technology for modern industrial production based on logic programming to achieve precise control of various field devices. In industrial field applications, PLC needs to configure various bus protocol devices such as PROFIBUS, CANopen or EtherCAT according to different process requirements and device types to build a complete automation control system. The current mainstream logic programming configuration software (such as TIAPortal, Codesys, etc.) usually adopts a development mode of creating independent control projects for each bus configuration when dealing with multi-bus configuration scenarios. Engineers need to manually adjust the corresponding program organization unit source files (POU) for each bus device configuration, including the re-adaptation of elements such as function blocks, functions and data types.
[0003] In typical application scenarios such as wind power equipment manufacturing, the same series of wind turbine products may need to develop multiple sets of control logic variants due to differences in field bus configuration (such as the use of CAN bus for the pitch system and PROFINET for the yaw system). Although these logics have high similarity in core control algorithms, existing technical solutions require creating independent project files for each wind turbine model with specific bus configurations, resulting in engineers having to repeat work such as logic program transplantation, interface adaptation and function verification. Especially when dealing with cross-modification involving multi-bus configuration, developers have difficulty in intuitively identifying which bus configuration will be affected by a certain logic modification. They can only check the associated relationships in each independent project one by one to confirm the scope of influence. This discrete development mode significantly increases the complexity of engineering maintenance and version management costs. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a compiling method, device and electronic device of a programmable logic control system to solve the problem of repeated compilation of programmable logic control systems for different models of wind power equipment.
[0005] In a first aspect, the present application provides a compiling method of a programmable logic control system, the method comprising: determining configuration setting information, communication data content format information and IO variable logic variable management information of a target programmable logic control system; determining program organization unit source files supporting the target programmable logic control system and forming corresponding target version program organization unit source files; and generating a download file of the target programmable logic control system based on all target version program organization unit source files to control the target programmable logic control system to run.
[0006] In an optional embodiment, the configuration setting information comprises program organization unit enabling sets, and all program organization unit source files with enabling tags are determined.
[0007] For each program organization unit source file with an enabling tag, it is determined whether the program organization unit source file is in the corresponding program organization unit enabling set; if yes, the program organization unit source file is determined to be a program organization unit source file supporting the target programmable logic control system, and the program organization unit source files supporting the target programmable logic control system further comprise all program organization unit source files without enabling tags.
[0008] In an optional embodiment, the step of forming corresponding target version program organization unit source files specifically comprises:
[0009] For each program organization unit source file with an enabling tag, it is determined whether the program organization unit source file needs to be modified.
[0010] If no, a current version number of the program organization unit source file is determined to form the corresponding target version program organization unit source file.
[0011] If yes, the version number of the program organization unit source file is updated to form the corresponding target version program organization unit source file.
[0012] In an optional embodiment, the step of generating the download file of the target programmable logic control system based on all target version program organization unit source files specifically comprises:
[0013] It is determined whether the version number of a program organization unit source file is updated.
[0014] If yes, the version number of the download file is updated, and the download file of the target programmable logic control system is regenerated.
[0015] If no, the historically generated download file is taken as the download file of the target programmable logic control system.
[0016] In an optional embodiment, before the step of controlling the target programmable logic control system to run based on the downloaded file, the method further comprises:
[0017] obtaining a version number of the downloaded file currently running in the target programmable logic control system;
[0018] determining whether the version number of the downloaded file currently running is consistent with a version number of a standard downloaded file;
[0019] if the version numbers are consistent, controlling the target programmable logic control system to run based on the downloaded file.
[0020] In an optional embodiment, the version number of the standard downloaded file corresponding to the target programmable logic control system is determined by:
[0021] based on the version numbers of the program organization unit source files, the configuration setting information, the communication data content format information, and the version numbers of the IO variable logical variable management information, determining the version number of the standard downloaded file according to a preset rule.
[0022] In an optional embodiment, the step of controlling the target programmable logic control system to run based on the downloaded file comprises:
[0023] uninstalling the configuration setting information corresponding to the previous programmable logic control system;
[0024] loading the program organization unit source files supporting the target programmable logic control system to generate the downloaded file of the target programmable logic control system;
[0025] sending the downloaded file of the target programmable logic control system to the programmable logic controller of the target programmable logic control system to control the target programmable logic control system to run.
[0026] In a second aspect, the present application provides a compiling device of a programmable logic control system, which comprises:
[0027] a parsing module configured to determine, for a target programmable logic control system, configuration setting information, communication data content format information, and IO variable logical variable management information of the target programmable logic control system;
[0028] a matching module configured to determine program organization unit source files supporting the target programmable logic control system and form program organization unit source files of a target version corresponding thereto;
[0029] a generating module configured to generate a downloaded file of the target programmable logic control system based on all the program organization unit source files of the target version to control the target programmable logic control system to run.
[0030] In a third aspect, the present application provides an electronic device, comprising a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, the processor executes the machine readable instructions to perform the steps of the compiling method of the programmable logic control system according to any one of the preceding embodiments.
[0031] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is run by a processor, the steps of the compiling method of the programmable logic control system according to any one of the preceding embodiments are performed.
[0032] The present application provides a programmable logic control system compiling method, device and electronic device, wherein the method comprises determining configuration setting information, communication data content format information and IO variable logic variable management information of a target programmable logic control system; determining program organization unit source files supporting the target programmable logic control system, and forming corresponding program organization unit source files of target versions; and generating a download file of the target programmable logic control system based on all program organization unit source files of target versions, to control the target programmable logic control system to run. By using logic variable and IO variable mapping, decoupling of programming development and configuration is realized, component modeling and management method of a logic program set is established, componentized plug-in type logic adaptation and differential logic incremental content compilation for different wind power equipment configuration scenarios are realized, manual burden is reduced, and compiling efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0034] Figure 1 The flowchart of the programmable control system incremental compiling and multi-target adaptation method based on variable mapping and component assembly provided by the embodiments of the present application;
[0035] Figure 2 The flowchart of the programmable logic control system compiling method provided by the embodiments of the present application;
[0036] Figure 3a The first configuration switching information mapping relationship schematic diagram provided by the embodiments of the present application;
[0037] Figure 3bA second configuration switching information mapping relationship schematic diagram provided by the embodiment of the application;
[0038] Figure 3c A third configuration switching information mapping relationship schematic diagram provided by the embodiment of the application;
[0039] Figure 4 A specific support association step flowchart of a POU provided by the embodiment of the application;
[0040] Figure 5 A specific support association cancellation step flowchart of a POU provided by the embodiment of the application;
[0041] Figure 6 A configuration configuration switching logic schematic diagram provided by the embodiment of the application;
[0042] Figure 7 A version calculation relationship schematic diagram provided by the embodiment of the application;
[0043] Figure 8 A programmable logic control system compilation principle schematic diagram provided by the embodiment of the application;
[0044] Figure 9 A structure schematic diagram of an electronic device provided by the embodiment of the application. DETAILED DESCRIPTION
[0045] The application can be applied to the development of a programmable control system.
[0046] The technical solutions in the embodiments of the application will be described below with reference to the drawings in the embodiments of the application.
[0047] Embodiment one
[0048] As shown in the embodiment of the application, a programmable control system incremental compilation and multi-target adaptation method based on variable mapping and component assembly is provided, and the specific steps include: Figure 1 S1: Establishing an IO variable in a PLC memory for target configuration communication data, and adding a mapping relationship between the IO variable and a logic variable in a bus configuration object.
[0049] In step S1, the device configuration information of a target control system can be analyzed, and two types are identified, type A is a parameter set by a device for a target system working mode, and type B is a format of communication data content in a bus under the setting of type A information.
[0050]
[0051] After the classification, the required A and B information can be generated for the data structure defined in the method in the device configuration, while the maintenance function of A and B device information is realized. In this application, the B information includes the communication IO variable generated by mapping the communication data of the device in the bus in the PLC memory space.
[0052] S2: The mapping relationship in S1 is identified in the logical compilation, the same address binding of the logical variable and the IO variable is completed, and the control of the same logic to different target device configurations is completed through switching the target configuration.
[0053] S3: The marking of whether the POU only supports a specific range of target device configurations is realized, and the identification and maintenance of the marking are realized.
[0054] S4: For the target device configuration object, the logical component Ф containing the POU identification P of each target device configuration object in the project is formed, and the method of independently saving and loading different target objects and Ф is realized.
[0055] The POU in Ф has only a part of the target object marking and supports the target device to which Ф belongs. The target device configuration object and its logical component Ф realize independent saving and loading from other objects.
[0056] The content of each device configuration object includes the IO variable generated by mapping in the PLC memory, and the mapping relationship between the logical variable and the IO variable, and the same address binding compilation of the logical variable and the IO variable with the mapping relationship is realized. Each POU has an independent identification P, and has a marking of whether it only supports a part of the target device configuration object.
[0057] In step S4, the logical component of the target device object can be maintained in the following way:
[0058] For the POU without marking, all target device objects are supported, and it cannot be used as the logical component content of any target object. For the POU with marking, only the target object that is included in its own logical component is supported.
[0059] S5: In the project, the target device configuration object currently being edited is switched, the logical component is automatically matched, the assembly of the programmable control system development content is completed, and the logical component is incrementally compiled to generate the PLC download information.
[0060] The target device configuration object currently being edited can be switched. After being switched to a new editable target device object, the logical adaptation is automatically performed according to the logical component set, and the assembly of the programmable control system development content is completed. Step S5 specifically includes realizing the unloading of the current target object and its Ф information from the current editable content.
[0061] Load the target object editable information and Ф information by the loading method in step S4, according to the Ф information, load the POU supporting the target object according to the defined rules of the sub-steps of step S4, and implement the processing including but not limited to closing, marking not to compile and the like for the POU not supporting the target object.
[0062] Further, after the switching is completed, the binding of the logical variables and the IO variables in S1 is completed, and the control of the communication data by the logic is automatically implemented.
[0063] S6: Realize the independent version identification and maintenance function for each POU and each target device.
[0064] When the PLC running control information is constructed, realize the calculation method of generating the unique version information of the running control information by using each POU version and target device object version in the aforementioned assembling content.
[0065] Specifically, in step S6, the version maintenance can be realized by the following way:
[0066] The POU only supports the modification of the specific target object mark and does not upgrade the POU version, and only the logic of the POU is modified to upgrade the version. The Ф modification of the target object does not upgrade the version of the target object, and only the device configuration content of the target object is changed to upgrade the version.
[0067] S7: When the PLC running control information is constructed by compiling the assembling content described in S5, realize the calculation method of generating the unique version information of the running control information by using each POU version and target device version in the aforementioned assembling content.
[0068] Each time the compilation and construction of all target device configuration objects and each object matched POU in the project are completed, the independent PLC running control information is generated for each target.
[0069] S8: Realize the software method of saving and identifying the running control information described in S7 according to the different corresponding target objects.
[0070] S9: Further, realize the batch compilation and construction of the target device object and its logic components, and batch generate multiple target PLC running control information.
[0071] For the current edited target device and the POU supporting it, execute the construction, record whether the compilation and construction are successful, sequentially switch all target devices and the POU supporting the corresponding target device to execute the construction, until the compilation and construction of all target devices are completed, and switch back to the starting target device of the construction.
[0072] S10: when implementing the software method login PLC, the method in S7 is used to do online version matching.
[0073] The application provides a programmable control system incremental compilation and multi-target adaptation method based on variable mapping and component assembly, relates to the technical field of PLC, and is used for development of a programmable control system. Mapping of logical variables and IO variables is used to realize decoupling of programming development and configuration. A component-based modeling and management method of a logical program set is established to realize component-based plug-in adaptation logic development for different target device configuration scenarios. Differentiated logical incremental content editing and compilation are completed for different target scenarios. In engineering, component-based management, plug-in automatic adaptation, and batch incremental compilation and construction of logical components for multiple target objects can be performed. The engineering complexity is reduced, and the version management cost is lowered.
[0074] Embodiment two
[0075] As shown in Figures 2-8 In one embodiment of the application, a programmable logic control system compilation method is provided, comprising:
[0076] S100, for a target programmable logic control system, configuration setting information, communication data content format information, and IO variable logical variable management information of the target programmable logic control system are determined.
[0077] In one embodiment, the programmable logic control system compilation method can be implemented by a logic programming configuration software SC-ProSys. For a target fan control system, configuration information required by field bus devices is analyzed and identified into two categories. Category A is parameters set by devices for target system operation modes, and category B is the format of communication data content in the bus under the setting of category A information. After completion of identification of device description information carriers, the required A and B information is generated for each type of device in the target system configuration according to the data structure defined by the method, and maintenance of the A and B configuration information is completed. The B information includes communication IO variables generated by mapping of communication data of devices in the bus in the PLC memory space.
[0078] For example, for an EtherCAT bus device, A-class data can be generated based on the Object in the ESI file, B-class data can be generated based on the PDO configuration, A-class data can be generated based on the Prm_Data in the GSD file, and B-class data can be generated based on the Cfg_Data. By constructing an xml text file parsing tool, a data model of an EtherCAT bus slave station is established, including slave station identification information, initialization parameter information, SDO configuration information, PDO configuration information, a lexical syntax analysis program is developed, a GSD file is parsed, configuration parameters of a ProfiBUS-DP slave station are generated, modular IO information is extracted, configuration parameters of modular IO are generated, and configuration parameters are generated.
[0079] The communication data herein is communication data for interaction between a host PLC running a control logic program and each device on the bus. The source program required for compiling the configuration of the target system is configured in the logic programming configuration software. The source program designs two ways of controlling the communication data of the bus device:
[0080] In one case, the communication data of the bus can be directly referenced by the logic variable. In another case, a method of associating a logic variable with an IO variable is defined: a data structure is defined for the association relationship between the logic variable and the IO variable, a bidirectional query key-value pair is established for the variable names of one logic variable and one IO variable, and the association relationship between the logic variable and the IO variable is maintained.
[0081] The engineer can choose between the two ways when programming. If the first way is adopted, the IO variable is directly referenced in the logic code, and the user code directly controls the bus communication data by accessing the IO variable. However, if the device configuration in the development project is changed, the logic code will not be able to be compiled. If the second way is adopted, the engineer can establish the address binding relationship defined in the method between the logic variable in the logic code and the IO variable, and accessing the logic variable in the user logic code is equivalent to accessing the IO variable. Therefore, when the configuration is changed, the logic variable access in the logic code is not affected, and the logic program can be compiled.
[0082] When the logic and the configuration are built, the logic variable can be compiled using the address of the associated IO variable, thereby realizing the program control of the bus communication data. The association relationship serves as the C-class configuration information of the device in this embodiment.
[0083] Uniform identification information T and revision version TV are established for a specific target system configuration information set containing A, B, and C class information. A, B, and C play a role in the logic programming configuration as shown in FIG. 3, and the information of each set of configuration realizes the function of independent saving and identification.
[0084] The association between the logical variables and the IO variables is maintained in the software, and the C-class configuration information is maintained. When the bus configuration is switched, the association between the variables is changed, the source code program is compiled using the new IO variable address bound to the logical variable, a new target program is generated, the control of the new configuration is met, and the logical code does not need to be modified.
[0085] S200, determine the program organization unit source file supporting the target programmable logic control system, and form the corresponding target version of the program organization unit source file.
[0086] The step of determining the program organization unit source file supporting the target programmable logic control system specifically includes:
[0087] All program organization unit source files with the enable flag are determined.
[0088] For each program organization unit source file with the enable flag, it is determined whether the program organization unit source file is in the corresponding program organization unit enable set.
[0089] If yes, it is determined that the program organization unit source file is the program organization unit source file supporting the target programmable logic control system, and the program organization unit source file supporting the target programmable logic control system also includes all program organization unit source files without the enable flag.
[0090] The step of forming the corresponding target version of the program organization unit source file specifically includes, for each program organization unit source file with the enable flag, determining whether the program organization unit source file needs to be modified. If no modification is needed, the current version number of the program organization unit source file is determined to form the corresponding target version of the program organization unit source file. If modification is needed, the version number of the program organization unit source file is updated to form the corresponding target version of the program organization unit source file.
[0091] The function of setting the ET enable for the POU can be implemented in the software. The configuration configuration maintains the identification function of the POU supporting it, and the POU identification P with the ET enable is added or deleted for the selected configuration configuration.
[0092] When the configuration switching is completed, the POU supported by the current configuration is identified, the POU not supported is compiled and disabled, and the POU supported is compiled and enabled. The functions of the logical programming configuration software are used to complete the current editing configuration and the compilation construction of the supported POU.
[0093] S300, based on all target version program organization unit source files, generate the download file of the target programmable logic control system to control the operation of the target programmable logic control system.
[0094] The step of generating the download file of the target programmable logic control system based on the program organization unit source files of all target versions comprises the following steps:
[0095] It is determined whether the version number of the program organization unit source file is updated. If yes, the version number of the download file is updated, and the download file of the target programmable logic control system is regenerated. If no, the historically generated download file is taken as the download file of the target programmable logic control system.
[0096] Before the step of controlling the target programmable logic control system to run based on the download file, the following steps are further included: obtaining the version number of the download file currently running in the target programmable logic control system; determining whether the version number of the currently running download file is consistent with the version number of the standard download file; and if yes, controlling the target programmable logic control system to run based on the download file.
[0097] Specifically, the version number of the standard download file corresponding to the target programmable logic control system can be determined in the following manner:
[0098] Based on the version numbers of the plurality of program organization unit source files, the configuration setting information, the communication data content format information, and the version number of the IO variable logic variable management information, the version number of the standard download file is determined according to a preset rule.
[0099] Further, the step of controlling the target programmable logic control system to run based on the download file comprises the following steps:
[0100] The configuration setting information corresponding to the previous programmable logic control system is unloaded; the program organization unit source file supporting the target programmable logic control system is loaded to generate the download file of the target programmable logic control system; and the download file of the target programmable logic control system is sent to the programmable logic controller of the target programmable logic control system to control the target programmable logic control system to run.
[0101] In the software, each POU is implemented by separate text-based saving, the version number of the current file is defined in the file, and the text-based management of each configuration is implemented, and the maintenance version number is defined for the text-based file saved for each set of configuration in the corresponding file. When the logic code is modified and saved, the version number of the POU is upgraded, and when the A, B, and C type information in the configuration is modified and saved, the version number is upgraded.
[0102] The user of the control system can write specific codes for a specific target configuration T in the POU in the Φ set to realize the fusion development of the universal codes and the specific codes for all T.
[0103] The configuration and the source file are combined to compile and build, to generate the download file required by the PLC for the configuration T, and the building process is as follows:
[0104] Save all modified POU files and configurations, and upgrade the version of the changed content. If the version PV of the configuration of the POU is changed compared with the last compilation and build for T, and the build is successful, the generated download file needs to be upgraded, and the version RV at this time is recorded. If the compilation and build are not successful, return to the editing state. The generated download file R is saved independently of the R generated by other configurations of the configuration T, and is replaced if there is a last generated download file.
[0105] In the logic programming configuration software, perform batch build for all different scene configurations within the current project, and the build process is as follows:
[0106] Perform the build step for the current edited configuration T and the supported POU, and record whether the compilation and build are successful. Switch to the next scene configuration, perform the build step, and switch back to the starting scene configuration until the compilation of all scene configurations is completed.
[0107] After switching to the T configuration selected, log in to the PLC supported by the embodiment, obtain the RV of the current running R in the PLC, calculate the RVtmp of the TV and all PVs supported by T in the current state, and if the RV is equal to the RVtmp, start the PLC online monitoring operation, otherwise, the version needs to be saved, the new R needs to be generated and downloaded.
[0108] The application provides a compilation method of a programmable logic control system, which realizes decoupling of programming development and configuration by using mapping of logic variables and IO variables, establishes a component modeling and management method of a logic program set, realizes componentized splicing type logic adaptation and differential logic incremental content compilation for different wind turbine configuration scenes, reduces the manual burden, and improves the compilation efficiency.
[0109] Embodiment three
[0110] In one specific embodiment, an engineer can specify the target wind turbine device to be switched through the user interface of the compilation software. In the existing programmable control system development project, the existing bus configuration content is removed from the current edited content, and device configuration is performed again. Or the configuration is modified in the current edited device configuration, and a new wind turbine system device configuration is generated. New IO variables are generated.
[0111] For the new device configuration, the mapping relationship between the IO variables and the logic variables is established, the logic component range of the new target configuration object is modified, and the logic program in the component is modified. If the new target configuration object and other target configuration objects share some POU, the code in the POU needs to be modified to adapt to the new wind turbine.
[0112] The new target configuration is saved as a new fan target configuration object, and a new version is established for the logical program POU in the logical component range of the new fan. A build project is constructed, the POU in the target object logical component range is compiled to generate a PLC running program, and a bus running configuration file is generated for the bus configuration parameters of the target object. The runtime software in the PLC receives the above-mentioned file, and initializes and runs the program according to the configuration and program code in the file.
[0113] In the build project, as long as the target object supporting its own logical POU is modified, a new download file is generated optionally involving different target objects.
[0114] Embodiment Four
[0115] Based on the same inventive concept, the embodiment of the present application further provides a compiling device of a programmable logic control system, which comprises:
[0116] The parsing module is configured to determine configuration setting information, communication data content format information, and IO variable logic variable management information of the target programmable logic control system.
[0117] The matching module is configured to determine program organization unit source files supporting the target programmable logic control system, and form program organization unit source files of corresponding target versions.
[0118] The generating module is configured to generate a download file of the target programmable logic control system based on all program organization unit source files of the target versions, so as to control the target programmable logic control system to run.
[0119] Please refer to Figure 9 , Figure 9 A structural schematic diagram of an electronic device provided by the embodiment of the present application. As shown in Figure 9 The electronic device 600 comprises a processor 610, a memory 620, and a bus 630.
[0120] The memory 620 stores machine readable instructions executable by the processor 610. When the electronic device 600 is running, the processor 610 communicates with the memory 620 through the bus 630. The machine readable instructions are executed by the processor 610, and can execute the steps of the compiling method of the programmable logic control system as described above. The specific implementation manner can be referred to the method embodiment, and will not be described here.
[0121] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is run by a processor and can perform the steps of the compiling method of the programmable logic control system according to one of the above method embodiments. The specific implementation manners can be referred to the method embodiments, and will not be described here.
[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be described here.
[0123] In the embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented by other manners. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, and can be electrical, mechanical or other forms.
[0124] In addition, the units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the present embodiment.
[0125] Furthermore, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0126] It should be noted that, if the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product in essence or in the form of a part or the technical solutions of the present application that make contributions to the prior art. The computer software product is stored in a storage medium, includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0127] In this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
[0128] The above only describes the embodiments of the present application and is not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method of compiling a programmable logic control system, characterized by, The method comprises: For a target programmable logic control system, configuration setting information, communication data content format information and IO variable logic variable management information of the target programmable logic control system are determined, and the target programmable logic control system is used for fan control; Program organization unit source files supporting the target programmable logic control system are determined, and corresponding target version program organization unit source files are formed, wherein when the configuration switching is completed, POUs supported by the current configuration are identified, the POU that is not supported is subjected to compilation disabling processing, and the POU that is supported is subjected to compilation enabling processing; the configuration setting information comprises a program organization unit enabling set, and all program organization unit source files with an enabling mark are determined; for each program organization unit source file with the enabling mark, it is determined whether the program organization unit source file is in the corresponding program organization unit enabling set; if yes, the program organization unit source file is determined as the program organization unit source file supporting the target programmable logic control system, and the program organization unit source file supporting the target programmable logic control system further comprises all program organization unit source files without the enabling mark; Based on all target version program organization unit source files, a download file of the target programmable logic control system is generated; Based on version numbers of the plurality of program organization unit source files and version numbers of the configuration setting information, the communication data content format information and the IO variable logic variable management information, a version number of a standard download file is determined according to a preset rule, it is determined whether the version number of the currently running download file is consistent with the version number of the standard download file, and if yes, the target programmable logic control system is controlled to run based on the download file; In the logic programming configuration software, batch building is performed on all different scene configurations within the current project, and the building process is as follows: For the current edited configuration T and the POU supported thereby, a building step is performed, it is recorded whether the building is successfully compiled, the next scene configuration is switched, the building step is performed, until the compilation of all scene configurations is completed, and the starting scene configuration is switched back.
2. The method of claim 1, wherein, The step of forming the corresponding target version program organization unit source file specifically comprises: For each program organization unit source file with the enabling mark, it is determined whether the program organization unit source file needs to be modified; If no modification is needed, a current version number of the program organization unit source file is determined to form the corresponding target version program organization unit source file; If modification is needed, the version number of the program organization unit source file is updated to form the corresponding target version program organization unit source file.
3. The method of claim 2, wherein, The step of generating the download file of the target programmable logic control system based on all target version program organization unit source files specifically comprises: It is determined whether the version number of the program organization unit source file is updated; If yes, the version number of the download file is updated, and the download file of the target programmable logic control system is regenerated; If no, the historically generated download file is used as the download file of the target programmable logic control system.
4. The method of claim 1, wherein, The step of controlling the target programmable logic control system to run based on the download file comprises: uninstalling the configuration setting information corresponding to the previous programmable logic control system; loading the program organization unit source file supporting the target programmable logic control system to generate the download file of the target programmable logic control system; sending the download file of the target programmable logic control system to the programmable logic controller of the target programmable logic control system to control the target programmable logic control system to run.
5. A compiling apparatus of a programmable logic control system, characterized by comprising: The apparatus is suitable for the compiling method of any one of claims 1-4, and the apparatus comprises: a parsing module configured to determine the configuration setting information, the communication data content format information and the IO variable logic variable management information of the target programmable logic control system; a matching module configured to determine the program organization unit source file supporting the target programmable logic control system and form the corresponding target version program organization unit source file; a generating module configured to generate the download file of the target programmable logic control system based on all the target version program organization unit source files to control the target programmable logic control system to run.
6. An electronic device, comprising: The apparatus comprises: a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, the processor executes the machine readable instructions to perform the steps of the compiling method of the programmable logic control system of any one of claims 1-4.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores a computer program, when the computer program is run by the processor, the steps of the compiling method of the programmable logic control system of any one of claims 1-4 are executed.
Citation Information
Patent Citations
PLC software incremental compiling method and device
CN117806651A