Compiling method and device of programmable logic control system and electronic equipment
By generating the target version of the program organization unit source file and download file, the problem of repeated compilation of programmable logic control systems under multi-bus configuration is solved, the componentized modeling and management of logic programs is realized, the engineering complexity and version management costs are reduced, and the compilation efficiency is improved.
Patent Information
- Application Number
- CN202511340510.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-09-19
AI Technical Summary
When dealing with programmable logic control systems with multiple bus configurations, existing technologies require creating independent engineering files for each wind turbine model. This causes engineers to repeatedly perform logic program transplantation, interface adaptation, and function verification, increasing the complexity of engineering maintenance and version management costs.
By determining the configuration setting information, communication data content format information and IO variable logical variable management information of the target programmable logic control system, the program organization unit source file of the target version is generated, and the download file is generated based on these files to realize the componentized modeling and management of the logic program and reduce repeated compilation work.
It decouples programming development from configuration, reduces engineering complexity and version management costs, improves compilation efficiency, and adapts to component-based plug-in logic adaptation for different wind power equipment configuration scenarios.
Smart Images

Figure CN120832151A_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. 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.
[0007] In an optional embodiment, the step of forming corresponding target version program organization unit source files specifically comprises: 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. 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, a version number of the program organization unit source file is updated to form the corresponding target version program organization unit source file.
[0008] In an optional embodiment, the step of generating a 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 a version number of a program organization unit source file is updated. If yes, a version number of the download file is updated, and the download file of the target programmable logic control system is regenerated. If no, a historically generated download file is taken as the download file of the target programmable logic control system.
[0009] In an optional embodiment, before the step of controlling the target programmable logic control system to run based on the download file, the method further comprises: A version number of a currently running download file of the target programmable logic control system is obtained. determine whether the version number of the currently running download file is consistent with the version number of the standard download file; If consistent, control the target programmable logic control system to run based on the download file.
[0010] In an optional embodiment, the version number of the standard download file corresponding to the target programmable logic control system is determined by: Based on the version numbers of the program organization unit source files, the configuration setting information, the communication data content format information, and the IO variable logic variable management information, the version number of the standard download file is determined according to a preset rule.
[0011] In an optional embodiment, the step of controlling the target programmable logic control system to run based on the download file specifically includes: unload the configuration setting information corresponding to the previous programmable logic control system; load the program organization unit source files supporting the target programmable logic control system to generate the download file of the target programmable logic control system; send 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.
[0012] In a second aspect, the present application provides a compiling device of a programmable logic control system, which comprises: a parsing module configured to determine, 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; 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 corresponding target versions; a generating module 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 to control the target programmable logic control system to run.
[0013] In a third aspect, the present application provides an electronic device, which 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 communicates with the memory 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 of the preceding embodiments.
[0014] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the compiling method of the programmable logic control system according to any of the preceding embodiments are performed.
[0015] The application provides a compiling method, device and electronic equipment of a programmable logic control system, wherein the method comprises the following steps: 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 program organization unit source files of corresponding target versions; and generating 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. By using the mapping of logic variables and IO variables, the decoupling of programming development and configuration is realized, the component modeling and management method of a logic program set is established, the componentized plug-in type logic adaptation and differential logic incremental content compilation for different wind power equipment configuration scenes are realized, the artificial burden is reduced, and the compiling efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0016] 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. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0017] Figure 1 The flowchart of the programmable control system incremental compilation and multi-target adaptation method based on variable mapping and component assembly provided by the embodiments of the present application is shown in the figure. Figure 2 The flowchart of the compiling method of the programmable logic control system provided by the embodiments of the present application is shown in the figure. Figure 3a The information mapping relationship schematic diagram in the first configuration switching provided by the embodiments of the present application is shown in the figure. Figure 3b The information mapping relationship schematic diagram in the second configuration switching provided by the embodiments of the present application is shown in the figure. Figure 3c The information mapping relationship schematic diagram in the third configuration switching provided by the embodiments of the present application is shown in the figure. Figure 4 The specific support association step flowchart of a POU provided by the embodiments of the present application is shown in the figure. Figure 5 The specific support association step flowchart of a POU provided by the embodiments of the present application is shown in the figure. Figure 6 The configuration configuration switching logic schematic diagram provided by the embodiments of the present application is shown in the figure. Figure 7A schematic diagram of a version calculation relationship provided in an embodiment of the present application; Figure 8 A schematic diagram of the compilation principle of a programmable logic control system provided in an embodiment of the present application; Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] This application can be applied to the development of programmable control systems.
[0019] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0020] Example 1 like Figure 1 As shown, in one embodiment of the present application, a method for incremental compilation and multi-target adaptation of a programmable control system based on variable mapping and component assembly is provided, and the specific steps include: S1: Create IO variables in the PLC memory for the target configuration communication data, and add the mapping relationship between IO variables and logical variables to the bus configuration object.
[0021] In step S1, the device configuration information of the target control system can be analyzed and identified into two categories: Category A is the parameters set by the device for the target system working mode, and Category B is the format of the data content communicated by the device in the bus under the Category A information setting.
[0022] After classification is completed, the required Class A and Class B information can be generated for the data structure defined in this method in the device configuration, and the maintenance function of Class A and Class B device information can be implemented. In this application, the B information includes the communication IO variables generated by the device communication data in the bus according to the mapping in the PLC memory space.
[0023] S2: Identify the mapping relationship in S1 during logic compilation, complete the same-address binding of logic variables and IO variables, and complete the control of different target device configurations with the same logic by switching the target configuration.
[0024] S3: Implement a tag to determine whether the POU only supports a specific range of target device configurations, and implement identification and maintenance of the tag.
[0025] S4: Configure objects for the target device, by maintaining a POU identification information set Φ that is marked in S3 and supports its own characteristics, forming a logical component that adapts to itself and implementing a method for independently saving and loading different target objects and their Φ.
[0026] Each target device configuration object in the project contains a set of logical components of POU identified by P. The POU in Ф supports only part of the target object mark and supports the target device to which Ф belongs. The target device configuration object and its logical components Ф realize the saving and loading independently from other objects.
[0027] The content of each device configuration object contains the mapping of the generated IO variables in the PLC memory and the mapping relationship between the logical variables and the IO variables, and realizes the same address binding and compilation of the logical variables and the IO variables with the mapping relationship. Each POU has an independent identifier P and a mark indicating whether it only supports part of the target device configuration object.
[0028] In step S4, the logical component machine of the target device object can be maintained in the following way: For the POU without the mark, all target device objects are supported, and it cannot be used as the logical component content of any target object. For the POU with the mark, only the target object that is included in its own logical component is supported.
[0029] S5: Switch the currently edited target device configuration object in the project, automatically match its logical components, complete the assembly of the development content of the programmable control system, and perform incremental compilation on the logical components to generate PLC download information.
[0030] The currently edited target device configuration object can be switched. After switching to a new editable target device object, the logical adaptation is automatically performed according to the logical component set, and the assembly of the development content of the programmable control system is completed. Step S5 specifically includes implementing the unloading of the current target object and its Ф information from the current editable content.
[0031] The editable information and the Ф information of the target object are loaded using the loading method in step S4. According to the Ф information, the POU supporting the target object is loaded according to the rules defined in the sub-steps of step S4, and the POU not supporting the target object is processed, including but not limited to being closed, marked, and not compiled.
[0032] 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.
[0033] S6: Realize independent version identification and maintenance function for each POU and each target device.
[0034] When generating the PLC running control information, a calculation method for generating unique version information of the running control information using each POU version and target device object version in the aforementioned assembly content is implemented.
[0035] Specifically, in step S6, the version maintenance can be implemented in the following way: A POU only supports modifications to specific target object tags. The POU version is not upgraded. A POU version is upgraded only when the POU logic is modified. Modifying the target object's φ does not upgrade the target object version. The version is upgraded only when the target object's device configuration changes.
[0036] S7: When compiling and building the assembly content described in S5 to generate PLC operation control information, a calculation method for generating unique version information of the operation control information using each POU version and target device version in the assembly content described in S6.
[0037] Each time all target device configuration objects in the project and the POUs matching each object are compiled and built, independent PLC operation control information is generated for each target.
[0038] S8: The operation control information described in S7 is implemented by a software method for independently saving and identifying the corresponding target objects.
[0039] S9: Further, batch compilation and construction of target device objects and their logical components are realized, and multiple target PLC operation control information is generated in batches.
[0040] Build the currently edited target device and the POU that supports it, and record whether the compilation and build are successful; sequentially switch all target devices and POUs that support the corresponding target devices to execute the build until the compilation and build of all target devices are completed, and then switch back to the build starting target device.
[0041] S10: Implement the software method to log in to the PLC and use the S7 method to do online version matching.
[0042] The present application provides a method for incremental compilation and multi-target adaptation of a programmable control system based on variable mapping and component assembly, which relates to the field of PLC technology and is used for the development of programmable control systems. By using logical variables and IO variable mapping, the decoupling of programming development and configuration configuration is achieved. A componentized modeling and management method for a set of logical programs is established to achieve componentized plug-in adaptation logic development for different target device configuration scenarios. Differentiated logic incremental content editing and compilation for different target scenarios are completed. In the project, componentized management, plug-in automatic adaptation, and batch incremental compilation and construction of logic components for multiple target objects can be performed for the control logic of multiple different target device configuration objects. This reduces the complexity of the project and reduces the cost of version management.
[0043] Example 2 like Figures 2-8 As shown, in one embodiment of the present application, a compiling method for a programmable logic control system is provided, comprising: S100 : For a target programmable logic control system, determine configuration setting information, communication data content format information, and IO variable and logic variable management information of the target programmable logic control system.
[0044] In one embodiment, the compilation method for a programmable logic control system can be implemented using the logic programming configuration software SC-ProSys. For the target wind turbine control system, the configuration information required by the fieldbus devices is analyzed and identified into two categories: Category A, which is the parameters set for the device according to the target system's operating mode, and Category B, which is the format of the data content communicated by the device on the bus under the Category A information settings. After the device description information carrier is identified, the required Category A and Category B information are generated for each type of device in the target system configuration according to the data structure defined by this method, and the Category A and Category B configuration information are maintained. The Category B information includes the communication IO variables generated by mapping the device's communication data on the bus into the PLC memory space.
[0045] For example, for EtherCAT bus devices, Class A data can be generated based on the Object in the ESI file, and the corresponding Class B data can be generated based on the PDO configuration. Class A data can be generated for the Prm_Data in the GSD file, and Class B data can be generated for the configuration data Cfg_Data. By building an XML text file parsing tool, a data model for the EtherCAT bus slave station is established, including slave station identification information, initialization parameter information, SDO configuration information, and PDO configuration information. A lexical analysis program is developed to parse the GSD file, generate the configuration parameters of the ProfiBUS-DP slave station, extract modular IO information, and generate modular IO configuration parameters and configuration parameters.
[0046] The communication data here refers to the communication data between the master controller PLC running the control logic program and each device on the bus. The logic programming configuration software is configured with the source program required to compile and control the target system configuration. The source program is designed with two ways to control the communication data of bus devices: In one case, the communication data of the control bus can be directly referenced by the logical variable. In another case, a method for associating logical variables with IO variables can be defined: a data structure is defined for the association relationship between the logical variable and the IO variable, a key-value pair for bidirectional query is established for the variable name of a logical variable and an IO variable, and the association relationship between the logical variable and the IO variable is maintained.
[0047] The engineer can choose 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 cannot be compiled. If the second way is adopted, the engineer can bind the logic variable in the logic code with the IO variable by the address defined in the method, and the access to the logic variable in the user logic code is equivalent to the access to the IO variable. Therefore, when the configuration is changed, the access to the logic variable in the logic code is not affected, and the logic program can be compiled. When the logic and the configuration are built, the logic variable can be compiled by using the address of the associated IO variable, so as to realize the program control of the bus communication data. The association relationship is the C-type configuration information of the device in the embodiment.
[0048] The identification information T with a unified format is established for the target system configuration information set containing the A, B and C type information, and the revision version TV. The A, B and C play a role in the logic programming configuration as shown in FIG. 3. The information of each set of configuration realizes the function of independent saving and identification.
[0049] The association relationship between the logic variable and the IO variable is maintained in the software, and the C-type configuration information is maintained. When the bus configuration is switched, the association relationship of the variable is changed, the source code program uses the new IO variable address bound by the logic variable, a new target program is generated, the control of the new configuration is met, and the logic code does not need to be modified.
[0050] S200, determine the program organization unit source file supporting the target programmable logic control system, and form the corresponding program organization unit source file of the target version.
[0051] The step of determining the program organization unit source file supporting the target programmable logic control system specifically includes: determine all the program organization unit source files with the enable flag; for each program organization unit source file with the enable flag, determine whether the program organization unit source file is in the corresponding program organization unit enable set; if yes, determine 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 the program organization unit source files without the enable flag.
[0052] 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 an enable mark, determining whether the program organization unit source file needs to be modified; if modification is not required, determining the current version number of the program organization unit source file to form the corresponding target version of the program organization unit source file; if modification is required, updating the version number of the program organization unit source file to form the corresponding target version of the program organization unit source file.
[0053] The software can set ET enable for POUs. The configuration maintains the identification function of POUs that support it, and can add or delete POUs with ET enable for the selected configuration.
[0054] When completing the configuration switch, identify the POUs supported by the current configuration, disable the compilation of unsupported POUs, and enable the compilation of supported POUs. Use the functions of the logic programming configuration software to complete the compilation and construction of the current editing configuration and supported POUs.
[0055] S300: Generate a download file of a target programmable logic control system based on the program organization unit source files of all target versions to control the operation of the target programmable logic control system.
[0056] The steps of generating the target programmable logic control system download file based on the program organization unit source files of all target versions include: Determine whether the version number of the program organization unit source file has been updated; if so, update the version number of the download file and regenerate the download file of the target programmable logic control system; if not, use the historically generated download file as the download file of the target programmable logic control system.
[0057] Before the step of controlling the operation of the target programmable logic control system based on the downloaded file, it also includes obtaining the version number of the downloaded file currently running the target programmable logic control system; determining whether the version number of the currently running downloaded file is consistent with the version number of the standard downloaded file; if they are consistent, controlling the operation of the target programmable logic control system based on the downloaded file.
[0058] Specifically, the version number of the standard download file corresponding to the target programmable logic control system can be determined in the following way: Based on the version numbers of multiple program organization unit source files and configuration setting information, communication data content format information and IO variable logical variable management information, the version number of the standard download file is determined according to preset rules.
[0059] Furthermore, the steps of controlling the operation of the target programmable logic control system based on the downloaded file specifically include: unload the configuration setting information corresponding to the previous programmable logic control system; load 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; and send 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.
[0060] The software realizes separate text-based saving for each POU, defines the version number of the current file in the file, realizes text-based management for each configuration, and defines the maintenance version number of the saved text-based file for each set of configuration in the corresponding file. The POU version number is upgraded when the logic code is modified and saved, and the version number is upgraded when the A, B and C type information in the configuration is modified and saved.
[0061] The control system development user can write specific code for a specific target configuration T in the POU in the Φ set, and realize the fusion development of the general code and the specific code for all T.
[0062] 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: All modified POU files and configurations are saved, and the version of the changed content is upgraded. If the set of TV of the configuration and the version PV of the POU has changed compared with the last compilation and building for T, and the building is successful, the generated download file needs to be upgraded in version, and the version RV at this building is recorded. If the compilation and building are not successful, the editing state is returned. The generated download file R is saved independently from the R generated by other configurations T, and if there is a previously generated download file, it is replaced.
[0063] In the logic programming configuration software, all different scene configurations within the current project are executed in batch building, and the building process is as follows: The building step is executed for the current edited configuration T and the POU supported thereby, and whether the compilation and building are successful is recorded. The next scene configuration is switched, and the building step is executed, until the compilation of all scene configurations is completed, and the starting scene configuration is switched back.
[0064] After the selected T configuration is switched, the PLC supported by the embodiment is logged in, the RV of the current running R in the PLC is obtained, RVtmp is obtained by calculating TV and all PV supported by T in the current state, if RV is equal to RVtmp, the PLC online monitoring operation is started, otherwise the version saving, compilation and building to generate a new R and download need to be completed first.
[0065] The application provides a compiling 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 component modeling and management method of a logic program set, realizes componentized plug-in type logic adaptation and differential logic incremental content compilation for different wind power equipment configuration scenes, reduces artificial burden, and improves compiling efficiency.
[0066] Embodiment three In one specific embodiment, an engineer can specify a target wind turbine device to be switched through a user interface of the compiling software. In the existing programmable control system development engineering, the existing bus configuration content is removed from the current editing content, and device configuration configuration is performed again. Or the configuration is modified in the current editing device configuration configuration, and a new wind turbine system device configuration configuration is generated. New IO variables are generated.
[0067] For the new device configuration configuration, a 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 the logic components of other target configuration objects share some POU, the code in the POU needs to be modified to adapt to the new wind turbine.
[0068] The new target configuration configuration is saved as a new wind turbine target configuration object, and a new version of the logic program POU in the logic component range of the new wind turbine is established. In the construction, the POU in the logic component range of the target object and the POU source code supporting the current target object are compiled to generate a program running on a PLC, and a bus running configuration file is generated for the bus configuration parameters of the target object. After the runtime software in the PLC receives the above files, the program is initialized and run according to the configuration and program code in the files.
[0069] In the construction, as long as the target object supporting its own logic POU is modified, new download files can be generated for different target objects.
[0070] Embodiment four Based on the same inventive concept, the application also provides a compiling device of a programmable logic control system, which comprises: The analysis 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. 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 a corresponding target version. The generating module is configured to generate a downloading file of the target programmable logic control system based on the program organization unit source files of all target versions, so as to control the target programmable logic control system to run.
[0071] Please refer to Figure 9 , Figure 9 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 6. Figure 9 As shown in FIG. 6, the electronic device 600 includes a processor 610, a memory 620 and a bus 630.
[0072] The memory 620 stores machine readable instructions executable by the processor 610, and when the electronic device 600 is running, the processor 610 and the memory 620 communicate through the bus 630. When the machine readable instructions are executed by the processor 610, the steps of the compiling method of the programmable logic control system can be performed as described above. For details, refer to the method embodiments, which will not be described here.
[0073] The present application also provides a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the compiling method of the programmable logic control system can be performed as described above. For details, refer to the method embodiments, which will not be described here.
[0074] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0075] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and there can be another division manner in actual implementation. 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, and can be electrical, mechanical or other forms.
[0076] 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, i.e. they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the present embodiment.
[0077] Furthermore, each functional module in various embodiments 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.
[0078] It should be noted that if the function is realized in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and 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 method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0079] In this document, relational terms such as first and second and the like can merely be used to distinguish one entity or action from another, without necessarily requiring or implying any such actual relationship or order between or among the entities or actions.
[0080] 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 changes and modifications. Any modification, equivalent replacement, improvement, etc. within the spirit and principles 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; 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; Based on all target version program organization unit source files, a download file of the target programmable logic control system is generated to control the target programmable logic control system to run.
2. The method of claim 1, wherein, The configuration setting information comprises a program organization unit enabling set, 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 to be a 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 comprises all program organization unit source files without the enabling mark.
3. The method of claim 2, 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, 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 yes, a version number of the program organization unit source file is updated to form the corresponding target version program organization unit source file.
4. The method of claim 3, 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 a version number of a program organization unit source file is updated; If yes, a version number of the download file is updated, and the download file of the target programmable logic control system is regenerated; If no, a historically generated download file is taken as the download file of the target programmable logic control system.
5. The method of claim 1, wherein, Before the step of controlling the target programmable logic control system to run based on the download file, the method further comprises: A version number of a currently running download file of the target programmable logic control system is obtained; It is determined whether the version number of the currently running download file is consistent with a version number of a standard download file; If yes, the target programmable logic control system is controlled to run based on the download file.
6. The method of claim 5, wherein, The version number of the standard download file corresponding to the target programmable logic control system is determined in the following manner: 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 the standard download file is determined according to a preset rule.
7. The method of claim 1, wherein, The step of controlling the target programmable logic control system to run based on the download file specifically comprises: Configuration setting information corresponding to a previous programmable logic control system is unloaded; Program organization unit source files supporting the target programmable logic control system are loaded to generate the download file of the target programmable logic control system; The download file of the target programmable logic control system is sent to a programmable logic controller of the target programmable logic control system to control the target programmable logic control system to run.
8. A compiling apparatus of a programmable logic control system, characterized by comprising: The device comprises: 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; The matching module is configured to determine program organization unit source files supporting the target programmable logic control system, and form corresponding target version program organization unit source files; The generating module is configured to generate the 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.
9. An electronic device, comprising: The device 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 programmable logic control system compiling method according to any one of claims 1 to 7.
10. 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 programmable logic control system compiling method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
DCS system network variable increment updating method
CN114422344A
Program configuration method and system
CN114594937A
PLC software incremental compiling method and device
CN117806651A
PLC programming method and device based on information model
CN119105397A
Target program running method and device, electronic equipment and storage medium
CN119645537A