A PLC Incremental Download Method and System
By distinguishing PLC incremental configuration information, code and variable information, using the open target programming language and the PLC programming platform IDE, cross-platform and cross-system updates of PLC controllers are realized, hardware dependence and enclosing problems in the existing technology are solved, and update efficiency and security are improved.
Patent Information
- Application Number
- CN202411529939.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2044-10-30
AI Technical Summary
During the update process, there is a "stop download" in the existing PLC controller that affects the stability and security of the system, and the existing "incremental download" method has problems with enclosure and hardware dependence, making it difficult to achieve cross-platform applications.
Design a PLC incremental download method to distinguish incremental configuration information, code and variable information, update using an open target programming language, and realize cross-platform update through the PLC programming platform IDE to cancel dependence on hardware.
It realizes efficient update of the PLC controller without stopping, improves system compatibility and security, reduces the cost and learning difficulty of hardware replacement, and enhances the integration capabilities with other systems.
Smart Images

Figure CN119556951B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a PLC incremental download method and system, belonging to the technical field of PLC design. Background Art
[0002] In the scenario of using a programmable logic controller (PLC) in an industrial field, generally, a programmer uses a PLC integrated development environment (IDE) to configure, program, and compile the PLC, and download it to the PLC target hardware for operation. Usually, if it is necessary to update the running PLC program, it is necessary to first stop the running PLC program, that is, "system stop", stop the original PLC process, and make the original configuration and variables invalid; then download the new program machine code / binary file, and then start the PLC program to run, reset the configuration, data / variables. This solution is usually referred to as "full download" or "initialization download".
[0003] During the operation of another industrial control system, it is necessary to quickly change some system configurations, variables, and even programs without stopping the equipment, that is, the modification cannot cause "disturbance" to the on-site equipment. In order not to affect the normal operation of the on-site control system and reduce the impact on the system stability and reliability, the "non-intrusive download" or "incremental download" method is usually used to update the running PLC program. Among them, "non-intrusive" includes non-intrusive configuration, non-intrusive variables, and non-intrusive control logic / algorithm. The non-intrusive download specifically means that these changes do not affect the unchanged parts. Generally, after the first download, the modifications during the subsequent downloads are not all modifications, but generally only incremental or partial modifications. For the parts of the configuration, variables, and control logic / algorithm that are not modified, the original logic or value should be ensured and not be interfered by the new changes.
[0004] However, in practical applications, there are also limitations in "incremental download" or "non-intrusive download". For example, the download will affect the running control points (such as a valve in the open state, and the original control method of this valve is involved in the newly downloaded configuration). Once there are large configuration changes (such as changing the controller, changing the communication method, or large changes in the program and parameters, etc.), "stop download" / "full download" / "initialization download" is required. And currently, the mainstream PLC industrial controllers in the industry do not provide solutions for "incremental download" / "non-intrusive download", and if a "customized" solution is used to implement it, there are many problems as follows:
[0005] 1) Due to the closed nature of the customized language or compiler (the major manufacturers cannot be mutually converted), it brings security risks and is not easy to integrate with other algorithm software, especially motion control software;
[0006] 2) If a self-developed compiler is used to convert the PLC language into machine code / binary files, there will be a problem that a specific compiler corresponds to specific hardware, and the compiler needs to be changed when the hardware is changed.
[0007] 3) Due to the uniqueness of the customized intermediate language, its readability, maintainability, and learning cost are generally worse than those of the intermediate language composed of general-purpose languages. If the intermediate language cannot be checked well, it will bring potential safety hazards. Summary of the Invention
[0008] The technical problem to be solved by the present invention is to provide a PLC incremental download method, which distinguishes incremental downloads under different types of data, triggers incremental updates based on the unexecuted time of the program during PLC operation, and realizes efficient updates of the PLC.
[0009] The present invention adopts the following technical solutions to solve the above technical problems: The present invention designs a PLC incremental download method. Based on the PLC controller including a configuration and status image area, an image area access module, and a PLC execution subsystem including a PLC execution module and a data image area, according to the incrementally modified PLC project, the following steps are executed to update the PLC controller;
[0010] Step A. Obtain the incremental configuration information of the PLC controller configuration information, the PLC incremental code of the corresponding runtime program, and the incremental variable information of the corresponding PLC incremental code in the incrementally modified PLC project, and then enter Step B;
[0011] Step B. Use the incremental configuration information and apply the image area access module to execute the image area access program implemented in the open target program language to update the configuration and status image area;
[0012] Use the incremental variable information and apply the image area access module to execute the image area access program implemented in the open target program language to update the data image area; [[ID=2,2]]
[0013] Use the PLC incremental code to update the PLC runtime program implemented in the open target program language and send it to the PLC execution module;
[0014] The updated data image area, PLC runtime program, and configuration and status image area do not take effect at the current time, and then enter Step C;
[0015] Step C. At the time when the PLC execution module does not execute the PLC runtime program, make the configuration and status image area, data image area, and PLC runtime program updated in Step B take effect to complete the update of the PLC controller.
[0016] As a preferred technical solution of the present invention: in step B, for the incremental variable information, according to the preset respective attribute data corresponding to the variables, call the image area generation program, apply for corresponding space in the data image area, construct an incremental data image area, and then combine the original data image in the data image area. According to the preset data image area update strategy, use the image area access module to execute the image area access program implemented in the open target programming language, and update the data in the data image area from the incremental data image area;
[0017] Then, for the PLC incremental code, combine it with the PLC program before the update, and use the compiler that converts IEC to the open target programming language to convert the PLC program after being replaced by the PLC incremental code into the code implemented in the open target programming language, and compile and update the PLC runtime program through the compiler of the open target programming language.
[0018] As a preferred technical solution of the present invention: during the process of converting and updating the PLC program into the PLC runtime program implemented in the open target programming language, modify the variables defined in the PLC incremental code into structures or classes with the preset respective attribute data; at the same time, use the instances of the obtained structures or classes to update the image area access program implemented in the open target programming language and send it to the image area access module.
[0019] As a preferred technical solution of the present invention: the preset respective attribute data includes variable name, type, length, value, offset address.
[0020] As a preferred technical solution of the present invention: in step B, for the incremental configuration information, call the image area generation program, apply for corresponding space in the configuration and status image area, construct an incremental configuration information image area, and then combine the original configuration information image in the data image area. According to the preset configuration and status image area update strategy, use the image area access module to execute the image area access program implemented in the open target programming language, update the configuration information in the configuration and status image area from the incremental configuration information image area, and update the PLC controller status and PLC execution subsystem status in the configuration and status image area, thereby realizing the update of the configuration and status image area.
[0021] As a preferred technical solution of the present invention: based on the PLC execution module extracting data from the data image area and returning the result data to the PLC runtime cycle corresponding to the data image area after executing the PLC runtime program, in step C, during the time when the PLC runtime cycle does not occur, make the updated configuration and status image area, data image area, and PLC runtime program in step B take effect to complete the update of the PLC controller.
[0022] As a preferred technical solution of the present invention: The configuration and status image area in the PLC controller is used to obtain and store the corresponding PLC controller configuration information, as well as the PLC controller status and the status of the PLC execution subsystem. The image area access module executes an image area access program implemented in an open target programming language, and reads and writes data to and from the configuration and status image area, as well as the data image area in the PLC execution subsystem. The PLC execution module in the PLC execution subsystem executes a PLC runtime program implemented in an open target programming language, processes the data extracted from the data image area, and returns the result data to the data image area.
[0023] As a preferred technical solution of the present invention: The open target programming language is C++ programming language or C programming language.
[0024] Correspondingly, the technical problem to be solved by the present invention is to provide a system for implementing the PLC incremental download method. Based on the PLC programming platform IDE, it efficiently implements the execution of the design method and improves the efficiency of incremental download.
[0025] To solve the above technical problems, the present invention adopts the following technical solutions: The present invention designs a system for the PLC incremental download method, including a PLC programming platform IDE and a runtime service. Based on the PLC programming platform IDE, it designs and implements the creation of a PLC project after incremental modification in a standard PLC programming language. The runtime service communicates with the PLC programming platform IDE to obtain the PLC project after incremental modification, and executes steps A to C to update the PLC controller.
[0026] As a preferred technical solution of the present invention: The standard PLC programming language includes ladder diagram language LD, structured text language ST, sequential function chart language SFC, function block diagram language FBD, or instruction list language IL.
[0027] For the PLC incremental download method and system of the present invention, compared with the prior art by adopting the above technical solutions, it has the following technical effects:
[0028] The present invention designs a PLC incremental downloading method, which distinguishes incremental configuration information, PLC incremental code, and incremental variable information in a PLC project after incremental modification, and downloads and updates the corresponding programs implemented in an open target programming language by corresponding modules in the PLC controller respectively, and then uses the time when the PLC runtime program is not executed as a trigger to take effect the application of various types of increments to complete the update of the PLC controller; and designs a corresponding system, which uses a PLC programming platform IDE as a basis, obtains the incrementally modified PLC project by a runtime service, executes it according to the designed method, and updates the PLC controller; the design scheme eliminates the dependence on hardware, can realize practical application across platforms and systems, and is applied in an existing open target programming language combined with the design structure of the PLC controller, so that the application of the PLC controller is more controllable and safe, and improves the compatibility with the existing technical system, thereby improving the actual working efficiency of the PLC controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a schematic diagram of the architecture of the PLC incremental downloading method and system designed by the present invention;
[0030] Figure 2 This is a schematic diagram of the application of the PLC incremental downloading method and system designed by the present invention;
[0031] Figure 3 It is a schematic diagram of incremental update of incremental configuration information in the design of the present invention;
[0032] Figure 4 It is a schematic diagram of incremental update of incremental variable information in the design of the present invention;
[0033] Figure 5 It is a schematic diagram of the incremental update of the PLC incremental code in the design of the present invention. DETAILED DESCRIPTION
[0034] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0035] The present invention designs a PLC incremental downloading method. The incremental downloading method is specifically designed based on that a PLC controller includes a configuration and status image area, an image area access module, and a PLC execution subsystem including a PLC execution module and a data image area. In the structure of the PLC controller, the configuration and status image area is used to obtain and store corresponding PLC controller configuration information, as well as the PLC controller status and the PLC execution subsystem status. In addition, PLC project or solution status information is also stored, including but not limited to the master-slave status, PLC task running status, connection status with external devices, fault information status, etc.
[0036] The image area access module executes an image area access program implemented in an open target programming language, and reads and writes to the configuration and status image area, as well as the data image area in the PLC execution subsystem.
[0037] The PLC execution module in the PLC execution subsystem executes a PLC runtime program implemented in an open target programming language, processes the data extracted from the data image area, and returns the result data to the data image area.
[0038] The data image area stores variable information defined by users in a PLC project or solution. Each variable includes, but is not limited to: variable name, type, length, value, offset address (opt) (offset address within the data image area, or segment address and offset address within the segment of the image area division), etc.
[0039] The technical objective of the PLC incremental download method designed in this patent is to only download and update the changed parts in the system, such as Figure 1 As shown, the runtime system (RTS) is divided into multiple services. These include "runtime services", "runtime programs", "image area access programs", "configuration management", and "others".
[0040] The PLC programming platform (IDE) provides a PLC programming environment for users, including the "non-runtime" parts such as the configuration of PLC projects / solutions, program editing, compilation, debugging, and runtime control.
[0041] The runtime services are responsible for the interaction between the runtime system and the PLC programming platform, such as controlled login / logout, secure communication, etc., parse service requests from the IDE, distribute them to different "services", and return corresponding service responses.
[0042] The runtime program mainly refers to the executable form of the "PLC business program", that is, the PLC project / solution edited and compiled by users, which is the part that needs to be updated during "incremental download" / "non-disruptive download" after users edit / change the source program.
[0043] Configuration management mainly refers to the management of the activation / invalidation of PLC configurations. That is, the part that needs to be updated during "incremental download" / "non-disruptive download" after users edit / change the configuration information, and its data is taken from the "configuration and status image area".
[0044] Image area access program: The "image area" mainly includes the "configuration and status image area", "data image area", etc. The "image area access program" mainly manages the access control of the "image area", and mainly controls the access of other programs in the PLC target machine to the "image area".
[0045] Based on the above, the present invention designs a PLC incremental download method. According to the PLC project after incremental modification,Figure 2 As shown, specifically perform the design of the following steps A to C to update the PLC controller.
[0046] Step A. Obtain the incremental configuration information about the PLC controller configuration in the incrementally modified PLC project, the PLC incremental code corresponding to the runtime program, and the incremental variable information corresponding to the PLC incremental code, and then proceed to Step B.
[0047] Step B. Perform update operations on the above-obtained incremental configuration information, PLC incremental code, and incremental variable information, including the following:
[0048] (1) For the incremental configuration information, as Figure 3 shown, call the image area generation program, apply for the corresponding space in the configuration and status image area, construct the incremental configuration information image area, and then combine it with the original configuration information image in the data image area. According to the preset configuration and status image area update strategy, use the image area access module to execute the image area access program implemented in the open target programming language to update the data in the configuration and status image area from the incremental configuration information image area, and update the PLC controller status and PLC execution subsystem status in the configuration and status image area, thereby realizing the update of the configuration and status image area.
[0049] (2) For the incremental variable information, as Figure 4 shown, according to the variable-corresponding preset attribute data, call the image area generation program, apply for the corresponding space in the data image area, construct the incremental data image area, and then combine it with the original data image in the data image area. According to the preset data image area update strategy, use the image area access module to execute the image area access program implemented in the open target programming language to update the data in the data image area from the incremental data image area.
[0050] (3) For the PLC incremental code, as Figure 5 shown, combine it with the PLC program before the update, use the compiler that converts IEC to the open target programming language to convert and update the PLC program after the PLC incremental code replacement into the code implemented in the open target programming language, and compile and update the PLC runtime program through the compiler of the open target programming language, and send it to the PLC execution module.
[0051] During the process of converting and updating the PLC program into a PLC runtime program implemented in an open target programming language, the variables defined in the PLC incremental code are modified into a structure or class with preset attribute data. Here, the preset attribute data includes variable name, type, length, value, and offset address, and interfaces for reading and writing variable values and a global access entry are provided, so as to implement reading data from the "image area" in the "input module" of the runtime program and updating data to the "image area" in the "output module". After the processed C / C++ language is correctly compiled, the newly generated structure / class member variables can be used to access / read / write the data in the data image area; at the same time, the instance of the obtained structure or class is used to update the image area access program implemented in the open target programming language and send it to the image area access module.
[0052] The updated data image area, PLC runtime program, and configuration and status image area do not take effect at the current time, and then step C is entered.
[0053] Step C. At the time when the PLC execution module does not execute the PLC runtime program, the configuration and status image area, data image area, and PLC runtime program updated in step B take effect to complete the update of the PLC controller; in practical applications, specifically based on the PLC execution module extracting data from the data image area and executing the PLC runtime program and then returning the result data to the PLC runtime cycle corresponding to the data image area, it is designed that at the time when there is no PLC runtime cycle, the configuration and status image area, data image area, and PLC runtime program updated in step B take effect to complete the update of the PLC controller, that is, in practical applications, the update and operation of the new PLC program are realized without stopping the on-site PLC.
[0054] Apply the designed PLC incremental download method described above in practice. Different from the design on binary code / machine code, the open target programming language here specifically uses C++ programming language or C programming language, which has no dependence on hardware and is friendly to "cross-hardware platforms" and even "cross-systems". Even after replacing the hardware chip, it is not necessary to replace the compiler, minimizing the bundling with hardware. And using C / C++ as the open target programming language improves openness and security. Compared with the customized and closed intermediate languages, as well as the customized compilers or interpreters of other manufacturers, C / C++ as the intermediate language is easier to perform security detection, thus ensuring the controllability and security of its PLC program. And considering that the vast majority of motion control libraries in the market have C / C++ versions, the design of this invention using C / C++ as the open target programming language is very friendly to the algorithms of motion control libraries based on C / C++, and is easy to integrate, which is a great advantage. Also, the design of this invention is easier to implement the integration or docking with other systems open to C / C++, such as programming or efficiency tools like matlab, whose conversion technology based on C / C++ has been mature, and the compatibility of this invention design with C / C++ can be used to achieve its integration or docking. Therefore, the PLC incremental download method designed with C / C++ as the open target programming language improves the usability and reliability of the PLC control system.
[0055] And in cooperation with the implementation of the above design method, further design a corresponding system, including a PLC programming platform IDE and a runtime service. Based on the PLC programming platform IDE, create an incrementally modified PLC project by designing with standard PLC programming languages (ladder diagram language LD, structured text language ST, sequential function chart language SFC, function block diagram language FBD, or instruction list language IL). The runtime service obtains the incrementally modified PLC project through data communication with the PLC programming platform IDE, and executes steps A to C to update the PLC controller.
[0056] In the above technical solution design, the incremental configuration information, PLC incremental code, and incremental variable information in the PLC project after incremental modification are distinguished, and are respectively downloaded and updated by the corresponding programs implemented in the open target program language by the corresponding modules in the PLC controller. Then, triggered by the time when the PLC runtime program is not executed, the applications of various types of increments are made effective to complete the update of the PLC controller. A corresponding system is designed, based on the PLC programming platform IDE, the PLC project after incremental modification is obtained by the runtime service and executed according to the designed method to update the PLC controller. The design solution eliminates the dependence on hardware, can realize practical applications across platforms and systems, and is applied in combination with the existing open target program language and the design structure of the PLC controller, making the application of the PLC controller more controllable and secure, and improving the compatibility with the existing technology system and the actual working efficiency of the PLC controller.
[0057] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments, and various changes can be made without departing from the spirit of the present invention within the scope of knowledge possessed by those of ordinary skill in the art.
Claims
1. A PLC incremental download method, characterized in that: The PLC controller based on includes a configuration and status image area, an image area access module, and a PLC execution subsystem including a PLC execution module and a data image area. According to the incrementally modified PLC project, the following steps are executed to update the PLC controller; Step A. Obtain the incremental configuration information of the PLC controller in the incrementally modified PLC project, the PLC incremental code corresponding to the runtime program, and the incremental variable information corresponding to the PLC incremental code, and then proceed to Step B; Step B. Using the incremental configuration information, apply the image area access module to execute the image area access program implemented in the open target programming language to update the configuration and status image area; For the incremental variable information, according to the preset attribute data corresponding to the variables, call the image area generation program to apply for corresponding space in the data image area to construct an incremental data image area. Then, combined with the original data image in the data image area, according to the preset data image area update strategy, apply the image area access module to execute the image area access program implemented in the open target programming language to update the data in the data image area from the incremental data image area; For the PLC incremental code, combined with the PLC program before the update, apply the compiler that converts IEC to the open target programming language to convert the PLC program after the PLC incremental code is replaced into the code implemented in the open target programming language, and compile and update the PLC runtime program through the compiler of the open target programming language, and then send it to the PLC execution module; The updated data image area, PLC runtime program, and configuration and status image area are not effective at the current time, and then proceed to Step C; Step C. At the time when the PLC execution module does not execute the PLC runtime program, make the configuration and status image area, data image area, and PLC runtime program updated in Step B effective to complete the update of the PLC controller.
2. The PLC incremental download method according to claim 1, wherein: During the process of converting and updating the PLC program into the PLC runtime program implemented in the open target programming language, modify the variables defined in the PLC incremental code into structures or classes with the preset attribute data; at the same time, use the instances of the obtained structures or classes to update the image area access program implemented in the open target programming language and send it to the image area access module.
3. The PLC incremental download method according to claim 1, characterized in that: The preset attribute data includes variable name, type, length, value, and offset address.
4. The PLC incremental download method according to claim 1, wherein: In Step B, for the incremental configuration information, call the image area generation program to apply for corresponding space in the configuration and status image area to construct an incremental configuration information image area. Then, combined with the original configuration information image in the data image area, according to the preset configuration and status image area update strategy, apply the image area access module to execute the image area access program implemented in the open target programming language to update the data in the configuration and status image area from the incremental configuration information image area, and update the PLC controller status and PLC execution subsystem status in the configuration and status image area, thereby realizing the update of the configuration and status image area.
5. The PLC incremental download method according to claim 1, wherein: The PLC execution module extracts data from the data image area, executes the PLC runtime program, and returns the result data to the corresponding PLC runtime cycle in the data image area. In step C, during the time when the PLC runtime cycle does not occur, the updated configuration and status image area, data image area, and PLC runtime program in step B are made effective to complete the update of the PLC controller.
6. The PLC incremental download method according to claim 1, characterized in that: In the PLC controller, the configuration and status image area is used to obtain and store the configuration information of the corresponding PLC controller, as well as the status of the PLC controller and the status of the PLC execution subsystem. The image area access module executes an image area access program implemented in an open target programming language to read and write data in the configuration and status image area and the data image area in the PLC execution subsystem. The PLC execution module in the PLC execution subsystem executes a PLC runtime program implemented in an open target programming language to process the data extracted from the data image area and returns the result data to the data image area.
7. A PLC incremental download method according to any one of claims 1 to 6, characterized in that: The open target programming language is the C++ programming language or the C programming language.
8. A system for implementing the PLC incremental download method according to any one of claims 1 to 7, characterized in that: It includes a PLC programming platform IDE and a runtime service. Based on the PLC programming platform IDE, the creation of an incrementally modified PLC project is designed and implemented in a standard PLC programming language. The runtime service communicates with the PLC programming platform IDE to obtain the incrementally modified PLC project and executes steps A to C to update the PLC controller.
9. The system according to claim 8, wherein: The standard PLC programming language includes ladder diagram language LD, structured text language ST, sequential function chart language SFC, function block diagram language FBD, or instruction list language IL.
Citation Information
Patent Citations
Online downloading method for programmable logic controller
CN112748933A
Integrated compiling and downloading method for different system architecture controllers
CN117573132A