A small PLCCPU soft redundancy system construction method
By using a structure consisting of a main controller, a redundant controller, and a monitoring controller, a soft redundancy system for small PLCs is achieved. This solves the problem of insufficient reliability of small PLCs in important control applications, reduces system costs, and improves the stability and adaptability of the control system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAVAL UNIV OF ENG PLA
- Filing Date
- 2022-11-18
- Publication Date
- 2026-04-10
AI Technical Summary
The lack of hard and soft redundancy in small PLCs limits their application in critical control situations, leading to the need for larger and more expensive PLCs in some cases, thus increasing system equipment costs.
The system adopts a structure consisting of a main controller, redundant units, and a monitoring unit, connected via an industrial Ethernet network to achieve a soft redundancy system for small PLCs. The monitoring unit acts as the information exchange and status judgment decision-maker, enabling seamless CPU switching and data synchronization.
It improves the reliability of small PLCs and the stability of control systems, reduces system construction costs, adapts to application requirements in special environments, and meets the needs of high-reliability control applications.
Smart Images

Figure CN115755571B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a small PLC CPU soft redundancy system construction method, and particularly to a redundancy processing of a small PLC. BACKGROUND
[0002] In a PLC control system, in order to ensure the reliable operation of the control system in an important control place, the controller (CPU) of the PLC control system is usually required to be in a dual-machine hot standby state, i.e., a hot redundancy working state. There are two ways of PLC CPU redundancy, i.e., hard redundancy and soft redundancy. The PLC hard redundancy adopts a special hardware module to realize the switching of the CPU by judging and analyzing the system running signals, while the PLC soft redundancy adopts a special software module to realize the switching of the CPU by judging and analyzing the system running signals.
[0003] Cold backup and hot backup: In a control system, in order to ensure the reliable operation of the system, a dual-machine backup is adopted for the controller (or master control machine) in the system. The dual-machine backup has two forms, i.e., cold backup and hot backup. The cold backup form: when the working master control machine fails, the working master control machine stops running (stops power supply), the standby master control machine replaces the original working master control machine, the standby master control machine is powered on and starts running, and the standby master control machine replaces the original master control machine to run; the hot backup is that the working master control machine and the standby master control machine are both powered on and work online, the working master control machine executes tasks online, and the standby master control machine receives the working parameters and working state of the working master control machine online. Once the working master control machine fails, the standby master control machine replaces the working master control machine to run and continue to complete the working tasks, and the original working master control machine exits the running, so as to realize the non-disturbance switching and seamless connection of the hardware devices.
[0004] Hot backup redundancy form: the hot backup has two forms, i.e., hard redundancy and soft redundancy. The large and medium-sized PLC CPU provides a hard redundancy mode, i.e., a special redundancy CPU hardware module is provided by the manufacturer, such as the CPU417H and CPU414H of Siemens, the running state of the CPU hardware is automatically judged by the system through the connection between the CPUs, if the working CPU device appears abnormal, the system automatically removes the current working CPU device, and the standby CPU device is quickly put into operation; in addition, the large and medium-sized PLC CPU also provides a soft redundancy mode, i.e., a special redundancy software module is provided by the manufacturer, such as the SWR software package of Siemens, the running CPU and the standby CPU are configured as a fault-tolerant working mode by the special software package, the SWR software judges whether the working CPU device is normally running, if the working CPU device appears abnormal, the system automatically puts the standby CPU device into the running mode.
[0005] The function and difference of large, medium and small PLC: according to the I / O point processing capacity: large PLC can process more than 2048 I / O points, with CPU hard redundancy function; medium PLC can process 256-2048 I / O points, with CPU soft redundancy function; small PLC processes I / O points generally below 256 points, without CPU redundancy function.
[0006] Generally, the large and medium PLC programming development software provides the corresponding software module of soft redundancy, while the small PLC programming development software does not provide the software module of soft redundancy, and does not support the PLC hard redundancy working mode. Since the small PLC has the advantages of small size, low price and low power consumption, it can also be applied to some important occasions under the condition of meeting the application. Since the small PLC does not have the hard (soft) redundancy function, it brings great trouble to the application of the small PLC in important occasions.
[0007] For small PLC, due to its low price, through appropriate IO expansion, its application range is greatly enhanced. Compared with large and medium PLC, since small PLC itself does not have (hard / soft) redundancy function, in some important control occasions, even if small PLC can meet the demand of executing control task, people still have to give up it and select large and medium PLC with redundancy control function. This limits the use range of small PLC, and also increases the cost of system equipment. SUMMARY
[0008] The purpose of the present application is to overcome the defect of small PLC CPU without redundancy function in the prior art, and provide a small PLC CPU soft redundancy system construction method which runs stably and reliably.
[0009] To achieve the above purpose, the technical solution of the present application is:
[0010] A small PLC CPU soft redundancy system construction method, the construction method is based on the following structure: including: host computer, redundancy machine and monitoring machine, the host computer, redundancy machine and monitoring machine are connected through industrial Ethernet, the controlled equipment is connected with the host computer and redundancy machine through network at the same time, the host computer and redundancy machine are the same type small PLC;
[0011] The small PLC CPU soft redundancy system construction method comprises the following steps:
[0012] S1, device startup: after the device starts running, the host computer, redundancy machine and monitoring machine are all in initial startup state, at this time the monitoring machine initializes the working mark of the host computer and redundancy machine, the working state of the host computer and the non-working state of the redundancy machine; the monitoring machine transmits the initial value of the working mark to the host computer and redundancy machine respectively;
[0013] The main control machine receives a working signal after starting and is in a working state, and the main control machine starts a normal working procedure and synchronously transmits system running data to the redundant machine.
[0014] The redundant machine receives a working signal after starting and is in a non-working state, and the redundant machine starts a hot standby procedure and synchronously backs up real-time running data of the main control machine, and the redundant machine is in a hot standby state; S2 is entered.
[0015] S2, program running and monitoring of the main control machine:
[0016] The main control machine normally runs a working procedure, the monitoring machine reads real-time I / O running data of the main control machine and processes the real-time I / O running data, obtains corresponding control parameters as given to the main control machine, and the main control machine continues to run a control procedure according to the received control parameters.
[0017] In the above working process, the main control machine synchronously transmits system running data to the redundant machine, the redundant machine runs a hot standby procedure and synchronously backs up real-time running data of the main control machine, and the redundant machine is in a hot standby state.
[0018] The monitoring machine reads CPU states and program states of the main control machine at a certain period and analyzes CPU running states and user program running states of the main control machine:
[0019] When it is found that the CPU running states and the user program running states are both normal, the monitoring machine keeps a current working signal unchanged and continues to execute a working procedure of S2.
[0020] When it is found that the CPU running states or the user program running states are abnormal, S3 is entered.
[0021] S3, switching of the main control machine and the redundant machine:
[0022] When it is found that the CPU running states or the user program running states of the main control machine are abnormal, the monitoring machine modifies a working signal as: the main control machine is in a non-working state and the redundant machine is in a working state; at this time, the main control machine exits and is in an offline state, the redundant machine refreshes data of a specified unit according to system synchronous data related parameters received by the redundant machine, at this time, the redundant machine continues working by following a working procedure of the main control machine, a non-disturbance switching of the system is realized, and S4 is entered.
[0023] S4, program running and monitoring of the redundant machine:
[0024] The redundant machine normally runs a working procedure, the monitoring machine reads real-time I / O running data of the redundant machine and processes the real-time I / O running data, obtains corresponding control parameters as given to the redundant machine, and the redundant machine continues to run a working procedure according to the received control parameters.
[0025] In the above working process, the redundant machine synchronously transmits system running data to the monitoring machine;
[0026] Meanwhile, the monitoring machine reads the CPU program state of the main control machine at a certain period, that is, monitors the CPU running state and the user program running state of the main control machine:
[0027] If the main control machine does not recover to normal, the monitoring machine keeps the current working flag signal unchanged and continues to execute the working process of S4;
[0028] When the monitoring machine finds that the CPU running state and the user program running state of the main control machine both recover to normal, the monitoring machine screen appears a prompt, and after the operator confirms on the HMI, S5 is entered;
[0029] S5, switching reset of the redundant machine:
[0030] The monitoring machine synchronously transmits the received system running data of the redundant machine to the main control machine, and the main control machine runs a system synchronization program to synchronously backup the real-time running data of the redundant machine. At this time, the main control machine is in a hot standby state;
[0031] The monitoring machine reads the CPU program state of the main control machine at a certain period, and when it is determined that the main control machine is in a hot standby state, the monitoring machine modifies the working flag signal to be: main control machine working state and redundant machine non-working state. At this time, the redundant machine exits the working state and turns to run a hot standby standby program;
[0032] The main control machine refreshes data of a specified unit according to the system synchronization data related parameters received by it, at this time, the main control machine continues the working process of the redundant machine to continue working, realizes non-disturbance switching of the system, and enters S2.
[0033] In S4, the monitoring machine reads the CPU state and the program state of the redundant machine at a certain period, analyzes the CPU running state and the user program running state of the redundant machine; meanwhile, the monitoring machine reads the CPU program state of the main control machine at a certain period, monitors the CPU running state and the user program running state of the main control machine:
[0034] If the main control machine does not recover to normal, when it is found that the CPU running state and the user program running state of the redundant machine are both normal, the monitoring machine keeps the current working flag signal unchanged and continues to execute the working process of S4;
[0035] If the main control machine does not recover to normal, when the CPU running state or the user program running state of the redundant machine is found to be wrong, the monitoring machine screen appears an alarm prompt, and the monitoring machine also sets the redundant machine to be in a non-working state, that is, at this time, the redundant machine exits the working state. At this time, the main control machine is in a non-working state, the redundant machine is also in a non-working state, and the system stops running;
[0036] When the monitor detects that the CPU running state and the user program running state of the host are both normal, the monitor screen appears a prompt, and after the operation personnel confirms on the HMI, then it enters S5.
[0037] Compared with the prior art, the application has the following beneficial effects:
[0038] 1. The small PLC CPU soft redundancy system construction method uses small PLC for redundancy construction, effectively improves the reliability of the small PLC control system, solves the problem that the small PLC cannot be applied to important control occasions due to low reliability, and enables the small PLC to be applied to high-reliability control occasions on the premise of meeting control functions, especially for scenes with small installation space, low energy consumption requirement and high reliability requirement, and the application advantage of the small PLC with redundancy function is more embodied. For the specific occasions where PLCs above medium size cannot be used, the small PLC redundancy system constructed by the method can meet the above requirements. Therefore, the design can improve the reliability of the small PLC control system, reduce the system construction cost, and adapt to the application requirements of special environments.
[0039] 2. The small PLC CPU soft redundancy system construction method adopts two small PLCs and a monitor for soft redundancy control, the monitor acts as an intermediate bridge for information exchange between the two small PLCs, and is also a system state collector, judge and decision maker, effectively solving the problems of weak function of the small PLC itself and lack of redundancy software modules. Through the monitor, the disturbance-free automatic switching of the working states of the small PLCs is effectively solved, and the overall operation of the system is comprehensively controlled.
[0040] 3. In the small PLC CPU soft redundancy system construction method, the system running data transmission and storage adopts an asymmetric data transmission and storage mode. When the master machine is in the working state and the redundant machine is in the non-working state, the system running data of the master machine is directly sent to the redundant machine; when the master machine is in the non-working state and the redundant machine is in the working state, the system running data of the redundant machine is sent to the monitor. Conditions are created for offline inspection, maintenance and replacement of the master machine.
[0041] 4. In the small PLC CPU soft redundancy system construction method, the system running data is transmitted and saved between the system synchronous data storage units of the master machine, the redundant machine and the monitor according to different conditions, ensuring that the system control state and process are always tracked. The system running data includes control given data, control loop output data, controller parameters, etc. When the PLC CPU performs redundancy switching, the system running data is used to refresh the related control units of the PLC to be put into the working state, so as to realize disturbance-free PLC system switching and improve the stability of system switching. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1 is a schematic diagram of the redundant control system topology of the present application.
[0043] Figure 2 is a schematic diagram of the redundant control system operation.
[0044] Figure 3 is a S7-200 Smart PLC bus control network diagram of embodiment 3 of the present application.
[0045] Figure 4 is a PLC inter-station communication active / passive connection relationship diagram of embodiment 3 of the present application.
[0046] In the figure: host computer 1, redundant computer 2, monitoring computer 3. DETAILED DESCRIPTION
[0047] The present application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] Referring to Figures 1 to 2 A small PLC CPU soft redundancy system construction method, the construction method is based on the following structure: including: host computer 1, redundant computer 2 and monitoring computer 3, the host computer 1, redundant computer 2 and monitoring computer 3 are connected through industrial Ethernet, the controlled equipment is connected with the host computer 1 and the redundant computer 2 through the network at the same time, the host computer 1 and the redundant computer 2 are the same type small PLC;
[0049] The small PLC CPU soft redundancy system construction method comprises the following steps:
[0050] S1, device startup: after the device starts running, the host computer 1, the redundant computer 2 and the monitoring computer 3 are all in the initial startup state, at this time the monitoring computer 3 initializes the working flag of the host computer 1 and the redundant computer 2, the host computer 1 is in working state and the redundant computer 2 is in non-working state; the monitoring computer 3 transmits the initial value of the working flag to the host computer 1 and the redundant computer 2 respectively;
[0051] After the host computer 1 starts, the working flag signal received is in working state, the host computer 1 starts the normal running program and synchronously transmits the system running data to the redundant computer 2;
[0052] After the redundant computer 2 starts, the working flag signal received is in non-working state, the redundant computer 2 starts running the hot standby standby program and synchronously backs up the real-time running data of the host computer 1, at this time the redundant computer 2 is in hot standby state; enter S2;
[0053] S2, program running of the host computer and monitoring:
[0054] The main control machine 1 normally runs a working program, the monitoring machine 3 reads real-time I / O running data of the main control machine 1 and processes the data to obtain corresponding control parameters as given to the main control machine 1, and the main control machine 1 continues to run its control program according to the received control parameters;
[0055] In the above working process, the main control machine 1 synchronously transmits system running data to the redundant machine 2, the redundant machine 2 runs a hot standby program and synchronously backs up real-time running data of the main control machine 1, and at this time, the redundant machine 2 is in a hot standby state;
[0056] Meanwhile, the monitoring machine 3 reads CPU states and program states of the main control machine 1 at a certain period to analyze CPU running states and user program running states of the main control machine 1;
[0057] When it is found that both the CPU running states and the user program running states are normal, the monitoring machine 3 keeps the current working flag signal unchanged and continues to execute the working process of S2;
[0058] When it is found that the CPU running states or the user program running states are abnormal, S3 is entered;
[0059] S3, switching of the main control machine and the redundant machine:
[0060] When it is found that the CPU running states or the user program running states of the main control machine 1 are abnormal, the monitoring machine 3 modifies the working flag signal as: the main control machine 1 is in a non-working state and the redundant machine 2 is in a working state; at this time, the main control machine 1 exits and is in an offline state, the redundant machine 2 refreshes data of specified units according to the received system synchronous data related parameters, the redundant machine 2 continues to work by following the working process of the main control machine 1, the non-disturbance switching of the system is realized, and S4 is entered;
[0061] S4, program running and monitoring of the redundant machine:
[0062] The redundant machine 2 normally runs a working program, the monitoring machine 3 reads real-time I / O running data of the redundant machine 2 and processes the data to obtain corresponding control parameters as given to the redundant machine 2, and the redundant machine 2 continues to run its working program according to the received control parameters;
[0063] In the above working process, the redundant machine 2 synchronously transmits system running data to the monitoring machine 3;
[0064] Meanwhile, the monitoring machine 3 reads CPU program states of the main control machine 1 at a certain period, that is, monitors CPU running states and user program running states of the main control machine 1;
[0065] If the main control machine 1 is not restored to normal, the monitoring machine 3 keeps the current working flag signal unchanged and continues to execute the working process of S4;
[0066] When the monitor 3 finds that the CPU running state and the user program running state of the host computer 1 are both normal, the monitor 3 screen appears a prompt, and after the operation personnel confirms in the HMI, S5 is entered;
[0067] S5, switching reset of the redundancy machine:
[0068] The monitor 3 synchronously transmits the received system running data of the redundancy machine 2 to the host computer 1, the host computer 1 runs a system synchronization program to synchronously backup the real-time running data of the redundancy machine 2, and at this time, the host computer 1 is in a hot standby state;
[0069] The monitor 3 reads the CPU program state of the host computer 1 at a certain period, and when it is determined that the host computer 1 is in a hot standby state, the monitor 3 modifies a working flag signal to be: the host computer 1 working state and the redundancy machine 2 non-working state; at this time, the redundancy machine 2 exits the working state and turns to run a hot standby standby program.
[0070] The host computer 1 refreshes data of a specified unit according to the system synchronization data related parameters received by the host computer 1, at this time, the host computer 1 continues to work in succession with the working process of the redundancy machine 2, realizes non-disturbance switching of the system, and enters S2.
[0071] In the S4, the monitor 3 reads the CPU state and the program state of the redundancy machine 2 at a certain period, analyzes the CPU running state and the user program running state of the redundancy machine 2; at the same time, the monitor 3 reads the CPU program state of the host computer 1 at a certain period, and listens to the CPU running state and the user program running state of the host computer 1:
[0072] If the host computer 1 is not normal, when it is found that the CPU running state and the user program running state of the redundancy machine 2 are both normal, the monitor 3 keeps the current working flag signal unchanged, and continues to execute the working process of S4;
[0073] If the host computer 1 is not normal, when the CPU running state or the user program running state of the redundancy machine 2 is found to be wrong, the monitor 3 screen appears an alarm prompt, and at the same time, the monitor 3 also sets the redundancy machine 2 to be in a non-working state, that is, at this time, the redundancy machine 2 exits the working state; at this time, the host computer 1 is in a non-working state, the redundancy machine 2 is also in a non-working state, and the system stops running;
[0074] When the monitor 3 detects that the CPU running state and the user program running state of the host computer 1 are both normal, the monitor 3 screen appears a prompt, and after the operation personnel confirms in the HMI, S5 is entered.
[0075] The principle of the application is as follows:
[0076] For small PLC, due to its low price, through the appropriate IO expansion, its application range is greatly enhanced. Compared with large and medium-sized PLC, since small PLC itself does not have (hard / soft) redundancy function, in some important control occasions, even if small PLC can meet the demand of executing control task, people still have to give up it, and select large and medium-sized PLC with redundancy control function. This limits the use range of small PLC, and also increases the cost of system equipment. For some important control occasions with special requirements of device volume and energy consumption, if small PLC has redundancy function, using small PLC as system controller is undoubtedly the best choice.
[0077] Embodiment 1:
[0078] A small PLC CPU soft redundancy system construction method, the construction method is based on the following structure: including: host computer 1, redundancy machine 2 and monitoring machine 3, the host computer 1, redundancy machine 2 and monitoring machine 3 are connected through industrial Ethernet, and the controlled equipment is connected with the host computer 1 and the redundancy machine 2 through network at the same time, the host computer 1 and the redundancy machine 2 are the same type small PLC;
[0079] The small PLC CPU soft redundancy system construction method comprises the following steps:
[0080] S1, device startup: after the device starts running, the host computer 1, the redundancy machine 2 and the monitoring machine 3 are in initial startup state, at this time, the monitoring machine 3 initializes the working mark of the host computer 1 and the redundancy machine 2, the working state of the host computer 1 and the non-working state of the redundancy machine 2; the monitoring machine 3 transmits the initial value of the working mark to the host computer 1 and the redundancy machine 2 respectively;
[0081] After the host computer 1 starts, the working mark signal received is working state, the host computer 1 starts normal running work program, and synchronously transmits system running data to the redundancy machine 2;
[0082] After the redundancy machine 2 starts, the working mark signal received is non-working state, the redundancy machine 2 starts to run hot standby standby program, and synchronously backs up the real-time running data of the host computer 1, at this time, the redundancy machine 2 is in hot standby state; enter S2;
[0083] S2, program running of host computer and monitoring:
[0084] The host computer 1 normally runs work program, the monitoring machine 3 reads the real-time I / O running data of the host computer 1, and processes it to obtain corresponding control parameters as given to the host computer 1, and the host computer 1 continues to run its control program according to the received control parameters;
[0085] In the above working process, the main control machine 1 synchronously transmits system running data to the redundancy machine 2, the redundancy machine 2 runs a hot standby program, and synchronously backs up the real-time running data of the main control machine 1, at this time, the redundancy machine 2 is in a hot standby state;
[0086] Meanwhile, the monitoring machine 3 reads the CPU state and program state of the main control machine 1 at a certain period, analyzes the CPU running state and user program running state of the main control machine 1:
[0087] When it is found that both the CPU running state and the user program running state are normal, the monitoring machine 3 keeps the current working flag signal unchanged, and continues to execute the working process of S2;
[0088] When it is found that the CPU running state or the user program running state is abnormal, S3 is entered;
[0089] S3, switching of the main control machine and the redundancy machine:
[0090] When it is found that the CPU running state or the user program running state of the main control machine 1 is abnormal, the monitoring machine 3 modifies the working flag signal as: the main control machine 1 is in a non-working state, and the redundancy machine 2 is in a working state; at this time, the main control machine 1 exits and is in an offline state, the redundancy machine 2 refreshes the data of the specified unit according to the system synchronous data related parameters received by it, at this time, the redundancy machine 2 continues to work by following the working process of the main control machine 1, realizes the non-disturbance switching of the system, and enters S4;
[0091] S4, program running and monitoring of the redundancy machine:
[0092] The redundancy machine 2 normally runs the working program, the monitoring machine 3 reads the real-time I / O running data of the redundancy machine 2, processes it, obtains the corresponding control parameters, and sends them to the redundancy machine 2 as given, and the redundancy machine 2 continues to run the working program according to the received control parameters;
[0093] In the above working process, the redundancy machine 2 synchronously transmits system running data to the monitoring machine 3;
[0094] Meanwhile, the monitoring machine 3 reads the CPU program state of the main control machine 1 at a certain period, that is, monitors the CPU running state and user program running state of the main control machine 1:
[0095] If the main control machine 1 has not recovered to normal, the monitoring machine 3 keeps the current working flag signal unchanged, and continues to execute the working process of S4;
[0096] When the monitoring machine 3 finds that both the CPU running state and the user program running state of the main control machine 1 have recovered to normal, the monitoring machine 3 appears a prompt on the screen, and after the operation personnel confirms on the HMI, S5 is entered;
[0097] S5, switching reset of the redundancy machine:
[0098] The monitoring machine 3 transmits the received system running data of the redundant machine 2 to the host machine 1, and the host machine 1 runs a system synchronization program to synchronize the real-time running data of the redundant machine 2, at this time, the host machine 1 is in a hot standby state;
[0099] The monitoring machine 3 reads the CPU program state of the host machine 1 at a certain period, and when it is determined that the host machine 1 is in a hot standby state, the monitoring machine 3 modifies the working flag signal to: the host machine 1 working state, the redundant machine 2 non-working state; at this time, the redundant machine 2 exits the working state and runs a hot standby standby program.
[0100] The host machine 1 refreshes the data of the specified unit according to the system synchronization data related parameters received by it, at this time, the host machine 1 continues to work with the working process of the redundant machine 2, realizes the non-disturbance switching of the system, and enters S2.
[0101] Embodiment 2:
[0102] Embodiment 2 is basically the same as embodiment 1, and the difference is that:
[0103] As shown in Figure 3 , the system device is composed of three parts: a host room controller, an industrial Ethernet, and a field controller.
[0104] The host room controller communicates with the field controller through the industrial Ethernet, realizes parameter setting, modification and control instruction issuing of the field controller, and at the same time, acquires the field parameters collected by the field controller, so as to save and analyze the field data, so as to make the system make control decisions, and make the field controller always work in an ideal state. The host room device includes two SR30 small PLCs (called master stations) and a monitoring machine. In order to ensure the reliable operation of the master station, the master station adopts a redundant working mode, that is, one is used and one is reserved, one of which runs in a control working mode (called PLC master station), and the other works in a standby mode (called PLC redundant station); the field control device includes four SR20s (called 1# slave station---4# slave station), which execute the control tasks issued by the master station, output control signals, and collect field signals.
[0105] Implementation of redundant control system signal transmission: S7-200 SMART CPU uses GET / PUT instruction to realize Ethernet communication between S7-200 SMART CPUs. One S7-200 SMART CPU Ethernet port has 8 GET / PUT active connection resources and 8 GET / PUT passive connection resources. The 1# PLC slave station to the 4# PLC slave station are set to passive connection, the PLC master station and the PLC redundant station are set to active connection; relative to the PLC master station, the PLC redundant station is also set to passive connection. The active / passive connection relationship between the six PLC CPU stations is as shown in Figure 4 .
[0106] In the S4, the monitoring machine 3 reads the CPU state and program state of the redundant machine 2 at a certain period, analyzes the CPU running state and user program running state of the redundant machine 2; at the same time, the monitoring machine 3 reads the CPU program state of the master control machine 1 at a certain period, and listens to the CPU running state and user program running state of the master control machine 1:
[0107] If the master control machine 1 does not recover to normal, when it is found that the CPU running state and user program running state of the redundant machine 2 are both normal, the monitoring machine 3 keeps the current working flag signal unchanged, and continues to execute the working process of S4;
[0108] If the master control machine 1 does not recover to normal, when the CPU running state or user program running state of the redundant machine 2 is abnormal, the monitoring machine 3 screen appears an alarm prompt, and the monitoring machine 3 also sets the redundant machine 2 to non-working state, that is, the redundant machine 2 exits the working state at this time; at this time, the master control machine 1 is in non-working state, the redundant machine 2 is also in non-working state, and the system stops running;
[0109] When the monitoring machine 3 detects that the CPU running state and user program running state of the master control machine 1 are both normal, the monitoring machine 3 screen appears a prompt, and after the operator confirms on the HMI, S5 is entered.
[0110] Example 3
[0111] The redundant control system of the application is composed of three parts: a master control room controller, an industrial Ethernet and a field controller. A small PLC uses Siemens S7-200 SMART CPU, one SR30 master control machine 1, one SR30 redundant machine 2 and a monitoring machine 3 form an upper computer, and four small PLC SR20s form a lower computer. The control network diagram is as shown in Figure 3 .
[0112] The host PLC is in redundant working mode, i.e. one active and one standby, one of which is in control mode (called PLC master station) and the other is in standby mode (called PLC redundant station). The field control devices include four small PLCs SR20 (called 1# slave station to 4# slave station), which execute the control tasks sent by the master station, output control signals and collect field signals.
[0113] The GET / PUT communication instruction is used to realize the Ethernet communication between the PLC CPUs. The 1# PLC slave station to 4# PLC slave station are set to passive connection communication mode, the PLC master station and the PLC redundant station are set to active connection communication mode, and the PLC redundant station (called redundant station 2) is set to passive connection communication mode relative to the PLC master station (called master station 1). The active / passive connection relationship between the six PLC CPU stations is shown in Figure 4
[0114] The monitoring station 3 reads the running state of the master station 1 CPU / redundant station 2 CPU and the user program running state of the master station 1 / redundant station 2, analyzes the CPU running state and the user program running state, sets the working (switching) flag of the master station 1 / redundant station 2 according to the analysis result, and realizes the small PLC S7-200 SMART CPU soft redundancy function.
[0115] The monitoring station 3 connects the master station 1 and the redundant station 2 through the communication network, realizes the information exchange between the master station 1 and the redundant station 2. If the master station 1 runs normally, the master station 1 runs in working state and the redundant station 2 runs in hot standby state. If the master station 1 runs abnormally, the redundant station 2 runs in working state and the master station 1 exits the running state and is in offline state (or quasi-hot standby state) for waiting for processing. Once the master station 1 recovers normally, the master station 1 is reconnected through the HMI (human-machine interface) of the monitoring station 3, so that the master station 1 runs in working state, the redundant station 2 runs in hot standby state, and the master station 1 / redundant station 2 runs in the original state.
[0116] The monitoring station 3 reads the running state from the CPU diagnostic alarm register SMW100 of the master station 1 / redundant station 2; checks whether the communication data is normal according to the GET / PUT TABLE parameter error code; judges whether the user program is executed normally according to the program running self-check signal. According to the above three signals, whether the master station 1 / redundant station 2 runs normally is analyzed, and the working (switching) flag of the master station 1 / redundant station 2 is set according to the analysis result.
[0117] The monitoring station 3 reads the I / O data of the 1# PLC to 4# PLC slave stations of the working state PLC, obtains the corresponding control parameters through operation, and sends the control parameters to the PLC in working state.
[0118] When the redundant machine 2 runs in the working state, the monitoring machine 3 reads the system running data of the redundant machine 2.
[0119] When the main control machine 1 runs in the working state, the PLC runs the redundant user program, the system running data (control parameter set value, output parameter value, etc.) thereof is sent to the system synchronous data unit of the redundant machine 2, the 1# PLC-4# PLC slave station I / O data is sent to the I / O running data unit of the monitoring machine 3, and the PLC CPU running state and the user program running state are sent to the monitoring machine 3.
[0120] When the monitoring machine 3 judges that the main control machine 1 is abnormal and switches the redundant machine 2 to run in the working state, the main control machine 1 runs in the non-working state (quasi-hot standby state).
[0121] The redundant machine 2 judges the change of the working flag by itself, enters the working state, and at the same time, refreshes the data of the system synchronous data related parameters to the designated unit (such as set value and output value), so as to realize the non-disturbance switching of the main PLC and the redundant PLC. The PLC runs the redundant user program, the system running data thereof is sent to the system synchronous data unit of the monitoring machine 3, the 1# PLC-4# PLC slave station I / O data is sent to the I / O running data unit of the monitoring machine 3 through the redundant machine 2, and the PLC CPU running state and the user program running state are sent to the monitoring machine 3.
[0122] When the redundant machine 2 runs in the hot standby state, the system synchronous data sent by the main control machine 1 is received. The PLC CPU running state and the user program running state are sent to the monitoring machine 3.
[0123] When the main control machine 1 runs from the non-working state (quasi-hot standby state) to the working state, the monitoring machine 3 sends the main control machine 1 running state switching instruction through the HMI, sends the working flag to the main control machine 1, and transmits the system running data to the synchronous data unit of the main control machine 1. The monitoring machine 3 sends the non-working flag (redundant working flag) to the redundant machine 2, completes the transition of the main control machine 1 to the working state, and the main control machine 1 and the redundant machine 2 run in the original state respectively.
[0124] When the main control machine 1 runs from the non-working state (quasi-hot standby state) to the working state, the main control machine 1 judges the change of the working flag by itself, enters the working state, and at the same time, refreshes the data of the system synchronous data related parameters to the designated unit (such as set value and output value), so as to realize the non-disturbance switching of the main PLC and the redundant PLC. The main control machine 1 runs the redundant user program, the system running data thereof is sent to the system synchronous data unit of the redundant machine 2, the 1# PLC-4# PLC slave station I / O data is sent to the I / O running data unit of the monitoring machine 3 through the main control machine 1, and the PLC CPU running state and the user program running state are sent to the monitoring machine 3.
Claims
1. A small PLC CPU soft redundancy system construction method, characterized in that: the construction method is based on a structure comprising a host computer, a redundant computer and a monitoring computer, the host computer, the redundant computer and the monitoring computer are connected through an industrial Ethernet, and a controlled device is connected with the host computer and the redundant computer through a network; the host computer and the redundant computer are small PLCs of the same type; the small PLC CPU soft redundancy system construction method comprises the following steps: S1, device startup: after the device is started, the host computer, the redundant computer and the monitoring computer are in an initial startup state, at this time, the monitoring computer initializes the working flags of the host computer and the redundant computer, the host computer is in a working state and the redundant computer is in a non-working state; the monitoring computer transmits the initial values of the working flags to the host computer and the redundant computer respectively; after the host computer is started, the working flag signal received by the host computer is in a working state, the host computer starts a normal work program and synchronously transmits system running data to the redundant computer; after the redundant computer is started, the working flag signal received by the redundant computer is in a non-working state, the redundant computer starts a hot standby standby program, synchronously backs up real-time running data of the host computer, at this time, the redundant computer is in a hot standby state; enter S2; S2, program running of the host computer and monitoring: the host computer normally runs a work program, the monitoring computer reads real-time I / O running data of the host computer and processes the real-time I / O running data to obtain corresponding control parameters as given to the host computer, and the host computer continues to run its control program according to the received control parameters; in the working process of the above step S2, the host computer synchronously transmits system running data to the redundant computer, the redundant computer runs a hot standby standby program, synchronously backs up real-time running data of the host computer, at this time, the redundant computer is in a hot standby state; at the same time, the monitoring computer reads CPU states and program states of the host computer at a certain period, analyzes CPU running states and user program running states of the host computer: when it is found that the CPU running states and the user program running states are both normal, the monitoring computer keeps the current working flag signal unchanged and continues to execute the working process of S2; when it is found that the CPU running states or the user program running states are abnormal, enter S3 S3, switching of the host computer and the redundant computer: when it is found that the CPU running states or the user program running states of the host computer are abnormal, the monitoring computer modifies the working flag signal to be: the host computer is in a non-working state and the redundant computer is in a working state; at this time, the host computer exits and is in an offline state, the redundant computer refreshes data of a specified unit according to the system synchronization data related parameters received by the redundant computer, at this time, the redundant computer continues to work by continuing the work process of the host computer, realizes non-disturbance switching of the system and enters S4; S4, program running of the redundant computer and monitoring: the redundant computer normally runs a work program, the monitoring computer reads real-time I / O running data of the redundant computer and processes the real-time I / O running data to obtain corresponding control parameters as given to the redundant computer, and the redundant computer continues to run its work program according to the received control parameters; in the working process of the above step S4, the redundant computer synchronously transmits system running data to the monitoring computer; The monitoring machine reads the CPU program state of the host computer at a certain period, i.e. monitors the CPU running state and the user program running state of the host computer: If the host computer is not recovered, the monitoring machine keeps the current working flag signal unchanged and continues to execute the working procedure of S4; When the monitoring machine finds that the CPU running state and the user program running state of the host computer are both recovered, the monitoring machine screen appears a prompt, and after the operation personnel confirms on the HMI, S5 is entered; S5, switching reset of the redundant machine: The monitoring machine synchronously transmits the received system running data of the redundant machine to the host computer, the host computer runs a system synchronization program to synchronously backup the real-time running data of the redundant machine, and at this time, the host computer is in a hot standby state; The monitoring machine reads the CPU program state of the host computer at a certain period, and when it is determined that the host computer is in the hot standby state, the monitoring machine modifies the working flag signal to be: the host computer working state and the redundant machine non-working state; at this time, the redundant machine exits the working state and turns to run a hot standby standby program; The host computer refreshes the data of the specified unit according to the system synchronization data related parameters received by it, at this time, the host computer continues the working process of the redundant machine to continue working, realizes the non-disturbance switching of the system, and enters S2.
2. The small PLC CPU soft redundancy system construction method according to claim 1, characterized in that: In S4, the monitoring machine reads the CPU state and the program state of the redundant machine at a certain period, analyzes the CPU running state and the user program running state of the redundant machine, and at the same time, reads the CPU program state of the host computer at a certain period, monitors the CPU running state and the user program running state of the host computer: If the host computer is not recovered, when it is found that the CPU running state and the user program running state of the redundant machine are both normal, the monitoring machine keeps the current working flag signal unchanged and continues to execute the working procedure of S4; If the host computer is not recovered, when the CPU running state or the user program running state of the redundant machine is found to be abnormal, the monitoring machine screen appears an alarm prompt, and at the same time, the monitoring machine sets the redundant machine to be in a non-working state, i.e. at this time, the redundant machine exits the working state; at this time, the host computer is in a non-working state, the redundant machine is also in a non-working state, and the system stops running; When the monitoring machine detects that the CPU running state and the user program running state of the host computer are both recovered, the monitoring machine screen appears a prompt, and after the operation personnel confirms on the HMI, S5 is entered.
Citation Information
Patent Citations
MAC-based PLC dual-redundant method and MAC-based PLC dual-redundant system
CN106647613A
PLC duplex redundant system based on MAC
CN207367033U