PLC incremental downloading method and system

By designing the PLC incremental download method, differentiating the incremental download of different types of data, and effectively updating the program during the PLC runtime, the problem of stopping operation during the update process of the existing PLC system is solved, and efficient and stable PLC program update is achieved.

CN119556951AActive Publication Date: 2025-03-04JISHAN ZHIGONG (SUZHOU) TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411529939.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-04
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

The existing PLC system needs to stop running when updating the program, causing the system to stop, affecting production efficiency, and lack of effective incremental download solutions, causing disturbances to the field equipment during the download process.

Method used

A PLC incremental download method is designed. By distinguishing the incremental download of different types of data, the PLC runtime program is used to incremental updates using the unexecution time of the PLC runtime program. The specific steps include obtaining the incremental modified configuration information, code and variable information, updating the configuration and status image area, data image area and PLC runtime program respectively, and taking effect these updates at the unexecution time.

Benefits of technology

It realizes efficient update of PLC programs, avoids system parking, reduces disturbances to field equipment, improves update efficiency and system stability, and reduces dependence on hardware, and supports cross-platform and cross-system applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119556951A_ABST
    Figure CN119556951A_ABST
Patent Text Reader

Abstract

The invention relates to a PLC (Programmable Logic Controller) incremental downloading method, which comprises the following steps of: distinguishing incremental configuration information, PLC incremental codes and incremental variable information in a PLC project after incremental modification, respectively downloading and updating by corresponding modules in a PLC controller through corresponding programs realized by open type target program languages, and then taking applications of various types of increments into effect at the time of not executing the program when the PLC runs, so as to complete the downloading of the PLC project. Updating of the PLC is completed; meanwhile, designing a corresponding system, based on a PLC programming platform IDE, obtaining a PLC project after incremental modification by a runtime service, and efficiently executing the designed method; according to the design scheme, dependence on hardware is canceled, cross-platform and cross-system practical application can be achieved, application of the PLC is more controllable and safer by combining an existing open type target program language with the design structure of the PLC, compatibility between the PLC and a system in the prior art is improved, and the practical working efficiency of the PLC is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a PLC incremental downloading method and system, belonging to the technical field of PLC design. Background Art

[0002] In the scenario of using programmable logic controllers / PLCs in industrial sites, programmers generally use PLC integrated development environment / IDE to configure, program, and compile the PLC, and then download it to the PLC target hardware for operation. Normally, if you need to update a running PLC program, you need to first stop the running PLC program, that is, "system shutdown", 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 reset the configuration, data / variables. This solution is usually called "full download" or "initial download".

[0003] During the operation of another type of 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 stability and reliability of the system, "disturbance-free download" or "incremental download" is usually used to update the running PLC program. Among them, "disturbance-free" includes configuration disturbance-free, variable disturbance-free, and control logic / algorithm disturbance-free. Disturbance-free download specifically means that these changes do not affect the original unchanged parts. Generally, after the first download, the modification during the second download is not a complete modification, but generally only an incremental or partial modification. The configuration, variables, and control logic / algorithm that have not been modified should maintain the original logic or value and not be disturbed by new changes.

[0004] However, in actual applications, "incremental download" or "non-disturbance download" also has limitations, such as downloading will affect the running control points (such as a valve in the open state, the new downloaded configuration involves the original control method of this valve), so once it involves a major configuration change (such as changing the controller, changing the communication method, or a large change in the program and parameters, etc.), "stop download" / "full download" / "initial download" is required. In addition, the mainstream PLC industrial controllers in the industry currently do not provide their "incremental download" / "non-disturbance download" solutions, and if the "customized" solution is used to implement it, there are many problems as follows:

[0005] 1) Due to the closed nature of customized languages ​​or compilers (main manufacturers cannot convert to each other), 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 file, the problem arises that a specific compiler corresponds to specific hardware, and changing the hardware requires changing the compiler.

[0007] 3) Due to the uniqueness of customized intermediate language, its readability, maintainability and learning cost are generally worse than those of intermediate language composed of general language. If the intermediate language cannot be checked well, it will bring security risks. 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, performs incremental updates based on the unexecuted time of the PLC runtime program, and realizes efficient updates of the PLC.

[0009] In order to solve the above technical problems, the present invention adopts the following technical solutions: 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 performed to update the PLC controller;

[0010] Step A. Obtain incremental configuration information about the configuration information of the PLC controller in the PLC project after incremental modification, 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;

[0011] Step B. Using the incremental configuration information, the image area access module executes the image area access program implemented in the open object programming language to update the configuration and status image areas;

[0012] Using the incremental variable information, the image area access module executes an image area access program implemented in an open object programming language to update the data image area;

[0013] Update the PLC runtime program implemented in the open object programming language with the PLC incremental code and send it to the PLC execution module;

[0014] The above-mentioned updated configuration and status image area, data image area, and current time of the PLC runtime program are not effective, and then the process goes to step C;

[0015] Step C. When the PLC execution module is not executing the PLC runtime program, the configuration and status image area, data image area, and PLC runtime program updated in step B are effective to complete the update of the PLC controller.

[0016] As a preferred technical solution of the present invention: in the step B, for the incremental variable information, various attribute data are preset according to the corresponding variables, the image area generation program is called, the corresponding space is applied in the data image area, the incremental data image area is constructed, and then combined with the original data image in the data image area, according to the preset data image area update strategy, the image area access module is used to execute the image area access program implemented in the open target programming language, and the data from the incremental data image area is updated for the data image area;

[0017] Then, for the PLC incremental code, combined with the PLC program before the update, the IEC to open target program language compiler is used to convert the PLC program after the PLC incremental code is replaced into a code implemented in the open target program language, and the PLC runtime program is compiled and updated using the open target program language compiler.

[0018] As a preferred technical solution of the present invention: in 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; at the same time, the obtained structure or class instance 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.

[0019] As a preferred technical solution of the present invention: the preset attribute data includes variable name, type, length, value, and offset address.

[0020] As a preferred technical solution of the present invention: in the step B, for the incremental configuration information, the image area generation program is called, the corresponding space is applied for in the configuration and status image area, the incremental configuration information image area is constructed, and then combined with the original configuration information image in the data image area, according to the preset configuration and status image area update strategy, the image area access module is applied to execute the image area access program implemented in an open target programming language, the configuration information in the configuration and status image area is updated with the data from the incremental configuration information image area, and the PLC controller status and PLC execution subsystem status in the configuration and status image area are updated, 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, data is extracted from the data image area, and the result data is returned to the PLC runtime cycle corresponding to the data image area after executing the PLC runtime program. In step C, when the PLC runtime cycle does not occur, the configuration and status image area, data image area, and PLC runtime program updated in step B are effective 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 PLC execution subsystem status; the image area access module executes the image area access program implemented in an open target programming language, and reads and writes 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 the 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] Corresponding to the above, the technical problem that the present invention also needs to solve is to provide a system for implementing the PLC incremental downloading method, which is based on the PLC programming platform IDE, efficiently implements the execution of the design method, and improves the efficiency of incremental downloading.

[0025] In order to solve the above technical problems, the present invention adopts the following technical solutions: the present invention designs a system of a PLC incremental downloading method, including 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 implemented in a standard PLC programming language design. The runtime service communicates data with the PLC programming platform IDE to obtain the incrementally modified PLC project, 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 flow chart language SFC, function block diagram language FBD or instruction list language IL.

[0027] The PLC incremental downloading method and system described in the present invention adopts the above technical solution and has the following technical effects compared with the prior art:

[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 by the corresponding modules in the PLC controller in an open target programming language, and then takes the time when the PLC runtime program is not executed as a trigger to take effect the application of various types of increments, and completes the update of the PLC controller; and designs a corresponding system, which is based on a PLC programming platform IDE, obtains the incrementally modified PLC project by a runtime service, executes it according to the design method, and updates the PLC controller; the design scheme eliminates the dependence on hardware, can realize cross-platform and cross-system practical applications, and uses the existing open target programming language and the design structure of the PLC controller for application, so that the application of the PLC controller is more controllable and safe, and improves the compatibility with the existing technical system, and improves the actual working efficiency of the PLC controller. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a schematic diagram of the architecture of the PLC incremental downloading method and system designed by the present invention;

[0030] Figure 2 It is an application schematic diagram 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 incremental update of PLC incremental code in the design of the present invention. DETAILED DESCRIPTION

[0034] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.

[0035] The present invention designs a PLC incremental downloading method. Based on the fact 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, the incremental downloading method is specifically designed. 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, the PLC task running status, the connection status with external devices, the fault information status, etc.

[0036] The image area access module executes the image area access program implemented in the open object programming language to read and write the configuration and status image area and the data image area in the PLC execution subsystem.

[0037] The PLC execution module in the PLC execution subsystem executes the PLC runtime program implemented in the 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 the variable information defined by the user in the PLC project or solution. Each variable includes but is not limited to: variable name, type, length, value, offset address (opt) (offset address in the data image area, or segment address and offset address in the image area segment), etc.

[0039] The technical purpose of the PLC incremental download method designed by this patent is to download only the changed parts of the update system, such as Figure 1 As shown in the figure, the runtime system (RTS) is divided into multiple services, including "runtime service", "runtime program", "image area access program", "configuration management" and "others".

[0040] The PLC programming platform (IDE) provides users with a PLC programming environment, including the "non-runtime" parts of PLC project / solution configuration, program editing, compilation, debugging, and operation control;

[0041] The runtime service is responsible for the interaction between the runtime system and the PLC programming platform, such as controlled login / logout, secure communication, etc. It parses the service requests from the IDE, distributes them to different "services", and returns the 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 the user. It is the part that needs to be updated during "incremental download" / "non-disturbance download" after the user edits / changes the source program.

[0043] Configuration management mainly refers to the management of the effectiveness / invalidation of PLC configuration. That is, after the user edits / changes the configuration information, the part that needs to be updated during "incremental download" / "non-disturbance download" 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] According to the above, the present invention designs a PLC incremental download method, according to the incremental modified PLC project, according to Figure 2 As shown, the design of the following steps A to C is specifically performed to update the PLC controller.

[0046] Step A. Obtain the incremental configuration information about the PLC controller configuration information in the PLC project after incremental modification, 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 an update operation on the incremental configuration information, PLC incremental code, and incremental variable information obtained above, including the following:

[0048] (1) For incremental configuration information, such as Figure 3 As shown, the image area generation program is called, the corresponding space is applied in the configuration and status image area, the incremental configuration information image area is constructed, and then combined with the original configuration information image in the data image area, according to the preset configuration and status image area update strategy, the image area access module is applied to execute the image area access program implemented in the open target programming language, the configuration information in the configuration and status image area is updated with the data from the incremental configuration information image area, and the PLC controller status and PLC execution subsystem status in the configuration and status image area are updated, thereby realizing the update of the configuration and status image area.

[0049] (2) For incremental variable information, such as Figure 4 As shown, each attribute data is preset according to the variable, the image area generation program is called, the corresponding space is applied for in the data image area, the incremental data image area is constructed, and then combined with the original data image in the data image area, according to the preset data image area update strategy, the image area access module is applied to execute the image area access program implemented in the open target programming language, and the data from the incremental data image area is updated for the data image area.

[0050] (3) For PLC incremental code, such as Figure 5 As shown, in combination with the PLC program before the update, the IEC to open target program language compiler is applied to convert and update the PLC program after the PLC incremental code is replaced into a code implemented in the open target program language, and the PLC runtime program is compiled and updated by the open target program language compiler and sent to the PLC execution module.

[0051] In the above 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 structures or classes with preset attribute data, where the preset attribute data include variable name, type, length, value, offset address, and an interface for reading and writing variable values ​​and a global access entry are provided, so as to realize reading data from the "image area" in the "input module" of the runtime program, and to realize updating data to the "image area" in the "output module". After the C / C++ language processed in this way is correctly compiled, the newly generated structure / class member variables can be used to access / read and write data in the data image area; at the same time, the image area access program implemented in the open target programming language is updated using the obtained structure or class instance and sent to the image area access module.

[0052] The above updated configuration and status image area, data image area, and current time of the PLC runtime program are not effective, and then go to step C.

[0053] Step C. 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 are effective to complete the update of the PLC controller; in actual application here, specifically 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, it is designed here that when the PLC runtime cycle does not occur, the configuration and status image area, data image area, and PLC runtime program updated in step B are effective to complete the update of the PLC controller, that is, in actual application, the update and operation of the new PLC program is realized without stopping the on-site PLC.

[0054] The above-designed PLC incremental downloading method is applied in practice. Different from the design on binary code / machine code, the open target programming language here specifically adopts C++ programming language or C programming language. It has no dependence on hardware and is friendly to "cross-hardware platform" and even "cross-system". Even after replacing the hardware chip, it is not necessary to replace the compiler, which minimizes the binding with the hardware. And using C / C++ as the open target programming language improves openness and security. Compared with customized and closed intermediate languages, customized compilers or interpreters of other manufacturers, C / C++ as the intermediate language It is easier to carry out safety detection, thereby ensuring the controllability and safety of its PLC program; and in view of the fact that most motion control libraries on the market have C / C++ versions, the present invention uses C / C++ as the design of the open target programming language, which is very friendly to the C / C++ motion control library algorithm and easy to integrate, which is a great advantage; and the design of the present invention is easier to achieve integration or docking with other systems open to C / C++, such as programming or efficiency tools such as MATLAB, which are based on the mature conversion technology for C / C++, and the compatibility of the present 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 ease of use and reliability of the PLC control system.

[0055] In conjunction with the implementation of the above-mentioned design method, a corresponding system is further designed, including 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 (ladder diagram language LD, structured text language ST, sequential function flow chart language SFC, function block diagram language FBD or instruction list language IL). The runtime service communicates data with the PLC programming platform IDE to obtain the incrementally modified PLC project, and executes steps A to C to update the PLC controller.

[0056] The above technical solution is designed to distinguish the incremental configuration information, PLC incremental code, and incremental variable information in the PLC project after incremental modification, and the corresponding modules in the PLC controller download and update the corresponding programs implemented in the open target programming language respectively, and then use 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 design a corresponding system, based on the PLC programming platform IDE, to obtain the incrementally modified PLC project by the runtime service, and execute it according to the design method to update the PLC controller; the design scheme eliminates the dependence on hardware, can realize practical applications across platforms and systems, and is applied in the existing open target programming language combined with the design structure of the PLC controller, making the application of the PLC controller more controllable and safe, and improving the compatibility with the existing technical system, and improving the actual working efficiency of the PLC controller.

[0057] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A PLC incremental downloading method, characterized by: Based on the fact that the 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, according to the incrementally modified PLC project, perform the following steps to update the PLC controller; Step A. Obtain incremental configuration information about the 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, applying the image area access module to execute the image area access program implemented in the open object programming language, and updating the configuration and status image areas; Using the incremental variable information, the image area access module executes an image area access program implemented in an open object programming language to update the data image area; Update the PLC runtime program implemented in the open object programming language with the PLC incremental code and send it to the PLC execution module; The above-mentioned updated configuration and status image area, data image area, and current time of the PLC runtime program are not effective, and then the process goes to step C; Step C. When the PLC execution module is not executing the PLC runtime program, the configuration and status image area, data image area, and PLC runtime program updated in step B are effective to complete the update of the PLC controller.

2. According to the PLC incremental downloading method of claim 1, it is characterized by: In the step B, for the incremental variable information, the image area generation program is called according to the preset attribute data corresponding to the variable, the corresponding space is applied in the data image area, the incremental data image area is constructed, and then combined with the original data image in the data image area, according to the preset data image area update strategy, the image area access module is applied to execute the image area access program implemented in the open target programming language, and the data from the incremental data image area is updated for the data image area; Then, for the PLC incremental code, combined with the PLC program before the update, the IEC to open target program language compiler is used to convert the PLC program after the PLC incremental code is replaced into a code implemented in the open target program language, and the PLC runtime program is compiled and updated using the open target program language compiler.

3. A PLC incremental downloading method according to claim 2, characterized in that: In the process of converting and updating a 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; at the same time, the image area access program implemented in the open target programming language is updated using the obtained structure or class instance and sent to the image area access module.

4. A PLC incremental downloading method according to claim 2, characterized in that: The preset attribute data include variable name, type, length, value, and offset address.

5. A PLC incremental downloading method according to claim 1, characterized in that: In the step B, for the incremental configuration information, the image area generation program is called, the corresponding space is applied for in the configuration and status image area, the incremental configuration information image area is constructed, and then combined with the original configuration information image in the data image area, according to the preset configuration and status image area update strategy, the image area access module is applied to execute the image area access program implemented in the open target programming language, the configuration information in the configuration and status image area is updated with the data from the incremental configuration information image area, and the PLC controller state and the PLC execution subsystem state in the configuration and status image area are updated, thereby realizing the update of the configuration and status image area.

6. A PLC incremental downloading method according to claim 1, characterized in that: Based on the PLC execution module extracting data from the data image area and executing the PLC runtime program, the result data is returned to the PLC runtime cycle corresponding to the data image area. In step C, when the PLC runtime cycle does not occur, the configuration and status image area, data image area, and PLC runtime program updated in step B are effective to complete the update of the PLC controller.

7. A PLC incremental downloading method according to claim 1, characterized in that: 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 PLC execution subsystem status. The image area access module executes the image area access program implemented in an open target programming language to read and write to 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 the PLC runtime program implemented in an open target programming language to process the data extracted from the data image area and return the result data to the data image area.

8. A PLC incremental downloading method according to any one of claims 1 to 7, characterized in that: The open object programming language is C++ programming language or C programming language.

9. A system for implementing a PLC incremental downloading method as claimed in any one of claims 1 to 8, characterized in that: The invention comprises 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 implemented by designing a standard PLC programming language. The runtime service communicates data with the PLC programming platform IDE to obtain the incrementally modified PLC project, and executes steps A to C to update the PLC controller.

10. A PLC incremental downloading method according to claim 9, characterized in that: The standard PLC programming language includes ladder diagram language LD, structured text language ST, sequential function flow 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

  • Configuration increment downloading method and device, equipment and storage medium

    CN115840569A

  • Integrated compiling and downloading method for different system architecture controllers

    CN117573132A