A PLC controller redundancy system
By using an open target programming language to realize data synchronization and switching between PLC controllers in the PLC controller redundant system, the data security risks and integration problems of the PLC controller redundant system are solved, and the reliability and working efficiency of the system are improved.
Patent Information
- Application Number
- CN202411082573.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The redundant systems of existing PLC controllers have problems with data security risks and difficulty in integrating with other systems, especially in motion control software integration, and lack effective redundant solutions.
Using the open target program language as the intermediate language, a redundant system of PLC controllers is designed, and data synchronization between each PLC controller is achieved through the image area access module. The configuration update and status analysis module determines the current execution and backup PLC controllers, and executes the switching execution program to improve the openness and reliability of the system.
It improves the reliability and work efficiency of the PLC control system, enhances the openness of the system, and facilitates safe inspection and integration of other systems.
Smart Images

Figure CN119126659B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a redundant system for a PLC controller, belonging to the technical field of industrial safety automation control. Background Art
[0002] In an industrial automation system, in order to enable the system to operate stably and reliably for a long time, a programmable logic controller (PLC) is generally used as the controller, and in order to further improve the reliability of the system, a redundant system needs to be built on the basis of the PLC.
[0003] A synchronous state is maintained between the main controller and the standby controller. When the main controller fails, the standby controller will take over the control right of the network, convert the previous "main connection" into a "standby connection", and convert the previous "standby connection" into a "main connection". At this time, the standby controller is converted into the main controller; when the I / O device receives a control right conversion request, it must ensure that the latest data is sent to the new main controller.
[0004] In the traditional PLC application scenario, the PLC manufacturer provides an integrated development environment (IDE) that complies with IEC61131-3. Based on this IDE, users use five common 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) for programming, convert it into a self-developed intermediate language and then compile it into machine language or directly convert the PLC language into machine language, and download it to the target PLC for execution. Since the intermediate language or compiler adopts a customized method, the operation of the PLC program and the implementation of redundancy are better realized; however, due to the closedness of the customized language or compiler (the major manufacturers cannot convert with each other), it brings security risks to the execution of data, and it is not easy to integrate with other algorithm software, especially motion control software. In addition, the industry's PLC industrial controllers do not provide their redundant solutions. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a redundant system for a PLC controller, which uses an open target program language as the intermediate language and cooperates with redundant control design to improve the working efficiency of the PLC controller.
[0006] To solve the above technical problems, the present invention adopts the following technical solutions: The present invention designs a redundant system for PLC controllers, including at least two PLC controllers. The structures of the PLC controllers are the same as each other. Each PLC controller respectively includes a PLC execution subsystem, a configuration and status image area, a configuration update and status analysis module, and an image area access module. Among them, 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 corresponding configuration and status image area and the data image area in the PLC execution subsystem.
[0007] The image area access modules in each PLC controller communicate with each other to synchronize the configuration information of the PLC controller, the status of the PLC controller, the status of the PLC execution subsystem, and the data in the PLC execution subsystem. And each image area access module respectively writes the synchronization result into the corresponding configuration and status image area and the data image area in the PLC execution subsystem.
[0008] The configuration update and status analysis modules in each PLC controller respectively read and analyze the corresponding configuration and status image area to determine a currently executing PLC controller and each currently standby PLC controller. And each configuration update and status analysis module respectively executes the same switching execution program implemented in an open target programming language for control, including controlling the PLC execution subsystem in the currently executing PLC controller to execute a PLC runtime program implemented in an open target programming language to input, process, and output data, and controlling the PLC execution subsystems in each currently standby PLC controller to pause working.
[0009] As a preferred technical solution of the present invention: The PLC execution subsystem includes a data image area, an input module, an output module, and a PLC execution module; among them, the data entry of the input module is connected to the data mapping area, the data exit of the input module is connected to the data entry of the PLC execution module, the data exit of the PLC execution module is connected to the data entry of the output module, and the data exit of the output module is connected to the data mapping area; 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 data image area in the corresponding PLC execution subsystem.
[0010] The configuration update and status analysis module is connected to the input module and the output module. The configuration update and status analysis module controls the input module to obtain data from the data mapping area and send it to the PLC execution module. The PLC execution module executes the PLC runtime program implemented in the open target program language to process the data. And the configuration update and status analysis module controls the output module to receive the result data processed by the PLC execution module and send it back to the data mapping area, or the configuration update and status analysis module controls the input module and the output module to pause the data processing of the PLC execution module.
[0011] As a preferred technical solution of the present invention: based on the PLC program designed in the standard PLC programming language, the following method is used to obtain the PLC runtime program implemented in the open target program language and the image area access program implemented in the open target program language;
[0012] Extract each variable in the PLC program, correspond to each preset attribute data according to the variable, call the image area generation program, and apply for corresponding space in the data image area;
[0013] At the same time, apply the IEC to open target program language compiler to convert the PLC program into code implemented in the open target program language, and compile it through the open target program language compiler to obtain the PLC runtime program, which is sent to the PLC execution module in each PLC controller; and correspondingly generate the image area access program implemented in the open target program language, which is sent to the image area access module in each PLC controller;
[0014] And in the same way as obtaining the PLC runtime program, for the switching program designed by the configuration, convert it to obtain the switching execution program implemented in the open target program language, and send it to the image area access module in each PLC controller.
[0015] As a preferred technical solution of the present invention: in the process of converting the PLC program into the PLC runtime program implemented in the open target program language, modify the variables defined in the PLC program into structures or classes with each preset attribute data; at the same time, use the instances of the obtained structures or classes to generate the image area access program implemented in the open target program language, and send it to the image area access module in each PLC controller.
[0016] As a preferred technical solution of the present invention: each of the preset attribute data includes variable name, type, length, value, offset address.
[0017] As a preferred technical solution of the present invention: each PLC controller is respectively connected to the PLC programming platform. The PLC programming platform designs the PLC program in the standard PLC programming language, and the PLC programming platform configures and designs the switching program.
[0018] 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).
[0019] As a preferred technical solution of the present invention: the open target program language is C++ program language or C program language.
[0020] As a preferred technical solution of the present invention: the PLC controller configuration information includes the hardware information of the PLC controller, communication configuration, and PLC execution subsystem configuration information.
[0021] As a preferred technical solution of the present invention: the data image areas in the PLC execution subsystems of each PLC controller are respectively connected to external devices, and the external devices collect data and send it to the data image area of the current executing PLC controller. After being processed by the PLC execution module, it is then sent to the external device through the data image area.
[0022] Compared with the prior art by adopting the above technical solutions, the PLC controller redundancy system of the present invention has the following technical effects:
[0023] The PLC controller redundancy system designed by the present invention uses an open target program language as an intermediate language, and based on a self-developed PLC IDE, a redundancy system composed of multiple PLC controllers is built. Through the PLC execution subsystems, configuration and status image areas, configuration update and status analysis modules, and image area access modules specifically designed under each PLC controller, data synchronization between each other is realized based on the image area access modules in each PLC controller, and the synchronization results are respectively written into the corresponding configuration and status image areas. The configuration update and status analysis modules in each PLC controller respectively read the corresponding configuration and status image areas to analyze and determine a current executing PLC controller and each current standby PLC controller, and respectively execute the same switching execution program for control. The current executing PLC controller inputs, processes, and outputs data, and each current standby PLC controller pauses working; the application of the open target program language improves the openness of the system, makes it easier to perform safety detection, and is easy to integrate or interface with other systems. Moreover, the design of the entire redundancy system greatly improves the reliability and working efficiency of the PLC control system. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a redundancy control schematic diagram in the application of the PLC controller redundancy system designed by the present invention;
[0025] Figure 2It is a schematic diagram of the application architecture of the PLC controller redundancy system designed by the present invention;
[0026] Figure 3 It is a flowchart for generating the data image area in the application of the PLC controller redundancy system designed by the present invention;
[0027] Figure 4 It is a flowchart for generating the program during the operation of the PLC in the application of the PLC controller redundancy system designed by the present invention;
[0028] Figure 5 It is a flowchart for generating the configuration and status image area in the application of the PLC controller redundancy system designed by the present invention. Specific embodiments
[0029] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings of the specification.
[0030] The present invention designs a PLC controller redundancy system. In practical applications, it includes at least two PLC controllers, and the structures of each PLC controller are the same. As Figure 1 shown, each PLC controller respectively includes a PLC execution subsystem, a configuration and status image area, a configuration update and status analysis module, and an image area access module. Among them, 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; among them, the PLC controller configuration information includes the hardware information of the PLC controller, communication configuration, and PLC execution subsystem configuration information; 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 corresponding configuration and status image area and the data image area in the PLC execution subsystem.
[0031] As Figure 1 shown, the image area access modules in each PLC controller communicate with each other to synchronize the PLC controller configuration information, PLC controller status, PLC execution subsystem status, and data in the PLC execution subsystem, and each image area access module writes the synchronization result into the corresponding configuration and status image area and the data image area in the PLC execution subsystem respectively.
[0032] The configuration update and status analysis modules in each PLC controller respectively read and analyze the corresponding configuration and status image areas to determine a currently executing PLC controller and each currently standby PLC controller, and each configuration update and status analysis module respectively executes the same switching execution program implemented in an open target programming language for control, including controlling the PLC execution subsystem in the currently executing PLC controller to execute the PLC runtime program implemented in an open target programming language, performing input, processing, and output on data, and controlling the PLC execution subsystems in each currently standby PLC controller to suspend operation.
[0033] In practical applications, such as Figure 1 shown, the specific design of the PLC execution subsystem includes a data image area, an input module, an output module, and a PLC execution module; among them, the data entry of the input module is connected to the data mapping area, the data exit of the input module is connected to the data entry of the PLC execution module, the data exit of the PLC execution module is connected to the data entry of the output module, and the data exit of the output module is connected to the data mapping area; the image area access module executes the image area access program implemented in an open target programming language to read and write the data image area in the corresponding PLC execution subsystem.
[0034] And as Figure 1 shown, the configuration update and status analysis module is further designed to be connected to the input module and the output module. The configuration update and status analysis module controls the input module to obtain data from the data mapping area and send it to the PLC execution module. The PLC execution module executes the PLC runtime program implemented in an open target programming language to process the data, and the configuration update and status analysis module controls the output module to receive the result data processed by the PLC execution module and send it back to the data mapping area, or the configuration update and status analysis module controls the input module and the output module to suspend the processing of data by the PLC execution module.
[0035] Regarding the PLC runtime program, image area access program, and switching execution program respectively implemented in an open target programming language involved in the above design, in practical applications, each PLC controller is respectively connected to a PLC programming platform. The PLC programming platform designs the PLC program in a standard PLC programming language such as ladder diagram language (LD), structured text language (ST), sequential function chart language (SFC), function block diagram language (FBD), or instruction list language (IL), and configures and designs the switching program by the PLC programming platform, and specifically designs to obtain the PLC runtime program, image area access program, and switching execution program in the following manner.
[0036] As Figure 3As shown, extract each variable in the PLC program, set each attribute data according to the variable, call the image area generation program, and apply for corresponding space in the data image area; meanwhile, as Figure 4 shown, apply a compiler that converts IEC to an open target program language to convert the PLC program into code implemented in the open target program language, where the variables defined in the PLC program are modified into structures or classes with each preset attribute data, and then compile through the compiler of the open target program language to obtain the PLC runtime program, and send it to the PLC execution module in each PLC controller; in practical applications, the specific design of each preset attribute data includes variable name, type, length, value, and offset address.
[0037] After obtaining the PLC runtime program, use the instance of the structure or class obtained by modifying the variables in the PLC program to generate an image area access program implemented in the open target program language, and send it to the image area access module in each PLC controller.
[0038] Furthermore, in the same way as obtaining the PLC runtime program, for the switching program designed by configuration, convert and obtain a switching execution program implemented in the open target program language, and send it to the image area access module in each PLC controller.
[0039] Regarding the configuration and status image area, in practical applications, it is obtained by executing as Figure 5 shown.
[0040] Apply the above design scheme to practice. Regarding the open target program language, specifically use the C++ programming language or the C programming language, which improves the openness of the system. Compared with the customized and closed intermediate languages or compilers of other manufacturers, C / C++ is easier to perform security detection as an intermediate language, and the designed system is very friendly to the control library algorithms running on C / C++, and is easy to integrate. In addition, other systems open to C / C++ are easier to integrate or dock with the designed system of the present invention, such as programming or efficiency tools like matlab.
[0041] In specific actual execution, as Figure 2As shown in the figure, the data image areas in the PLC execution subsystems of each PLC controller are respectively connected to external devices. The configuration and status image areas in each PLC controller are used to obtain and store the configuration information of the corresponding PLC controller, the status of the PLC controller, and the status of the PLC execution subsystem. Each image area access module respectively executes an image area access program to read and write to the corresponding configuration and status image areas, as well as the data image area in the PLC execution subsystem. At a preset cycle, the image area access modules in each PLC controller communicate with each other, realizing the synchronization of the configuration information of the PLC controller, the status of the PLC controller, the status of the PLC execution subsystem, and the data in the PLC execution subsystem, and writing them to the corresponding configuration and status image areas, as well as the data image area in the PLC execution subsystem, that is, realizing the cycle synchronization between each PLC controller.
[0042] Based on the above synchronization between each PLC controller, the configuration update and status analysis modules in each PLC controller respectively read and analyze the corresponding configuration and status image areas, and can determine a currently executing PLC controller and each currently standby PLC controller. For example, the PLC controller with no faults and the highest performance is used as the currently executing PLC controller, and the others are used as currently standby PLC controllers. Then, the configuration update and status analysis modules in each PLC controller can respectively execute the same switching execution program for control. Specifically, the configuration update and status analysis module in the currently executing PLC controller executes the switching execution program to control its PLC execution subsystem to execute the PLC operation program, and perform input, processing, and output on the data. The configuration update and status analysis modules in the other currently standby PLC controllers respectively execute the switching execution program to control their PLC execution subsystems to pause working, specifically controlling the input module and the output module, and pausing the data processing of the PLC execution module. In this way, under the above cycle synchronization operation, the configuration information and status information of each PLC controller are synchronously updated periodically. The configuration update and status analysis modules in each PLC controller can determine a currently executing PLC controller and each currently standby PLC controller according to the configuration information and status information of their own and the other PLC controllers obtained, and perform the corresponding switching design as described above, realizing the redundant control of the PLC controller.
[0043] After determining the currently executing PLC controller under cyclic operation, the external device collects data and sends it to the data image area of the currently executing PLC controller. The configuration update and status analysis module in the currently executing PLC controller controls the input module to obtain data from the data mapping area and send it to the corresponding PLC execution module. The corresponding PLC execution module executes the PLC runtime program to process the data. Then, the configuration update and status analysis module in the currently executing PLC controller controls the output module to receive the result data processed by the PLC execution module and send it back to the data mapping area. Finally, it is transmitted to the external device through the data image area.
[0044] While the currently executing PLC controller is working to process data, perform the synchronization operation as described above. It also involves synchronizing the data in the data image areas of each PLC controller, that is, the cycle ensures the synchronization of data between each PLC controller. When switching between different PLC controllers regarding the currently executing PLC controller, seamless docking of the processed data is achieved.
[0045] In practical applications, the user can also actively or conditionally trigger the system to passively switch the currently executing PLC controller and each currently standby PLC controller, that is, the currently executing PLC controller is switched to the currently standby PLC controller, and one of the currently standby PLC controllers is switched to the currently executing PLC controller.
[0046] The above design scheme is based on the self-developed PLC IDE, builds a redundant system composed of multiple PLC controllers, and uses an open target program language as the intermediate language, improving the openness of the system, making it easier to perform safety detection, and being easy to integrate or dock with other systems. Moreover, the design of the entire redundant system greatly improves the reliability and working efficiency of the PLC control system.
[0047] 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. Within the knowledge scope of those of ordinary skill in the art, various changes can be made without departing from the gist of the present invention.
Claims
1. A redundant system for a PLC controller, characterized in that: It includes at least two PLC controllers. The structures of each PLC controller are the same. Each PLC controller respectively includes a PLC execution subsystem, a configuration and status image area, a configuration update and status analysis module, and an image area access module. Among them, 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 corresponding configuration and status image area and the data image area in the PLC execution subsystem. The image area access modules in each PLC controller communicate with each other to synchronize the configuration information of the PLC controller, the status of the PLC controller, the status of the PLC execution subsystem, and the data in the PLC execution subsystem. And each image area access module respectively writes the synchronization result into the corresponding configuration and status image area and the data image area in the PLC execution subsystem. The configuration update and status analysis modules in each PLC controller respectively read and analyze the corresponding configuration and status image area to determine a currently executing PLC controller and each currently standby PLC controller. And each configuration update and status analysis module respectively executes the same switching execution program implemented in an open target programming language for control, including controlling the PLC execution subsystem in the currently executing PLC controller to execute a PLC runtime program implemented in an open target programming language to input, process, and output data, and controlling the PLC execution subsystems in each currently standby PLC controller to suspend operation.
2. The redundant system of a PLC controller according to claim 1, wherein: The PLC execution subsystem includes a data image area, an input module, an output module, and a PLC execution module; among them, the data entry of the input module is connected to the data mapping area, the data exit of the input module is connected to the data entry of the PLC execution module, the data exit of the PLC execution module is connected to the data entry of the output module, and the data exit of the output module is connected to the data mapping area; 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 data image area in the corresponding PLC execution subsystem. The configuration update and status analysis module is connected to the input module and the output module. The configuration update and status analysis module controls the input module to obtain data from the data mapping area and send it to the PLC execution module. The PLC execution module executes a PLC runtime program implemented in an open target programming language to process the data. And the configuration update and status analysis module controls the output module to receive the result data processed by the PLC execution module and send it back to the data mapping area, or the configuration update and status analysis module controls the input module and the output module to suspend the PLC execution module from processing data.
3. The redundant system of a PLC controller according to claim 2, wherein: Based on the PLC program designed in the standard PLC programming language, the following method is used to obtain a PLC runtime program implemented in an open target programming language and an image area access program implemented in an open target programming language; Extract each variable in the PLC program, set each attribute data according to the variable, call the image area generation program, and apply for corresponding space in the data image area; Meanwhile, apply a compiler that converts IEC to an open target program language to convert the PLC program into code implemented in the open target program language, and compile it through the compiler of the open target program language to obtain the PLC runtime program, which is sent to the PLC execution module in each PLC controller; and correspondingly generate an image area access program implemented in the open target program language, which is sent to the image area access module in each PLC controller; And in the same way as obtaining the PLC runtime program, for the switching program designed by configuration, convert it to obtain a switching execution program implemented in the open target program language, which is sent to the image area access module in each PLC controller.
4. The redundant system of a PLC controller according to claim 3, wherein: During the process of converting the PLC program into a PLC runtime program implemented in the open target program language, modify the variables defined in the PLC program into structures or classes with each preset attribute data; meanwhile, use the instances of the obtained structures or classes to generate an image area access program implemented in the open target program language, which is sent to the image area access module in each PLC controller.
5. The redundant system of a PLC controller according to claim 3 or 4, characterized in that: The preset each attribute data includes variable name, type, length, value, offset address.
6. The redundant system of a PLC controller according to claim 3, wherein: Each PLC controller is respectively connected to the PLC programming platform. The PLC programming platform designs the PLC program in the standard PLC programming language, and configures and designs the switching program by the PLC programming platform.
7. The redundant system of a PLC controller according to claim 3, 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.
8. A PLC controller redundancy system according to any one of claims 1 to 4, characterized in that: The open target program language is C++ programming language or C programming language.
9. The redundant system of a PLC controller according to claim 1, wherein: The PLC controller configuration information includes the hardware information of the PLC controller, communication configuration, and PLC execution subsystem configuration information.
10. The redundant system of a PLC controller according to claim 2, wherein: The data image areas in the PLC execution subsystems in each PLC controller are respectively connected to external devices. The external devices collect data and send it to the data image area of the currently executing PLC controller. After being processed by the PLC execution module, it is then sent to the external devices through the data image area.
Citation Information
Patent Citations
PLC compiling implement method
CN101587445A
Method and device for realizing redundant virtual PLC, equipment and storage medium
CN113434341A