Central processing unit, control method and computer readable recording medium

By setting the waiting time according to the CPU unit processing capacity ratio, the problem of misjudgment and switching delay caused by changes in the CPU unit processing capacity in the PLC is solved, and accurate synchronous inspection processing under different processing capabilities is achieved.

CN112534411BActive Publication Date: 2024-10-15OMRON CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980051961.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-09-25
Filing Date
2019-09-17
Publication Date
2024-10-15
Estimated Expiration
2039-09-17

AI Technical Summary

Technical Problem

In the prior art, the duplexed CPU unit in the PLC has misjudgment and switching delay problems caused by changes in processing capabilities. Especially when the processing capabilities of the CPU unit change after hardware updates, the synchronization check process cannot be performed correctly.

Method used

Set the waiting time according to the processing capacity ratio of the own unit and the counterpart CPU unit. If the completion of processing of the counterpart CPU unit cannot be confirmed within the set time, it will be determined as an abnormality.

Benefits of technology

It achieves accurate synchronous inspection processing under different processing capabilities, avoiding misjudgments and switching delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112534411B_ABST
    Figure CN112534411B_ABST
Patent Text Reader

Abstract

The present invention relates to a central processing unit (CPU) unit, a control method and a computer-readable recording medium. Even when the processing capabilities of duplexed CPU units in a PLC are different from each other, misjudgment related to synchronization can be prevented. A first CPU unit (100A) sets a waiting time (Tw) for synchronization check processing in consideration of the ratio of the performance (Abm) of its own unit to the performance (Aby) of a second CPU unit (100B).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a duplexed central processing unit (CPU) unit in a controller, a control method, a computer-readable recording medium, and the like. Background Art

[0002] In the past, regarding programmable logic controllers (PLCs), there are known structures for duplexing CPU units in order to improve the safety and reliability of the system. For example, the following patent document 1 discloses a structure: before the start of duplex operation, the CPU unit of the execution system obtains the unit version of the CPU unit of the standby system, and compares it with the function version stored in its own storage. If the unit version is higher than the function version, it is determined that duplex operation can be performed. Figure 8 and Fig. 9 The following describes conventional duplexing of a CPU unit in a PLC.

[0003] Figure 8 FIG. 1 is a diagram for explaining the outline of conventional processing by a duplexed CPU unit in a PLC. Figure 8 As shown in the example, the duplexed CPU units in the PLC each repeatedly perform self-diagnosis processing, command execution processing, and I / O refresh processing in sequence. The period from the execution of the I / O refresh processing to the execution of the next I / O refresh processing is also called "1 cycle (1 period)". That is, the duplexed CPU units in the PLC each perform self-diagnosis processing, command execution processing, and I / O refresh processing in sequence in "1 cycle (1 period)". The period required for "1 cycle" (that is, the period from the execution of the I / O refresh processing to the execution of the next I / O refresh) is also called "cycle time".

[0004] The self-diagnosis process is a process for diagnosing whether the hardware of the unit itself is operating normally, especially whether there are any abnormalities in the memory and hard disk. The command execution process is a process for executing the user program, etc., and is a process for performing various operations using the data obtained in the I / O refresh process executed in the previous cycle to generate data output in the I / O refresh process of the current cycle. The I / O refresh process is a process for performing data exchange with external devices and external units other than the duplexed partner CPU unit, and is a process for outputting the data generated in the previous command execution process and obtaining data used in the command execution process of the next cycle.

[0005] In the PLC, one of the duplexed CPU units is set as the execution system, and the other is set as the standby system (STB), and the states of the duplexed counterpart CPU units are confirmed. Furthermore, when the CPU unit of the execution system is shut down, the CPU unit of the standby system is switched to the shut down CPU unit of the execution system and continues to operate. Hereinafter, the CPU unit set as the execution system is sometimes referred to as "ACT", and the CPU unit set as the standby system is sometimes referred to as "STB".

[0006] In order to smoothly switch from ACT to STB when ACT is shut down, ACT and STB should be connected as follows: Figure 8 As shown in FIG. 1 , synchronization is achieved in the middle of the internal processing of each CPU unit. That is, ACT and STB each confirm that no abnormality has occurred in the duplexed counterpart unit when their own units have completed the execution of the self-diagnosis processing, command execution processing, and I / O refresh processing. The "confirmation processing that no abnormality has occurred in the duplexed counterpart unit" executed when their own units have completed the execution of the self-diagnosis processing, command execution processing, and I / O refresh processing is also called "synchronization check processing."

[0007] By achieving synchronization in the middle of the internal processing, the cycle of each CPU unit (more precisely, the start time of the internal processing of each CPU unit) will not deviate, and the duplexed CPU units can execute the same processing at the same time. ACT and STB each perform a synchronization check process at the time point when the self-diagnosis process, command execution process, and I / O refresh process are completed, and after confirming the synchronization (that is, no abnormality occurs in the other unit), the execution of the next process begins. Therefore, ACT and STB can each start the execution of the self-diagnosis process, command execution process, and I / O refresh process at the same time.

[0008] Basically, in the synchronization check process, the ACT and the STB each monitor (in other words, confirm) the status of the other party. If the ACT stops abnormally, the STB replaces the abnormally stopped ACT and continues to operate.

[0009] Here, assuming the situation that "ACT or STB cannot detect the abnormality of the synchronization object (i.e., the other party's CPU unit through duplexing) (especially ACT cannot detect the abnormality of STB)", ACT and STB each perform the synchronization check process as follows. That is, when ACT and STB each fail to obtain the response of the other party's CPU unit within the prescribed period in each synchronization check process, it is determined that "an abnormality has occurred in the other party's CPU unit through duplexing (i.e., a synchronization error has occurred)". Specifically, when ACT and STB each fail to obtain a notification to the effect that "the execution of the corresponding processing has been completed" from the other party's CPU unit within the determination period in each synchronization check process, it is determined that "an abnormality has occurred in the other party's CPU unit through duplexing".

[0010] When it is determined that "an abnormality has occurred in the counterpart CPU unit through duplexing", ACT and STB each execute the process of "releasing duplexing". By "releasing duplexing", ACT and STB each prevent "the cycle time from becoming extremely long due to maintaining synchronization with the counterpart CPU unit in which an abnormality has occurred". If duplexing is not released, that is, if "the execution of the next process is not started before it can be confirmed that an abnormality has not occurred in the counterpart unit", when an abnormality occurs in the counterpart CPU unit, it is impossible to confirm that "an abnormality has not occurred in the counterpart unit". Therefore, the execution of the next process cannot be started, and the cycle time becomes extremely long.

[0011] Fig. 9 The figure is a diagram for explaining the details of the synchronization check processing performed at the time point when the self-diagnosis processing, the command execution processing and the I / O refresh processing are each completed. As mentioned above, in the synchronization check processing, the ACT and the STB each confirm whether a notification indicating that "the execution of the corresponding processing has been completed" has been obtained from the other CPU unit within the determination period.

[0012] The synchronization check process can be realized, for example, by setting registers (shared registers) that can be read and written by each CPU unit in the duplex CPU unit (i.e., ACT and STB) inside or outside each other in the PLC. Each CPU unit writes the meaning of "the execution of the process has been completed by the own unit" into the shared register at the time point when the process up to the synchronization check process has been completed, that is, at the time point when the self-diagnosis process, the command execution process, and the I / O refresh process have been completed. Each CPU unit confirms that the other CPU unit has completed the execution of the process by reading the meaning of "the execution of the process has been completed by the own unit" written into the shared register by the other CPU unit.

[0013] That is, Fig. 9As illustrated, when the CPU unit 99P completes the processing, that is, when the execution of the processing is completed, it writes the completion of the processing to REG1 of the shared register 98 (that is, the meaning of "the execution of the processing by the own unit"). The CPU unit 99Q recognizes that the CPU unit 99P has completed the processing by reading REG1. Moreover, when the CPU unit 99Q completes the processing, that is, when the execution of the processing is completed, it writes the completion of the processing to REG2 of the shared register 98 (that is, the meaning of "the execution of the processing by the own unit"). The CPU unit 99P recognizes that the CPU unit 99Q has completed the processing by reading REG2. After the CPU unit 99P and the CPU unit 99Q recognize that the processing is completed, the CPU unit 99P and the CPU unit 99Q each transfer to the next processing.

[0014] In the case of adopting the synchronization check processing using the shared register 98, when an abnormality occurs in the other CPU unit, the other CPU unit does not write the meaning of "the own unit has completed the execution of the process" to the shared register 98. Therefore, each CPU unit waits for a predetermined period from the time when the own unit completes the execution of the process, and then determines whether the other CPU unit has written the meaning of "the own unit has completed the execution of the process" to the shared register 98. For example, if the meaning of "the own unit has completed the execution of the process" is not written to REG2 even after a predetermined period has passed since the time when the CPU unit 99P completes the execution of the process, the CPU unit 99P determines that an abnormality has occurred in the CPU unit 99Q. If the meaning of "the own unit has completed the execution of the process" is not written to REG1 even after a predetermined period has passed since the time when the CPU unit 99Q completes the execution of the process, the CPU unit 99Q determines that an abnormality has occurred in the CPU unit 99P. In the following description, the predetermined period from the time when each CPU unit completes the execution of the process until it is determined whether the other CPU unit has written the meaning of "the own unit has completed the execution of the process" is also referred to as "waiting time".

[0015] Prior art literature

[0016] Patent Literature

[0017] Patent Document 1: Japanese Patent Publication "Japanese Patent Application Publication No. 2005-122716" Summary of the invention

[0018] Problems to be solved by the invention

[0019] The above-mentioned prior art is based on the premise that the hardware of the duplexed CPU units in the PLC is substantially the same, that is, both have substantially the same processing capabilities, and therefore there is a problem that the processing capabilities of the two are different.

[0020] In the past, under the premise that the processing capabilities of the duplexed CPU units were roughly the same, each CPU unit determined that the other CPU unit was abnormal after a common "waiting time" in the duplexed CPU units had passed from the time when its own unit completed processing execution.

[0021] The reason why duplexed CPU units used a common "wait time" to perform synchronization check processing is as follows. That is, under the premise that the processing capabilities of the duplexed CPU units are the same, the time points when the duplexed CPU units complete the processing execution should be roughly the same. In other words, under the premise that the processing capabilities of the own unit and the other party's CPU unit are the same, the time point when the own unit completes the processing execution and the time point when the other party's CPU unit completes the processing execution should be roughly the same. Therefore, in each of the duplexed CPU units, the "wait time" used to determine the abnormality of the other party's CPU unit, that is, used for synchronization check processing, used to be a period that was common to the duplexed CPU units and had a fixed length.

[0022] However, the CPU unit is often used for a long period of time, such as more than about 20 years, and during this period, the CPU unit may be significantly updated (renewed) due to the discontinuation of production of parts used in the CPU unit, etc. In addition, for example, when the hardware of the CPU unit is significantly updated, the performance, that is, the processing capacity of the CPU unit may vary significantly before and after the update.

[0023] Furthermore, when duplexing the CPU unit before updating and the CPU unit after updating, if the "waiting time" for the synchronization check process is set to the same in the duplexed CPU units, the synchronization check process may not be correctly executed.

[0024] (Occurrence of misjudgment)

[0025] That is, even if the same processing is performed, since the time points of completion are different in the CPU unit before and after the update, if the judgment is performed after the common "waiting time", even if the other CPU unit is operating normally, it will be mistakenly judged as abnormal.

[0026] For example, if the processing capacity is quadrupled by an update compared to before the update, the period required to execute a certain process is about "10ms (milliseconds)" for the CPU unit after the update, while it is about "40ms" for the CPU unit before the update. Furthermore, if the "wait time" for the synchronization check process is fixed to "5ms" common to both the CPU unit before the update and the CPU unit after the update, the CPU unit after the update will make the following determination.

[0027] That is, the updated CPU unit determines whether it is synchronized, that is, determines whether the CPU unit before the update has completed the execution of the certain process, at the time point when "5ms" has passed from the time point when the CPU unit itself completed the execution of the certain process. However, if "30ms" has not passed from "the time point when the CPU unit after the update completed the execution of the certain process", the CPU unit before the update cannot complete the execution of the certain process. Therefore, the updated CPU unit cannot obtain the notification to the effect that "the CPU unit before the update has completed the execution of the certain process" from the CPU unit before the update at the time point when 5ms has passed from the time point when the CPU unit itself completed the execution of the certain process. Therefore, the updated CPU unit will mistakenly determine that "an abnormality has occurred in the CPU unit before the update (that is, a synchronization error has occurred)" even if the CPU unit before the update is operating normally.

[0028] (Determination of the occurrence of delay)

[0029] In the above example, by fixing the common “waiting time” of the CPU unit before updating and the CPU unit after updating to, for example, “30 ms”, it is possible to prevent erroneous determination by the CPU unit after updating.

[0030] That is, if "30ms" has passed from "the time point when the updated CPU unit completed the execution of the certain process", the CPU unit before the update can complete the execution of the certain process. Therefore, the updated CPU unit can correctly determine "whether an abnormality has occurred in the CPU unit before the update" as long as "30ms" has passed from the time point when the updated CPU unit completed the execution of the certain process.

[0031] However, the waiting time of "30ms" is common to the CPU unit before the update and the CPU unit after the update, so the CPU unit before the update makes the determination after "30ms" has passed since the time when the CPU unit itself completed the execution of the certain process. That is, the CPU unit before the update determines "whether an abnormality has occurred in the CPU unit after the update" after "30ms" has passed since the time when the CPU unit itself completed the execution of the certain process.

[0032] After the CPU unit before the update and the CPU unit after the update recognize that the processing of the other CPU unit is completed, they will move to the next processing. Therefore, if the waiting time of both is set to the common "30ms", the start of the execution of the next processing will be delayed. The CPU unit after the update determines that the other CPU unit is abnormal after "30ms" has passed from the time point when its own unit completed the execution of the certain processing, and then performs the abnormality judgment of the CPU unit before the update after the "30ms". That is, the CPU unit after the update cannot start the execution of the next processing unless "60ms" has passed from the time point when its own unit completed the execution of the certain processing. That is, if the waiting time used by the CPU unit before the update and the CPU unit after the update is set to the common "30ms" in accordance with the CPU unit before the update, the completion of the judgment of both will be delayed.

[0033] The CPU unit before the update will not perform the judgment unless "30ms" has passed since the unit completed the execution of the aforementioned processing. Therefore, if an abnormality occurs in the CPU unit after the update, the switch from ACT to STB for continued operation will be delayed.

[0034] As described above, in the prior art based on the premise that the duplexed CPU units in the PLC have substantially the same processing capabilities, when the duplexed CPU units have different processing capabilities, there is a problem of erroneous determination and delay in switching from ACT to STB.

[0035] Technical means of solving problems

[0036] In order to solve the above-mentioned problem, a CPU unit of one embodiment of the present invention is a duplexed CPU unit in a controller, and the CPU unit includes: a setting unit, which sets a waiting time by taking into account the ratio of the processing capacity of the own unit to the processing capacity of the other CPU unit via duplexing; and a determination unit, which determines that an abnormality has occurred in the other CPU unit if completion of the execution of the processing in the other CPU unit cannot be confirmed from the time point when the processing of the own unit is completed until the waiting time set by the setting unit has passed.

[0037] In order to solve the above-mentioned problem, a control method of one embodiment of the present invention is a control method of a duplexed CPU unit in a controller, the control method comprising: a setting step, setting a waiting time by considering the ratio of the processing capacity of the own unit to the processing capacity of the other CPU unit through duplexing; and a determination step, if the completion of the execution of the processing in the other CPU unit cannot be confirmed from the time point when the processing of the own unit is completed until the waiting time set in the setting step has passed, it is determined that an abnormality has occurred in the other CPU unit.

[0038] Effects of the Invention

[0039] According to one embodiment of the present invention, regarding the duplexed CPU unit in the PLC, the following effect is achieved, that is, considering the difference in processing capabilities between the duplexed counterpart CPU unit and its own unit, unnecessary waiting time will not be set, and synchronization check processing can be performed accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a block diagram showing the configuration of a main part such as a CPU unit according to the first embodiment of the present invention.

[0041] Figure 2 Yes Description Figure 1 The diagram shows an overview of the processing executed by each of the two CPU units shown.

[0042] Figure 3 Yes Description Figure 1 The diagram shows a specific example of a process in which each of the two CPU units acquires performance information indicating the performance of a duplexed counterpart CPU unit.

[0043] Figure 4 This is a block diagram showing the configuration of a main part such as a CPU unit according to a second embodiment of the present invention.

[0044] Figure 5 It means realization Figure 4 FIG. 1 is a diagram showing an example of a hardware configuration of a CPU unit.

[0045] Figure 6 Yes Description Figure 4 The diagram shows an overview of the processing executed by each of the two CPU units shown.

[0046] Figure 7 Yes Description Figure 4 The diagram shows a specific example of a process in which two CPU units each acquire performance information indicating the performance of a duplexed counterpart CPU unit.

[0047] Figure 8 This is a diagram for explaining an outline of conventional processing via a duplexed CPU unit in a PLC.

[0048] Fig. 9 The diagram explains the details of the synchronization check process executed at the time when the self-diagnosis process, the command execution process, and the I / O refresh process are each completed.

[0049] [Explanation of Symbols]

[0050] 10: PLC

[0051] 20: PLC

[0052] 100A: First CPU unit (CPU unit)

[0053] 100B: Second CPU unit (CPU unit)

[0054] 300A: First CPU unit (CPU unit)

[0055] 300B: Second CPU unit (CPU unit)

[0056] 160: Time setting unit (setting unit)

[0057] 360: Time setting unit (setting unit)

[0058] 170: Judgment Department

[0059] 370: Judgment Department

[0060] Ab: Performance (processing power)

[0061] Tw: Waiting time DETAILED DESCRIPTION

[0062] [Implementation method 1]

[0063] Hereinafter, an embodiment of one aspect of the present invention (hereinafter also referred to as "this embodiment") is described based on the accompanying drawings. In addition, the same symbols are marked for the same or corresponding parts in the figures, and their descriptions are not repeated. In each of the following embodiments, a programmable logic controller (PLC) 10 that controls a control object such as a machine or equipment is described as a typical example of a controller that performs duplexing on two CPU units.

[0064] In the following, first, in order to facilitate understanding of each of the first CPU unit 100A and the second CPU unit 100B in duplex in the PLC 10, Figure 2 The following describes an overview of the processing performed by each of them.

[0065] §1. Application examples

[0066] Figure 2 Instructions for use Figure 1The following is a diagram showing an overview of the processing performed by each of the two CPU units (i.e., the first CPU unit 100A and the second CPU unit 100B). The first CPU unit 100A and the second CPU unit 100B are duplexed in the PLC 10, one of which is the execution system (ACT) and the other is the standby system (STB), and they confirm the status of each other's CPU unit. When the CPU unit (ACT) of the execution system is shut down, the CPU unit (STB) of the standby system switches to ACT and continues to operate. Below, for ease of understanding, an example is described in which the first CPU unit 100A is ACT and the second CPU unit 100B is STB.

[0067] (Summary of waiting time)

[0068] like Figure 2 As shown, ACT and STB each repeatedly perform self-diagnosis processing, command execution processing and I / O refreshing processing in sequence. Hereinafter, the set of "self-diagnosis processing, command execution processing and I / O refreshing processing" repeatedly performed in sequence is referred to as "1 cycle".

[0069] The self-diagnosis process is a process for diagnosing whether the hardware of the unit itself is operating normally. The command execution process is a process for executing user programs, etc., and is a process for using the data obtained in the I / O refresh process executed in the previous cycle to perform various operations and generate data output in the I / O refresh process of the current cycle. In the command execution process, a control signal for the control object of the PLC 10 (more accurately, the first CPU unit 100A or the second CPU unit 100B), that is, an external device other than the other CPU unit, is generated. The I / O refresh process is a process for performing data exchange with external devices and external units other than the duplexed other CPU unit, and is a process for outputting the data generated in the command execution process of the current cycle and obtaining the data used in the command execution process of the next cycle. The control signal generated in the command execution process is output to the control object in the I / O refresh process.

[0070] like Figure 2 As shown in the figure, the ACT (first CPU unit 100A) and the STB (second CPU unit 100B) each perform a "synchronous check process" after completing the self-diagnosis process, the command execution process, and the I / O refresh process in their own units. In the synchronous check process, the ACT and the STB each monitor (in other words, confirm) the state of the other CPU unit. If the ACT stops abnormally, the STB replaces the abnormally stopped ACT and continues to operate.

[0071] "Synchronous check processing" is about the processing that has been completed by its own unit, and confirms whether the other CPU unit has also completed the processing as well as its own unit. If it cannot be confirmed that the processing of the other CPU unit has been completed, it is determined that an abnormality has occurred. For example, after ACT has completed the execution of self-diagnosis processing, command execution processing, and I / O refresh processing, it confirms (determines) whether STB has completed the execution of self-diagnosis processing, command execution processing, and I / O refresh processing. For example, after STB has completed the execution of self-diagnosis processing, command execution processing, and I / O refresh processing, it confirms (determines) whether ACT has completed the execution of self-diagnosis processing, command execution processing, and I / O refresh processing.

[0072] In the "synchronization check process", each of ACT and STB checks whether it has received a notification from the other CPU unit that "the execution of the said certain process has been completed" after a specified time (= waiting time Tw) has passed since its own unit completed the execution of a certain process. If each of ACT and STB cannot receive a notification from the other CPU unit that "the execution of the said certain process has been completed" after a waiting time Tw has passed since its own unit completed the execution of a certain process, it is determined that "an abnormality has occurred in the duplexed other CPU unit". In the case where the first CPU unit 100A is ACT and the second CPU unit 100B is STB, if it is determined that an abnormality has occurred in the first CPU unit 100A, the second CPU unit 100B switches its own unit to ACT and continues to operate.

[0073] As described above, when the length of the "waiting time Tw" is set to be the same in the ACT (first CPU unit 100A) and the STB (second CPU unit 100B), if the performance Ab of the ACT and the STB are different, there is a problem that an erroneous judgment and a delay in switching from the ACT to the STB may occur. Therefore, the ACT and the STB each perform the following processing, thereby performing accurate synchronization check processing without setting an unnecessary waiting time Tw even when the performance Ab of the two is different.

[0074] That is, first, a "CPU unit as a hardware reference (reference CPU unit)" is pre-conceived, and the performance Ab (processing capacity) and processing time of the reference CPU unit are pre-defined. In the following description, the performance Ab of the reference CPU unit is sometimes expressed as "performance Abb".

[0075] Furthermore, each of ACT and STB stores information indicating the performance Ab of its own unit in advance, for example, information indicating "what degree of performance Ab does its own unit have compared to the reference CPU unit" (local performance information). When ACT and STB are duplexed in PLC 10, ACT and STB each grasp each other's performance Ab (the relative performance Ab of the other CPU unit relative to the performance Abb of the reference CPU unit). Furthermore, ACT and STB each flexibly set the waiting time Tw for synchronization check processing based on the grasped performance Ab of each other. In the following description, the performance Ab of its own unit (the relative performance Ab of its own unit relative to the performance Abb of the reference CPU unit) is sometimes expressed as "performance Abm". Similarly, the performance Ab of the other CPU unit (the relative performance Ab of the other CPU unit relative to the performance Abb of the reference CPU unit) is sometimes expressed as "performance Aby".

[0076] Specifically, when ACT and STB are each duplexed in PLC 10, the waiting time Tw for synchronization check processing is set as follows. That is, when the performance Aby of the duplexed counterpart CPU unit is higher than the performance Abm of the own unit, that is, when the processing execution speed of the duplexed counterpart CPU unit is faster than that of the own unit, the normal waiting time Two is set as the waiting time Tw. When the performance Aby of the duplexed counterpart CPU unit is equal to the performance Abm of the own unit, that is, when the processing execution speeds of the duplexed counterpart CPU unit and the own unit are equal, the normal waiting time Two is set as the waiting time Tw. When the performance Aby of the duplexed counterpart CPU unit is lower than the performance Abm of the own unit, that is, when the processing execution speed of the duplexed counterpart CPU unit is slower than that of the own unit, the waiting time Tw is set in accordance with the performance Aby of the counterpart CPU unit.

[0077] For example, if the performance Abm of the own unit is twice the performance Abb of the reference CPU unit, and the performance Aby of the duplexed counterpart CPU unit is 1 / 2 times the performance Abb of the reference CPU unit, the performance Abm is four times the performance Aby. At this time, if the own unit needs "10ms (milliseconds)" to execute a certain process that is the object of synchronization check processing, the counterpart CPU unit needs "40ms", so the waiting time Tw of the own unit is set to "30ms + normal waiting time Two".

[0078] For example, if the performance Abm of the own unit is 1 / 2 times the performance Abb of the reference CPU unit, and the performance Aby of the duplexed counterpart CPU unit is twice the performance Abb of the reference CPU unit, the performance Abm is 1 / 4 times the performance Aby. At this time, if the own unit needs "40ms" to execute a certain process that is the object of synchronization check processing, the counterpart CPU unit needs "10ms", so the waiting time Tw of the own unit is set to "normal waiting time Two".

[0079] Each of ACT (first CPU unit 100A) and STB (second CPU unit 100B) flexibly sets the waiting time Tw of its own unit according to the difference in performance Ab between its own unit and the duplexed counterpart CPU unit.

[0080] (Specific example of processing)

[0081] like Figure 2 As shown in FIG. 1 , when duplexing the first CPU unit 100A (ACT) and the second CPU unit 100B (STB) in the PLC 10, the ACT and the STB each perform "duplex processing" independently of the normal cycle. That is, the ACT and the STB each perform "duplex processing" before the "self-diagnosis processing, command execution processing, and I / O refresh processing" that are repeatedly performed cyclically (periodically).

[0082] ACT and STB each master each other's performance Ab in "duplex processing" and enter a duplex state. The performance information of ACT and STB (local performance information) has been written into the non-volatile memory included in each CPU unit, for example, when each CPU unit is produced. The local performance information, for example, indicates "based on the performance Abb of a CPU unit with a specific hardware specification (the aforementioned "reference CPU unit"), the performance Abm of the own unit is improved / reduced by a certain percentage compared to the performance Abb of the reference CPU unit".

[0083] ACT and STB each store their own unit performance information as "local performance information" in the non-volatile memory of each CPU unit. ACT and STB each forward the local performance information to each other in duplex processing, and store the local performance information of the other CPU unit as "other machine performance information" in the non-volatile memory of each CPU unit.

[0084] For example, when the performance information of the local unit is 150% (i.e., the processing execution speed (processing speed) is 1.5 times that of the reference CPU unit) and the performance information of the other unit is 75% (the processing speed is 0.75 times that of the reference CPU unit), ACT knows the following information. That is, ACT knows that the processing speed of the own unit (ACT) is "twice (=1.5 times / 0.75 times)" the processing speed of the other CPU unit (STB).

[0085] For example, when the local performance information is 75% (processing speed is 0.75 times that of the reference CPU unit) and the other machine performance information is 150% (i.e., the processing execution speed (processing speed) is 1.5 times that of the reference CPU unit), the STB knows the following information. That is, it knows that the processing speed of the own unit (STB) is "1 / 2 times (=0.75 times / 1.5 times)" the processing speed of the other party's CPU unit (ACT).

[0086] In the "duplex processing", when the difference in performance Ab between the own unit and the counterpart CPU unit is grasped and the duplex state is achieved, each of ACT and STB uses the difference in performance Ab to set the waiting time Tw of the own unit.

[0087] ACT and STB each use, for example, an internal timer included in each CPU unit to measure the time in each CPU unit. Figure 2 Here, regarding the "command execution" process, if it is assumed that the execution time of ACT is "100ms", as mentioned above, since the difference with the performance Ab of STB is "twice", the other party's CPU unit (STB) will consume "200ms".

[0088] Therefore, ACT sets the period obtained by adding "100 ms (=200 ms-100 ms)" to the normal waiting time Two as the waiting time Tw for the synchronization check process related to the "command execution" process of its own unit. Figure 2In the example shown, ACT starts from the execution completion time point of the "command execution" process in its own unit, performs standby processing for a period of "100ms", and then performs synchronization check processing related to the "command execution" process. That is, ACT determines whether the notification of the completion of the "command execution" process is obtained from the other CPU unit (STB) during the period from the execution completion time point of the "command execution" process in its own unit until the "100ms + the usual waiting time Two" has passed. And, if the notification of the completion of the "command execution" process is not obtained from STB during the period from the execution completion time point of the "command execution" process in its own unit until the "100ms + the usual waiting time Two" has passed, ACT determines that an abnormality has occurred in STB.

[0089] The STB, knowing that "the performance Ab of the other CPU unit (ACT) is higher or equal to Ab (i.e., the processing speed is faster or the same)", directly sets the normal waiting time Two as the waiting time Tw for the synchronization check processing related to the "command execution" processing of its own unit. Figure 2 In the example shown, once STB completes the execution of the "command execution" process in its own unit, it immediately executes the synchronization check process related to the "command execution" process. That is, STB determines whether to obtain the notification of the completion of the execution of the "command execution" process from the other CPU unit (ACT) from the execution completion time point of the "command execution" process in its own unit until the usual waiting time Two has passed. And, if the notification of the completion of the execution of the "command execution" process cannot be obtained from ACT from the execution completion time point of the "command execution" process in its own unit until the usual waiting time Two has passed, then STB determines that an abnormality has occurred in ACT. When it is determined that an abnormality has occurred in ACT (the first CPU unit 100A), STB (the second CPU unit 100B) switches its own unit to ACT and continues to operate.

[0090] §2.Structure example

[0091] About the use up to now Figure 2 The first CPU unit 100A and the second CPU unit 100B have been described in general terms. Figure 1 To explain the details.

[0092] Figure 1 1 is a block diagram showing a main part structure of the PLC 10 including the first CPU unit 100A and the second CPU unit 100B according to the first embodiment of the present invention. Figure 1As illustrated, the PLC 10 includes a first CPU unit 100A and a second CPU unit 100B which are duplexed in the PLC 10. The first CPU unit 100A and the second CPU unit 100B are functional units that collectively control the entire PLC 10.

[0093] The PLC 10 may also include Figure 1 The PLC 10 further includes, for example, a power supply unit not shown in the figure, which supplies power to the entire PLC 10 including the first CPU unit 100A and the second CPU unit 100B. In addition, the PLC 10 may also include an input unit, an output unit, and a communication unit not shown in the figure, wherein the input unit inputs signals of switches and sensors installed in appropriate parts of the production device and the equipment device, the output unit sends control signals to the actuator, etc., and the communication unit is used to connect to a communication network.

[0094] As described above, the first CPU unit 100A and the second CPU unit 100B each repeatedly perform self-diagnosis processing, command execution processing and I / O refresh processing in sequence. The I / O refresh processing includes the processing of importing various input signals obtained by the input unit, etc. into the I / O memory of each CPU unit (input (IN) refresh), and the processing of writing the processing results of the command execution processing into the I / O memory and outputting them to the output unit, etc. (output (OUT) refresh). That is, the I / O refresh processing is a cyclic data exchange between "each of the first CPU unit 100A and the second CPU unit 100B" and "external units and external devices other than the first CPU unit 100A and the second CPU unit 100B". In the command execution processing, various control signals output by the PLC 10 as a controller to the control object are generated. For example, based on the user program, logical operations using the input signals imported into the I / O memory in the input refresh are performed to generate control signals.

[0095] In the PLC 10, in order to improve the safety and reliability of the control system controlled by the PLC 10, the first CPU unit 100A and the second CPU unit 100B are duplexed, and the two are connected, for example, by an inter-CPU bus. If both the first CPU unit 100A and the second CPU unit 100B are normal, the execution of the same processing (self-diagnosis processing, command execution processing, and I / O refresh processing) is started at the same time. For example, if both the first CPU unit 100A and the second CPU unit 100B are normal, the execution of the same user program using the same input signal is started at the same time.

[0096] One of the first CPU unit 100A and the second CPU unit 100B is a CPU unit (ACT) of an execution system, and the other is a CPU unit (STB) of a standby system. As mentioned above, in this specification, an example of "the first CPU unit 100A is ACT and the second CPU unit 100B is STB" is described, but the same is true for the case of "the first CPU unit 100A is STB and the second CPU unit 100B is ACT".

[0097] The first CPU unit 100A as ACT actually performs cyclic processing, reads and writes the memory, and transmits and receives control data (I / O data) with external I / O devices, etc., and is responsible for controlling the control system controlled by PLC 10. The second CPU unit 100B as STB executes the same user program as the user program executed by the first CPU unit 100A as ACT in standby (i.e., during the period when the first CPU unit 100A as ACT does not have an abnormality). However, the second CPU unit 100B as STB does not output the execution result (operation execution result) of the executed user program to external I / O devices, etc. Moreover, the second CPU unit 100B as STB receives the processing result (operation execution result, and various input signals obtained by the first CPU unit 100A as ACT) from the first CPU unit 100A as ACT. And, the second CPU unit 100B as STB updates the content of the memory of its own unit according to the processing result received from the first CPU unit 100A as ACT, etc. Thus, the identity of the memory contents of the second CPU unit 100B as the STB and the first CPU unit 100A as the ACT is ensured.

[0098] When the first CPU unit 100A as ACT fails, the second CPU unit 100B as STB switches to the first CPU unit 100A as ACT to perform actual control operations. By duplexing the first CPU unit 100A and the second CPU unit 100B in advance in the PLC 10, even if the first CPU unit 100A as ACT fails, the entire PLC 10 will not stop immediately, but can continue to operate, thereby improving reliability.

[0099] (CPU Unit Details)

[0100] like Figure 1As shown, the PLC 10 includes a shared register 200 that can be written and read by both CPU units 100A and 100B in addition to the duplexed first CPU unit 100A and the second CPU unit 100B in the PLC 10. In order to ensure the simplicity of the description, the structure that is not directly related to the present embodiment is omitted from the description and the block diagram. However, according to the actual implementation, the PLC 10 may also include the omitted structure.

[0101] The shared register 200 includes a first register 210 and a second register 220 .

[0102] The first register 210 is written by the first CPU unit 100A with information indicating that "the unit itself (i.e., the first CPU unit 100) has completed execution of a certain process (self-diagnosis process, command execution process, and I / O refresh process). The information written by the first CPU unit 100A to the first register 210 is read by the second CPU unit 100B.

[0103] The second register 220 is written by the second CPU unit 100B with information indicating that "the unit itself (i.e., the second CPU unit 100B) has completed execution of a certain process (self-diagnosis process, command execution process, and I / O refresh process). The information written by the second CPU unit 100B to the second register 220 is read by the first CPU unit 100A.

[0104] The first CPU unit 100A includes a capability acquisition unit 110A, a process execution unit 120A, a waiting time setting unit 160A, and a determination unit 170A as functional blocks in addition to the storage unit 130A. The storage unit 130A stores a foreign machine capability table 140A and a local machine capability table 150A.

[0105] The second CPU unit 100B includes a capability acquisition unit 110B, a process execution unit 120B, a waiting time setting unit 160B, and a determination unit 170B as functional blocks in addition to the storage unit 130B. The storage unit 130B stores a foreign machine capability table 140B and a local machine capability table 150B.

[0106] Hereinafter, when there is no need to distinguish between the capability acquisition unit 110A and the capability acquisition unit 110B, they are simply referred to as the “capability acquisition unit 110”. Similarly, when there is no need to distinguish between the processing execution unit 120A and the processing execution unit 120B, they are simply referred to as the “processing execution unit 120”. When there is no need to distinguish between the storage unit 130A and the storage unit 130B, they are simply referred to as the “storage unit 130”. When there is no need to distinguish between the other machine capability table 140A and the other machine capability table 140B, they are simply referred to as the “other machine capability table 140”. When there is no need to distinguish between the local machine capability table 150A and the local machine capability table 150B, they are simply referred to as the “local machine capability table 150”. When there is no need to distinguish between the waiting time setting unit 160A and the waiting time setting unit 160B, they are simply referred to as the “waiting time setting unit 160”. When there is no need to distinguish between the determination unit 170A and the determination unit 170B, they are simply referred to as the “determination unit 170”.

[0107] Each functional block such as the capability acquisition unit 110, the processing execution unit 120, the waiting time setting unit 160 and the determination unit 170 can be implemented, for example, in the following manner, that is, the central processing unit (CPU) etc. reads out the program stored in the storage device (storage unit 130) implemented by the read-only memory (ROM), non-volatile memory (NVRAM) etc. to the random access memory (Random Access Memory) etc. not shown for execution.

[0108] (Function block details)

[0109] The capability acquisition unit 110 refers to the local capability table 150 of the other CPU unit to acquire information ("performance information") indicating the performance Aby (processing capability) of the duplexed other CPU unit. The capability acquisition unit 110 stores the acquired performance information (other machine performance information) of the other CPU unit in the other machine capability table 140 of the own unit.

[0110] In particular, the capability acquisition unit 110 performs the self-diagnosis process, the command execution process, and the I / O refresh process before the process execution unit 120 sequentially and repeatedly performs the self-diagnosis process, the command execution process, and the I / O refresh process. Figure 2 In the illustrated "duplex processing", the other machine's performance information is acquired once.

[0111] Figure 3 1 is a diagram for explaining a specific example of the process of "obtaining performance information indicating the performance Aby of the counterpart CPU unit through duplexing" which is executed once in the "duplex process". Figure 3As shown, the capability acquisition unit 110A refers to the local capability table 150B to acquire the performance information indicating the performance Aby of the second CPU unit 100B, and stores the acquired performance information of the second CPU unit 100B (other machine performance information) in the other machine capability table 140A. Furthermore, the capability acquisition unit 110B refers to the local capability table 150A to acquire the performance information indicating the performance Aby of the first CPU unit 100A, and stores the acquired performance information of the first CPU unit 100A (other machine performance information) in the other machine capability table 140B.

[0112] The process execution unit 120 repeatedly executes the self-diagnosis process, the command execution process, and the I / O refresh process in sequence, and when the execution of each process is completed, writes to the shared register 200 that “the unit has completed the execution of each process”.

[0113] Furthermore, when the processing execution unit 120 completes the execution of each processing, it notifies the waiting time setting unit 160 and the determination unit 170 that "the execution of each processing has been completed by the processing unit itself". The processing execution unit 120 may also notify the waiting time setting unit 160 of the "execution time of each processing (the time from the start of execution to the completion of execution of each processing)" together with the "execution time of each processing" that "the execution of each processing has been completed by the processing unit itself". That is, the processing execution unit 120 may also use an internal timer to measure the "execution time of each processing" and notify the waiting time setting unit 160 of the measured "execution time of each processing".

[0114] <Writing of completion of processing> When the processing execution unit 120 completes the execution of each of the self-diagnosis processing, the command execution processing, and the I / O refresh processing, it writes the meaning (that is, the meaning of "the self-unit has completed the execution of the above-mentioned processing") to the common register 200. That is, the processing execution unit 120A that has completed the execution of the self-diagnosis processing writes the meaning of "the self-diagnosis processing has been completed" to the first register 210, and the processing execution unit 120 that has completed the execution of the self-diagnosis processing writes the meaning of "the self-diagnosis processing has been completed" to the second register 220. The processing execution unit 120A that has completed the execution of the command execution processing writes the meaning of "the self-diagnosis processing has been completed" to the first register 210, and the processing execution unit 120B that has completed the execution of the command execution processing writes the meaning of "the self-diagnosis processing has been completed" to the second register 220. The processing execution unit 120A that has completed the execution of the I / O refresh processing writes the meaning of "the own unit has completed the execution of the I / O refresh processing" to the first register 210, and the processing execution unit 120B that has completed the execution of the I / O refresh processing writes the meaning of "the own unit has completed the execution of the I / O refresh processing" to the second register 220.

[0115] <Timing of starting execution of processing> During the period when the first CPU unit 100A and the second CPU unit 100B are duplexed, the processing execution unit 120 starts execution of each of the self-diagnosis processing, the command execution processing, and the I / O refresh processing at the following timing. In other words, during the period when it is not determined that an abnormality has occurred with respect to each of the first CPU unit 100A and the second CPU unit 100B, the processing execution unit 120 starts execution of each of the self-diagnosis processing, the command execution processing, and the I / O refresh processing at the following timing.

[0116] That is, the process execution unit 120 starts execution of the self-diagnosis process, the command execution process, and the I / O refresh process after confirming the normality of the first CPU unit 100A and the second CPU unit 100B in the synchronization check process after the execution of the previous process is completed.

[0117] Specifically, after the first CPU unit 100A and the second CPU unit 100B are confirmed to be normal in the synchronization check process after the execution of the self-diagnosis process is completed, the process execution unit 120 starts the execution of the command execution process. After the first CPU unit 100A and the second CPU unit 100B are confirmed to be normal in the synchronization check process after the execution of the command execution process is completed, the process execution unit 120 starts the execution of the I / O refresh process. After the first CPU unit 100A and the second CPU unit 100B are confirmed to be normal in the synchronization check process after the execution of the I / O refresh process is completed, the process execution unit 120 starts the execution of the self-diagnosis process of the next cycle.

[0118] The waiting time setting unit 160 obtains the other machine performance information by referring to the other machine capability table 140, and obtains the local machine performance information by referring to the local machine capability table 150. Furthermore, the waiting time setting unit 160 obtains the meaning of "the own unit has completed the execution of each process" from the process execution unit 120. The waiting time setting unit 160 calculates the execution time of each process at the same time as the meaning of "the own unit has started the execution of each process" obtained from the process execution unit 120 before obtaining the meaning of "the own unit has completed the execution of each process". That is, the waiting time setting unit 160 calculates the execution time of each process based on the time of "the own unit has started the execution of each process" measured by the internal timer and the time of "the own unit has completed the execution of each process" measured by the internal timer. In addition, the execution time of each process may be measured by the process execution unit 120 using the internal timer, and the waiting time setting unit 160 may be notified from the process execution unit 120.

[0119] The waiting time setting unit 160 calculates the "waiting time Tw" for the synchronization check process on each process based on the acquired other machine performance information, the local machine performance information, and the execution time of each process, and notifies the calculated waiting time Tw to the determination unit 170. Specifically, the waiting time setting unit 160 calculates the "waiting time Tw" for the synchronization check process on each process as follows, using the other machine performance information, the local machine performance information, and the execution time of each process.

[0120] That is, when the "performance Aby of the other CPU unit after duplexing" indicated by the other unit performance information is higher than the "performance Abm of the own unit" indicated by the own unit performance information, the waiting time setting unit 160 sets the "normal waiting time Two" to the "waiting time Tw". Furthermore, when the performance Aby of the other CPU unit after duplexing is equal to the performance Abm of the own unit, the waiting time setting unit 160 sets the "normal waiting time Two" to the "waiting time Tw".

[0121] The "normal waiting time Two" is a period of predetermined length common to the first CPU unit 100A and the second CPU unit 100B, which is set at the time of factory shipment of each unit and can be updated by the user. The "normal waiting time Two" is a period set on the premise that the performance Ab of the first CPU unit 100A and the second CPU unit 100B are equal.

[0122] When the performance Aby of the duplexed counterpart CPU unit is lower than the performance Abm of the own unit, the waiting time setting unit 160 sets the period obtained by multiplying the execution time of each process by the value obtained by dividing the performance Abm of the own unit by the performance Aby of the counterpart CPU unit as the adjusted waiting time Ta. Furthermore, the waiting time setting unit 160 sets "the period obtained by adding the adjusted waiting time Ta to the normal waiting time Two (i.e., "normal waiting time Two + adjusted waiting time Ta")" as the "waiting time Tw".

[0123] The determination unit 170 determines whether the partner CPU unit has completed execution of the processing that the processing execution unit 120 has completed until the waiting time Tw notified from the waiting time setting unit 160 has passed since the execution of each processing by the processing execution unit 120 is completed (synchronization check processing). For example, the determination unit 170 refers to the shared register 200 at the time point when the waiting time Tw has passed from the time point when "the own unit has completed execution of each processing", and confirms whether the execution of a certain processing that the own unit has completed execution has been completed by the duplexed partner CPU unit.

[0124] The determination unit 170, which is notified of the "normal waiting time Two + adjusted waiting time Ta" as the waiting time Tw, performs the standby process from the time point "the own unit has completed the execution of each process" until the adjusted waiting time Ta has passed. And, after the execution of the standby process is completed (that is, after the adjusted waiting time Ta has passed from the time point "the own unit has completed the execution of each process"), the determination unit 170 performs the synchronization check process. That is, after the execution of the standby process is completed, the determination unit 170 determines "whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed until the normal waiting time Two has passed." In other words, the determination unit 170 determines whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed from the time point of the execution of the standby process until the normal waiting time Two has passed. The "time point of completion of the execution of the standby process" is "the time point at which the execution of a certain process that the own unit has completed is expected to be completed in the other CPU unit."

[0125] The determination unit 170, which is informed of the "normal waiting time Two" as the waiting time Tw, immediately performs the synchronization check process at the time point "the own unit has completed the execution of each process". That is, the determination unit 170 determines "whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed until the normal waiting time Two has passed". In other words, the determination unit 170 determines whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed from the time point of the execution completion of the own unit until the normal waiting time Two has passed.

[0126] The determination unit 170A refers to the second register 220 of the common register 200 to check whether there is a written message that "the execution of the processing execution unit 120B has been completed" with respect to a certain processing that the processing execution unit 120A has completed. If there is no written message that "the execution of the processing execution unit 120B has been completed" in the second register 220 with respect to a certain processing that the processing execution unit 120A has completed, the determination unit 170A determines that an abnormality has occurred in the second CPU unit 100B.

[0127] The determination unit 170B refers to the first register 210 of the common register 200 to check whether there is a written message that "the execution of the processing execution unit 120A has been completed" with respect to a certain processing that the processing execution unit 120B has completed. If there is no written message that "the execution of the processing execution unit 120A has been completed" in the first register 210 with respect to a certain processing that the processing execution unit 120B has completed, the determination unit 170B determines that an abnormality has occurred in the first CPU unit 100A.

[0128] (Details of storage unit)

[0129] The storage unit 130 is a storage device for storing various data used by the first CPU unit 100A and the second CPU unit 100B. In addition, the storage unit 130 can also non-temporarily store (1) control programs, (2) OS programs, (3) application programs for executing various functions of the first CPU unit 100A and the second CPU unit 100B, and (4) various data read when the application programs are executed. The data (1) to (4) are stored in a non-volatile storage device such as a read-only memory (ROM), a flash memory, an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM (registered trademark)), a hard disk drive (HDD), etc. The first CPU unit 100A and the second CPU unit 100B can each include a temporary storage unit (not shown). The temporary storage unit is a so-called working memory that temporarily stores data and operation results used for calculations during various processing processes performed by the first CPU unit 100A and the second CPU unit 100B, and includes volatile storage devices such as random access memory (RAM). Which data is stored in which storage device is appropriately determined based on the purpose of use, convenience, cost or physical limitations of the first CPU unit 100A and the second CPU unit 100B. The storage unit 130 also stores the other machine capability table 140 and the local machine capability table 150.

[0130] In the other machine capability table 140, information indicating the performance Aby of the other machine CPU unit through duplexing, that is, other machine performance information, is stored. Figure 3 As described above, the capability acquisition unit 110 stores the other machine performance information acquired by referring to the own machine capability table 150 of the partner CPU unit via duplexing in the other machine capability table 140 of its own unit.

[0131] The local performance table 150 stores local performance information indicating the performance Abm of the local unit, for example, local performance information indicating "how much performance Ab (processing capacity) the local unit has compared with the reference CPU unit". The local performance information is stored in the local performance table 150 when the first CPU unit 100A and the second CPU unit 100B are shipped from their respective factories.

[0132] (About CPU unit arrangement)

[0133] About the use up to now Figure 1 The first CPU unit 100A and the second CPU unit 100B of the structure are described and are organized as follows for ease of understanding. That is, the first CPU unit 100A and the second CPU unit 100B are each a duplexed CPU unit in the PLC 10 (controller), and include a waiting time setting unit 160 (setting unit) and a determination unit 170. The waiting time setting unit 160 sets the waiting time Tw by considering the ratio of the performance Abm (processing capacity) of the own unit to the performance Aby of the duplexed counterpart CPU unit. If the determination unit 170 cannot confirm that the execution of the processing of the counterpart CPU unit is completed from the time point when the processing of the own unit is completed until the waiting time Tw set by the waiting time setting unit 160 has passed, it is determined that an abnormality has occurred in the counterpart CPU unit.

[0134] According to the above configuration, the first CPU unit 100A and the second CPU unit 100B each set the waiting time Tw in consideration of the ratio of the performance Ab (processing capacity) of the own unit to that of the other CPU unit. And, the first CPU unit 100A and the second CPU unit 100B each use the set waiting time Tw to determine the synchronization of the own unit with the other CPU unit (i.e., the consistency of the executed processing).

[0135] For example, when the performance Ab of the other CPU unit is higher than that of the own unit (i.e., the processing execution speed is faster), the first CPU unit 100A and the second CPU unit 100B each set the predetermined normal waiting time Two as the waiting time Tw. Furthermore, when the performance Ab of the other CPU unit is equal to that of the own unit, the first CPU unit 100A and the second CPU unit 100B each set the predetermined "normal waiting time Two" as the waiting time Tw.

[0136] When the performance Ab of the other CPU unit is higher than that of the own unit, the other CPU unit should have completed the execution of a certain process at the time when the own unit has completed the execution of the said process. In addition, when the performance Ab of the other CPU unit is equal to that of the own unit, the other CPU unit should have completed the execution of the said process at the time when the own unit has completed the execution of the said process.

[0137] Therefore, when the performance Ab of the partner CPU unit is higher than that of the own unit, the first CPU unit 100A and the second CPU unit 100B each set the normal waiting time Two as the waiting time Tw, thereby accurately determining whether an abnormality has occurred in the partner CPU unit.

[0138] For example, when the performance Ab of the other CPU unit is lower than that of the own unit, the first CPU unit 100A and the second CPU unit 100B each set the "period obtained by adding the normal waiting time Two to the adjusted waiting time Ta" as the waiting time Tw. The adjusted waiting time Ta is set in consideration of the difference in performance Ab between the own unit and the other CPU unit. For example, the "difference between the time point at which the execution of the process in the own unit is completed and the time point at which the execution of the process in the other CPU unit is completed in advance" is set as the adjusted waiting time Ta.

[0139] When the performance Ab of the other CPU unit is lower than that of the own unit, the other CPU unit has not yet completed the execution of a certain process at the time point when the own unit has completed the execution of the said process. Therefore, the first CPU unit 100A and the second CPU unit 100B each wait until the "time point when the execution of the said process in the other CPU unit is expected to be completed (the expected time point of execution completion)". In addition, the first CPU unit 100A and the second CPU unit 100B each determine whether the execution of the said process in the other CPU unit can be confirmed to be completed from the expected time point of execution completion until the normal waiting time Two has passed. That is, the first CPU unit 100A and the second CPU unit 100B each determine whether the execution of the said process in the other CPU unit can be confirmed to be completed from the time point when the execution of the said process in the own unit is completed until the "period obtained by adding the adjusted waiting time Ta to the normal waiting time Two" has passed.

[0140] Therefore, when the performance Ab of the other CPU unit is lower than that of the own unit, the first CPU unit 100A and the second CPU unit 100B each set "the period obtained by adding the normal waiting time Two to the adjusted waiting time Ta" as the waiting time Tw, thereby also being able to accurately perform the above judgment.

[0141] As described above, the following effect is achieved: even if the performance Ab of the first CPU unit 100A and the second CPU unit 100B is inconsistent with that of the other CPU unit, the appropriate waiting time Tw can be set in consideration of the difference in performance Ab between the first CPU unit 100A and the other CPU unit. That is, the following effect is achieved: the first CPU unit 100A and the second CPU unit 100B each consider the difference in performance Ab between the duplexed other CPU unit and the first CPU unit 100A and the second CPU unit 100B, and can accurately perform synchronization check processing without setting unnecessary waiting time Tw.

[0142] In each of the first CPU unit 100A and the second CPU unit 100B, the processing (processing as the synchronization check processing object) includes self-diagnosis processing, command execution processing and I / O refresh processing. The self-diagnosis processing is a process for diagnosing whether the hardware of the own unit has abnormalities. The command execution processing is a process for generating a signal to control "external devices and external units other than the other CPU unit". The I / O refresh processing is a process for exchanging data with "external devices and external units other than the other CPU unit". The waiting time setting unit 160 sets the waiting time Tw for each of the self-diagnosis processing, the command execution processing and the I / O refresh processing. The determination unit 170 performs the determination, that is, performs the synchronization check processing, for each of the self-diagnosis processing, the command execution processing and the I / O refresh processing.

[0143] The first CPU unit 100A and the second CPU unit 100B each determine synchronization (i.e., consistency of executed processes) with the partner CPU unit regarding self-diagnosis processing, command execution processing, and I / O refresh processing.

[0144] The first CPU unit 100A and the second CPU unit 100B can determine the synchronization between the first CPU unit 100A and the second CPU unit 100B and the counterpart CPU unit at the timing when the self-diagnosis process, the command execution process, and the I / O refresh process are completed.

[0145] The first CPU unit 100A and the second CPU unit 100B each perform a duplex process once before sequentially repeating the self-diagnosis process, the command execution process, and the I / O refresh process. The first CPU unit 100A and the second CPU unit 100B each obtain the performance Aby of the other CPU unit from the other CPU unit during the duplex process.

[0146] According to the above configuration, the first CPU unit 100A and the second CPU unit 100B each acquire the performance Aby of the other CPU unit once before sequentially and repeatedly executing the self-diagnosis process, the command execution process, and the I / O refresh process. Furthermore, the first CPU unit 100A and the second CPU unit 100B each set the waiting time Tw for the above determination regarding the above processes in consideration of the ratio of the acquired performance Aby of the other CPU unit to the performance Abm of the own unit.

[0147] The following effect is achieved: the first CPU unit 100A and the second CPU unit 100B can each set the waiting time Tw used for the determination regarding the respective processes in consideration of the performance Aby of the counterpart CPU unit acquired before repeatedly executing the respective processes.

[0148] §3. Operation Example

[0149] The first CPU unit 100A and the second CPU unit 100B are each Figure 2 As shown, the following processing is performed. That is, the first CPU unit 100A and the second CPU unit 100B each repeatedly perform self-diagnosis processing, command execution processing and I / O refresh processing in sequence. Specifically, the processing execution unit 120 of each unit repeatedly performs self-diagnosis processing, command execution processing and I / O refresh processing in sequence. Moreover, the first CPU unit 100A and the second CPU unit 100B each (especially the capability acquisition unit 110 of each unit) perform a duplex processing once before repeatedly performing self-diagnosis processing, command execution processing and I / O refresh processing in sequence. The first CPU unit 100A and the second CPU unit 100B each obtain the other machine performance information representing the performance Aby of the duplexed counterpart CPU unit during the duplex processing.

[0150] When each unit (particularly the processing execution section 120 of each unit) completes execution of the self-diagnosis processing, the command execution processing, and the I / O refresh processing, it writes to the common register 200 that the unit has completed execution of each processing.

[0151] Each unit (particularly the waiting time setting section 160 of each unit) sets a "waiting time Tw" for synchronization checking processing on each process based on other machine performance information, own machine performance information, and execution time of each process already executed by the own unit.

[0152] Specifically, the waiting time setting unit 160 calculates "the adjusted waiting time Ta calculated in consideration of the ratio of the performance Abm of the own unit to the performance Aby of the other CPU unit through duplexing" for each process. And the waiting time setting unit 160 adds the "adjusted waiting time Ta calculated for each process" to the "normal waiting time Two for each process" and sets the period as the "waiting time Tw" used for the synchronization check process for each process.

[0153] When "Abm / Aby" is less than "1", the waiting time setting unit 160 sets the "adjusted waiting time Ta = 0" for each process. When "Abm / Aby" is greater than "1", the waiting time setting unit 160 sets the "adjusted waiting time Ta" for each process to a value obtained by multiplying the execution time of each process by "Abm / Aby".

[0154] Each unit (particularly the determination unit 170 of each unit) performs synchronization check processing after the self-diagnosis processing, command execution processing and I / O refresh processing of the own unit are completed. That is, the determination unit 170 refers to the common register 200 and determines whether the other CPU unit has completed the processing of the own unit from the time point when the execution of each processing of the own unit is completed until the waiting time Tw has passed.

[0155] The synchronization check process is a process of mutually monitoring the states of the duplexed counterpart CPU units. Specifically, the synchronization check process is a process of confirming (determining) whether the duplexed counterpart CPU unit has also completed the execution of the process executed in the own unit.

[0156] If synchronization cannot be confirmed in the synchronization check process, that is, if the completion of the process executed by the own unit cannot be confirmed in the other CPU unit, the first CPU unit 100A and the second CPU unit 100B cancel duplexing. And, for example, the STB that determines that an abnormality has occurred in the ACT replaces the ACT and the own unit continues to operate.

[0157] If synchronization is confirmed in the synchronization check process, each unit (particularly the process execution unit 120 of each unit) starts execution of the next process of "the process whose execution completion has been confirmed in the synchronization check process by the own unit and the partner CPU unit". Specifically, the synchronization check process is executed as follows.

[0158] That is, when the processing execution unit 120A completes the execution of a certain process, it writes the meaning that "the own unit (that is, the processing execution unit 120A) has completed the execution of a certain process" to the first register 210 of the shared register 200. The determination unit 170B recognizes that the first CPU unit 100A has completed the execution of a certain process by reading the first register 210. Moreover, when the processing execution unit 120B completes the execution of a certain process, it writes the meaning that "the own unit (that is, the processing execution unit 120B) has completed the execution of a certain process" to the second register 220 of the shared register 200. The determination unit 170A recognizes that the second CPU unit 100B has completed the execution of a certain process by reading the second register 220. Once the determination unit 170A and the determination unit 170B each recognize that "the other CPU unit has completed the execution of a certain process", the processing execution unit 120A and the processing execution unit 120B each start the execution of the next process of the said certain process.

[0159] The "processing executed by the first CPU unit 100A and the second CPU unit 100B respectively" described so far can be summarized as follows. That is, the "processing executed by the first CPU unit 100A and the second CPU unit 100B respectively" is a control method of a duplexed CPU unit in PLC10 (controller), including a setting step and a determination step. The setting step is: setting the waiting time Tw by considering the ratio of the performance Abm of the own unit to the performance Aby of the duplexed counterpart CPU unit. The determination step is: if the completion of the execution of the processing in the counterpart CPU unit cannot be confirmed from the time point when the processing of the own unit is completed until the waiting time Tw set in the setting step has passed, it is determined that an abnormality has occurred in the counterpart CPU unit.

[0160] According to the method, the control method determines synchronization of the own unit and the counterpart CPU unit (ie, agreement of executed completed processes) using the waiting time Tw set in consideration of the performance Ab ratio of the own unit and the counterpart CPU unit.

[0161] For example, when the performance Ab of the other CPU unit is higher than that of the own unit (i.e., the processing execution speed is faster), the control method sets the predetermined "normal waiting time Two" as the waiting time Tw. Moreover, when the performance Ab of the other CPU unit is equal to that of the own unit, the control method sets the predetermined "normal waiting time Two" as the waiting time Tw.

[0162] When the performance Ab of the other CPU unit is higher than that of the own unit, the other CPU unit should have completed the execution of a certain process at the time when the own unit has completed the execution of the said process. In addition, when the performance Ab of the other CPU unit is equal to that of the own unit, the other CPU unit should have completed the execution of the said process at the time when the own unit has completed the execution of the said process.

[0163] Therefore, when the performance Ab of the partner CPU unit is higher than that of the own unit, the first CPU unit 100A and the second CPU unit 100B each set the normal waiting time Two as the waiting time Tw, thereby accurately determining whether an abnormality has occurred in the partner CPU unit.

[0164] For example, when the performance Ab of the other CPU unit is lower than that of the own unit (i.e., the processing execution speed is slow), the control method sets "the period obtained by adding the adjusted waiting time Ta taking into account the difference in performance Ab to the normal waiting time Two" as the waiting time Tw. Specifically, "the difference between the time point at which the execution of the processing in the own unit is completed and the time point at which the execution of the processing in the other CPU unit is expected to be completed" is set as the adjusted waiting time Ta.

[0165] In the case where the performance Ab of the other CPU unit is lower than that of the own unit, the other CPU unit has not yet completed the execution of a certain process at the time point when the own unit has completed the execution of the process. Therefore, the control method waits until the "time point when the execution of the process in the other CPU unit is expected to be completed", and then determines whether the execution of the process in the other CPU unit can be confirmed to be completed until the "normal waiting time Two" has passed. That is, the control method determines whether the execution of the process in the other CPU unit can be confirmed to be completed from the time point when the execution of the process in the own unit is completed until the "period obtained by adding the normal waiting time Two to the adjusted waiting time Ta" has passed.

[0166] Therefore, when the performance Ab of the other CPU unit is lower than that of the own unit, the control method sets "a period obtained by adding the normal waiting time Two to the adjusted waiting time Ta" as the waiting time Tw, thereby making it possible to accurately perform the determination.

[0167] As described above, the control method has the following effect: even when the performance Ab of the own unit and the counterpart CPU unit are inconsistent, the control method can set an appropriate waiting time Tw that takes into account the difference in performance Ab between the own unit and the counterpart CPU unit. That is, the control method has the following effect: considering the difference in performance Ab between the counterpart CPU unit and the own unit through duplexing, the control method does not set an unnecessary waiting time Tw, and can accurately perform synchronization check processing.

[0168] [Implementation method 2]

[0169] based on Figures 4 to 7 Another embodiment of the present invention is described as follows. In addition, in order to ensure the simplicity of the description, only the structure (process flow and content of the processing) different from the first embodiment is described. That is, the structure described in the first embodiment can also be fully included in this embodiment. Moreover, the definitions of the terms described in the first embodiment are also the same.

[0170] In the first embodiment, in the PLC 10 , the first CPU unit 100A and the second CPU unit 100B in duplex use only one type of performance Aby of the partner CPU unit for setting the “waiting time Tw” of the own unit.

[0171] On the other hand, in the PLC 20 of the present embodiment, the first CPU unit 300A and the second CPU unit 300B in duplexing use a plurality of performances Aby of the partner CPU unit for setting the "waiting time Tw" of the own unit.

[0172] Figure 54 is a diagram showing an example of a hardware structure for implementing each of the first CPU unit 300A and the second CPU unit 300B. That is, the first CPU unit 300A and the second CPU unit 300B are each implemented using a memory 410, a CPU 420 (microcomputer) and a dedicated large-scale integrated circuit (LSI) 430. The dedicated LSI is also called an "Application Specific Integrated Circuit (ASIC)", and a field programmable gate array (FPGA) may be used instead of the dedicated LSI.

[0173] The first CPU unit 300A and the second CPU unit 300B each repeatedly perform self-diagnosis processing, command execution processing, and I / O refreshing processing in the same manner as the first CPU unit 100A and the second CPU unit 100B. For example, the self-diagnosis processing is mainly performed by the CPU 420, the command execution processing is mainly performed by the dedicated LSI 430, and the I / O refreshing processing is mainly performed by the CPU 420 via the dedicated LSI 430.

[0174] When the hardware that mainly executes each self-diagnosis process, command execution process, and I / O refresh process is different, the performance Ab of each process may be different between the first CPU unit 300A and the second CPU unit 300B. For example, the performance Ab of the CPU 420 of the first CPU unit 300A may be higher than that of the CPU 420 of the second CPU unit 300B, and the performance Ab of the dedicated LSI 430 of the first CPU unit 300A may be lower than that of the dedicated LSI 430 of the second CPU unit 300B. In this case, the first CPU unit 300A completes the self-diagnosis process faster than the second CPU unit 300B, and the first CPU unit 300A completes the command execution process slower than the second CPU unit 300B.

[0175] Therefore, the first CPU unit 300A and the second CPU unit 300B each grasp the performance Ab of the own unit and the partner CPU unit for each of the repeatedly executed self-diagnosis processing, command execution processing, and I / O refresh processing. And, the first CPU unit 300A and the second CPU unit 300B each use the performance Ab of the own unit and the partner CPU unit related to each processing to set the "waiting time Tw" during the synchronization check processing for each processing. The details are described below.

[0176] (CPU Unit Details)

[0177] Figure 41 is a block diagram showing a main part configuration of the PLC 20 including the first CPU unit 300A and the second CPU unit 300B. The PLC 20, like the PLC 10, may also include functional units (not shown) such as a power supply unit, an input unit, an output unit, and a communication unit.

[0178] The first CPU unit 300A and the second CPU unit 300B are respectively the same as the first CPU unit 100A and the second CPU unit 100B, and are functional units that control the entire PLC 10. The first CPU unit 300A and the second CPU unit 300B are duplexed in the PLC 20. That is, one of the first CPU unit 300A and the second CPU unit 300B is the CPU unit (ACT) of the execution system, and the other is the CPU unit (STB) of the standby system, and each monitors the state of the other. If it is determined that an abnormality has occurred in the ACT during the synchronization check process, the STB replaces the CPU unit that has been ACT so far and switches its own unit to ACT to continue operating. In this embodiment, the example of "the first CPU unit 300A is ACT and the second CPU unit 300B is STB" is explained, but the situation of "the first CPU unit 300A is STB and the second CPU unit 300B is ACT" is also the same.

[0179] like Figure 4 As shown, the PLC 20 includes a common register 200 that can be written to and read from by both CPU units 300A and 300B in duplex in the PLC 20. The common register 200 has been described above, so the details are briefly described here.

[0180] In order to ensure the brevity of the description, the structures that are not directly related to the present embodiment are omitted from the description and block diagram. However, according to the actual implementation, the PLC 10 may also include the omitted structures.

[0181] The first CPU unit 300A includes a capability acquisition unit 310A, a process execution unit 120A, a waiting time setting unit 360A, and a determination unit 370A as functional blocks in addition to the storage unit 330A. The storage unit 330A stores a foreign machine capability table 340A and a local machine capability table 350A.

[0182] The waiting time setting unit 360A includes a first waiting time setting unit 361A, a second waiting time setting unit 362A, and a third waiting time setting unit 363A. The determination unit 370A includes a first determination unit 371A, a second determination unit 372A, and a third determination unit 373A. The other machine capability table 340A includes a first other machine capability table 341A, a second other machine capability table 342A, and a third other machine capability table 343A. The local machine capability table 350A includes a first local machine capability table 351A, a second local machine capability table 352A, and a third local machine capability table 353A.

[0183] The second CPU unit 300B includes a capability acquisition unit 310B, a process execution unit 120B, a waiting time setting unit 360B, and a determination unit 370B as functional blocks in addition to the storage unit 330B. The storage unit 330B stores a foreign machine capability table 340B and a local machine capability table 350B.

[0184] The waiting time setting unit 360B includes a first waiting time setting unit 361B, a second waiting time setting unit 362B, and a third waiting time setting unit 363B. The determination unit 370B includes a first determination unit 371B, a second determination unit 372B, and a third determination unit 373B. The other machine capability table 340B includes a first other machine capability table 341B, a second other machine capability table 342B, and a third other machine capability table 343B. The local machine capability table 350B includes a first local machine capability table 351B, a second local machine capability table 352B, and a third local machine capability table 353B.

[0185] Similar to the first CPU unit 100A and the second CPU unit 100B in the first embodiment, Figure 4 The first CPU unit 300A and the second CPU unit 300B shown in the figure have the same structure as each other. In the case where the structure commonly included in the first CPU unit 300A and the second CPU unit 300B must be specially distinguished, "A" is marked in the case of the structure of the first CPU unit 300A, and "B" is marked in the case of the structure of the second CPU unit 300B. Regarding the structure commonly included in the first CPU unit 300A and the second CPU unit 300B, if it is not necessary to specially distinguish which structure is included, the annotation of "A" or "B" is omitted.

[0186] Each functional block such as the capability acquisition unit 310, the processing execution unit 120, the waiting time setting unit 360 and the determination unit 370 can be implemented, for example, in the following manner, that is, the central processing unit (CPU) etc. reads out the program stored in the storage device (storage unit 330) implemented by the read-only memory (ROM), non-volatile memory (NVRAM) etc. to the random access memory (RAM) etc. not shown for execution.

[0187] (Function block details)

[0188] The capability acquisition unit 310 acquires information ("performance information") indicating the performance Aby (processing capability) of the duplexed counterpart CPU unit, which is respectively related to the self-diagnosis process, the command execution process, and the I / O refresh process repeatedly executed by the process execution unit 120. Specifically, the capability acquisition unit 310 acquires the performance information of the counterpart CPU unit respectively related to the self-diagnosis process, the command execution process, and the I / O refresh process by referring to the local capability table 350 of the counterpart CPU unit. The capability acquisition unit 310 saves the acquired "performance information of the counterpart CPU unit respectively related to the self-diagnosis process, the command execution process, and the I / O refresh process (other machine performance information)" in the other machine capability table 340 of the own unit.

[0189] In particular, the capability acquisition unit 310 performs the self-diagnosis process, the command execution process, and the I / O refresh process before the process execution unit 120 repeatedly executes the self-diagnosis process, the command execution process, and the I / O refresh process in sequence. Figure 6 In the illustrated "duplex processing", the other machine performance information related to each processing is acquired once.

[0190] The capability acquisition unit 310 refers to the first local capability table 351 of the duplexed counterpart CPU unit to acquire "performance information (self-diagnosis other machine performance information) related to the self-diagnosis process and indicating the performance Aby of the duplexed counterpart CPU unit". The capability acquisition unit 310 saves the acquired self-diagnosis other machine performance information in the first other machine capability table 341 of the own unit.

[0191] The capability acquisition unit 310 refers to the second local capability table 352 of the duplexed counterpart CPU unit to acquire "performance information (other machine performance information for command execution) related to the command execution process and indicating the performance Aby of the duplexed counterpart CPU unit". The capability acquisition unit 310 saves the acquired other machine performance information for command execution into the second other machine capability table 342 of its own unit.

[0192] The capability acquisition unit 310 refers to the third local capability table 353 of the duplexed partner CPU unit to acquire "performance information (other machine performance information for I / O refresh) related to the I / O refresh process and indicating the performance Aby of the duplexed partner CPU unit". The capability acquisition unit 310 stores the acquired other machine performance information for I / O refresh in the third other machine capability table 343 of its own unit.

[0193] Figure 7 1 is a diagram for explaining a specific example of the process of "obtaining performance information indicating the performance Aby of the counterpart CPU unit through duplexing" which is executed once in the "duplex process". Figure 7 As shown, the capability acquisition unit 310A refers to the first local capability table 351B of the second CPU unit 300B to acquire "performance information (other machine performance information for self-diagnosis) indicating the performance Aby of the second CPU unit 300B related to the self-diagnosis process". The capability acquisition unit 310A saves the acquired other machine performance information for self-diagnosis into the first other machine capability table 341A of the own unit.

[0194] The capability acquisition unit 310B refers to the first local capability table 351A of the first CPU unit 300A to acquire "performance information (other machine performance information for self-diagnosis) indicating the performance Aby of the first CPU unit 300A related to the self-diagnosis process". The capability acquisition unit 310B saves the acquired other machine performance information for self-diagnosis into the first other machine capability table 341B of the own unit.

[0195] The capability acquisition unit 310A refers to the second local capability table 352B of the second CPU unit 300B to acquire "performance information (other machine performance information for command execution) indicating the performance Aby of the second CPU unit 300B related to the command execution process". The capability acquisition unit 310A saves the acquired other machine performance information for command execution into the second other machine capability table 342A of its own unit.

[0196] The capability acquisition unit 310B refers to the second local capability table 352A of the first CPU unit 300A to acquire "performance information (other machine performance information for command execution) indicating the performance Aby of the first CPU unit 300A related to the command execution process". The capability acquisition unit 310B saves the acquired other machine performance information for command execution into the second other machine capability table 342B of its own unit.

[0197] The capability acquisition unit 310A refers to the third local capability table 353B of the second CPU unit 300B to acquire "performance information (other machine performance information for I / O refresh processing) related to I / O refresh processing and indicating the performance Aby of the second CPU unit 300B". The capability acquisition unit 310A saves the acquired other machine performance information for I / O refresh processing in the third other machine capability table 343A of its own unit.

[0198] The capability acquisition unit 310B refers to the third local capability table 353A of the first CPU unit 300A to acquire "performance information (other machine performance information for I / O refresh processing) related to I / O refresh processing and indicating the performance Aby of the first CPU unit 300A". The capability acquisition unit 310B saves the acquired other machine performance information for I / O refresh processing into the third other machine capability table 343B of its own unit.

[0199] As described in Embodiment 1, the process execution unit 120 repeatedly executes the self-diagnosis process, the command execution process, and the I / O refresh process in sequence, and when each process is completed, writes to the shared register 200 that the unit has completed each process.

[0200] Furthermore, when the processing execution unit 120 completes the execution of each processing, it notifies the waiting time setting unit 360 and the determination unit 370 that "the execution of each processing has been completed by the processing unit itself". The processing execution unit 120 may also notify the waiting time setting unit 360 of the "execution time of each processing (the time from the start of execution to the completion of execution of each processing)" together with the "execution time of each processing" that "the execution of each processing has been completed by the processing unit itself". That is, the processing execution unit 120 may also use an internal timer to measure the "execution time of each processing" and notify the waiting time setting unit 360 of the measured "execution time of each processing".

[0201] The waiting time setting unit 360 obtains the performance information of the other machine by referring to the other machine capability table 340, and obtains the performance information of the local machine by referring to the local machine capability table 350. Furthermore, the waiting time setting unit 360 obtains the meaning of "the execution of each process has been completed by the own unit" from the processing execution unit 120. The waiting time setting unit 360 calculates the execution time of each process while obtaining the meaning of "the execution of each process has been completed by the own unit" from the processing execution unit 120 before obtaining the meaning of "the execution of each process has been completed by the own unit". That is, the waiting time setting unit 360 calculates the execution time of each process based on the time of "the execution of each process has been started by the own unit" measured by the internal timer and the time of "the execution of each process has been completed by the own unit" measured by the internal timer. In addition, the execution time of each process may be measured by the processing execution unit 120 using the internal timer, and the waiting time setting unit 360 may be notified from the processing execution unit 120 to the waiting time setting unit 360.

[0202] The waiting time setting unit 360 calculates the "waiting time Tw" for the synchronization check process on each process based on the acquired other machine performance information, the local machine performance information, and the execution time of each process, and notifies the calculated waiting time Tw to the determination unit 370. Specifically, the waiting time setting unit 360 calculates the "waiting time Tw" for the synchronization check process on each process as follows using the other machine performance information, the local machine performance information, and the execution time of each process.

[0203] That is, when the "performance Aby of the other CPU unit after duplexing" indicated by the other unit performance information is higher than the "performance Abm of the own unit" indicated by the own unit performance information, the waiting time setting unit 360 sets the "normal waiting time Two" to the "waiting time Tw". When the performance Aby of the other CPU unit after duplexing is equal to the performance Abm of the own unit, the waiting time setting unit 360 sets the "normal waiting time Two" to the "waiting time Tw".

[0204] The "normal waiting time Two" is a period of predetermined length common to the first CPU unit 300A and the second CPU unit 300B, which is set, for example, when each unit is shipped from the factory and can be updated by the user. The "normal waiting time Two" is a period set on the premise that the performance Ab (especially the performance Ab related to the self-diagnosis process, the command execution process, and the I / O refresh process) of the first CPU unit 300A and the second CPU unit 300B is equal.

[0205] When the performance Aby of the duplexed counterpart CPU unit is lower than the performance Abm of the own unit, the waiting time setting unit 360 sets the period obtained by multiplying the value obtained by dividing the performance Abm of the own unit by the performance Aby of the counterpart CPU unit by the execution time of each process as the "adjusted waiting time Ta". When the performance Aby of the duplexed counterpart CPU unit is lower than the performance Abm of the own unit, the waiting time setting unit 360 sets the "period obtained by adding the normal waiting time Two to the adjusted waiting time Ta (i.e., "normal waiting time Two + adjusted waiting time Ta")" as the "waiting time Tw".

[0206] <“Waiting Time” for Synchronous Check Processing Related to “Self-Diagnostic Processing”> The “waiting time Tw” for the synchronous check processing related to the “self-diagnostic processing” is set by the first waiting time setting unit 361 .

[0207] The first waiting time setting unit 361 obtains the other machine performance information for self-diagnosis by referring to the first other machine capability table 341, and obtains the self-diagnosis local machine performance information by referring to the first local machine capability table 351. Furthermore, the first waiting time setting unit 361 calculates the execution time of the self-diagnosis process based on the notification from the process execution unit 120 that "the self-diagnosis process has been started" and "the self-diagnosis process has been completed".

[0208] The first waiting time setting unit 361 calculates the "waiting time Tw" for the synchronization check process regarding the self-diagnosis process based on the acquired self-diagnosis other machine performance information and the self-diagnosis local machine performance information and the "self-diagnosis process execution time" obtained by AND operation.

[0209] Specifically, the first waiting time setting unit 361 calculates the "adjustment waiting time Ta related to the self-diagnosis process" by considering the ratio of "the performance Abm of the own unit related to the self-diagnosis process" to "the performance Aby of the other CPU unit via duplexing related to the self-diagnosis process". And, the first waiting time setting unit 361 sets the period obtained by adding the calculated "adjustment waiting time Ta related to the self-diagnosis process" to the "normal waiting time Two related to the self-diagnosis process" as the "waiting time Tw" used for the synchronization check process regarding the self-diagnosis process. When "Abm / Aby" is less than "1", the first waiting time setting unit 361 sets the "adjustment waiting time Ta related to the self-diagnosis process" to "0". When "Abm / Aby" is greater than "1", the first waiting time setting unit 361 sets the "adjustment waiting time Ta related to the self-diagnosis process" to "the value obtained by multiplying the execution time of the self-diagnosis process of the own unit by 'Abm / Aby'".

[0210] The first waiting time setting unit 361 notifies the determination unit 370 of the “waiting time Tw for the synchronization check process related to the self-diagnosis process” calculated by the above-described method.

[0211] <“Waiting Time” for Synchronization Check Processing Related to “Command Execution Processing”> The “waiting time Tw” for synchronization check processing related to “command execution processing” is set by the second waiting time setting unit 362 .

[0212] The second waiting time setting unit 362 obtains the other machine performance information for command execution by referring to the second other machine capability table 342, and obtains the local machine performance information for command execution by referring to the second local machine capability table 352. Furthermore, the second waiting time setting unit 362 calculates the execution time of the command execution process based on the notifications from the process execution unit 120 that "the own unit has started the execution of the command execution process" and "the own unit has completed the execution of the command execution process".

[0213] The second waiting time setting unit 362 calculates the "waiting time Tw" for the synchronization check process regarding the command execution process based on the acquired command execution other machine performance information and command execution local machine performance information and the "command execution process execution time" obtained by AND operation.

[0214] Specifically, the second waiting time setting unit 362 calculates the "adjusted waiting time Ta related to the command execution process" by considering the ratio of "the performance Abm of the own unit related to the command execution process" and "the performance Aby of the other CPU unit via duplexing related to the command execution process". And, the second waiting time setting unit 362 sets the period obtained by adding the calculated "adjusted waiting time Ta related to the command execution process" to the "normal waiting time Two related to the command execution process" as the "waiting time Tw" used for the synchronization check process regarding the command execution process. When "Abm / Aby" is less than "1", the second waiting time setting unit 362 sets the "adjusted waiting time Ta related to the command execution process" to "0". When "Abm / Aby" is greater than "1", the second waiting time setting unit 362 sets the "adjusted waiting time Ta related to the command execution process" to "the value obtained by multiplying the execution time of the command execution process of the own unit by 'Abm / Aby'".

[0215] The first waiting time setting unit 361 notifies the determination unit 370 of the “waiting time Tw for the synchronization check process for the command execution process” calculated by the above-described method.

[0216] <“Waiting Time” for Synchronization Check Processing Related to “I / O Refresh Processing”> The “waiting time Tw” for synchronization check processing related to “I / O refresh processing” is set by the third waiting time setting unit 363 .

[0217] The third waiting time setting unit 363 obtains the other machine performance information for I / O refresh by referring to the third other machine capability table 343, and obtains the local machine performance information for I / O refresh by referring to the third local machine capability table 353. Furthermore, the third waiting time setting unit 363 calculates the execution time of the I / O refresh process based on the notification from the process execution unit 120 that "the own unit has started the execution of the I / O refresh process" and "the own unit has completed the execution of the I / O refresh process".

[0218] The third waiting time setting unit 363 calculates the "waiting time Tw" for the synchronization check process regarding the I / O refresh process based on the acquired I / O refresh other machine performance information and the I / O refresh local machine performance information and the "I / O refresh process execution time" obtained by AND operation.

[0219] Specifically, the third waiting time setting unit 363 calculates the "adjusted waiting time Ta related to the I / O refresh process" in consideration of the ratio of "the performance Abm of the own unit related to the I / O refresh process" to "the performance Aby of the duplexed counterpart CPU unit related to the I / O refresh process". And, the third waiting time setting unit 363 sets the period obtained by adding the calculated "adjusted waiting time Ta related to the I / O refresh process" to the "normal waiting time Two related to the I / O refresh process" as the "waiting time Tw" used for the synchronization check process regarding the I / O refresh process. When "Abm / Aby" is less than "1", the third waiting time setting unit 363 sets the "adjusted waiting time Ta related to the I / O refresh process" to "0". When "Abm / Aby" is greater than "1", the third waiting time setting unit 363 sets the "adjusted waiting time Ta related to the I / O refresh process" to "the value obtained by multiplying the execution time of the I / O refresh process of the own unit by 'Abm / Aby'".

[0220] The third waiting time setting unit 363 notifies the determination unit 370 of the “waiting time Tw for the synchronization check process regarding the I / O refresh process” calculated by the above-described method.

[0221] The determination unit 370 performs synchronization check processing after the waiting time Tw notified from the waiting time setting unit 360 has passed from the time point "the execution of each process by the own unit has been completed". For example, the determination unit 370 refers to the shared register 200 at the time point "the execution of each process by the own unit has been completed" to confirm whether the execution of a certain process that has been completed by the own unit has been completed by the duplexed partner CPU unit.

[0222] The determination unit 370, which has been notified of the "normal waiting time Two + adjusted waiting time Ta" as the waiting time Tw, performs the standby process from the time point "the own unit has completed the execution of each process" until the adjusted waiting time Ta has passed. Furthermore, the determination unit 370 performs the synchronization check process after the execution of the standby process is completed (i.e., after the adjusted waiting time Ta has passed from the time point "the own unit has completed the execution of each process"). That is, the determination unit 370 determines "whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed until the normal waiting time Two has passed" after the execution of the standby process is completed. In other words, the determination unit 370 determines whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed from the time point of the completion of the execution of the standby process until the normal waiting time Two has passed.

[0223] The determination unit 370, which is informed of the "normal waiting time Two" as the waiting time Tw, immediately performs the synchronization check process at the time point "the own unit has completed the execution of each process". That is, the determination unit 370 determines "whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed until the normal waiting time Two has passed". In other words, the determination unit 370 determines whether it is possible to confirm that the other CPU unit has completed the execution of the process that the own unit has completed from the time point of the execution completion of the own unit until the normal waiting time Two has passed.

[0224] <Synchronous check processing related to "self-diagnostic processing"> The first determination unit 371 performs a synchronous check processing related to "self-diagnostic processing". That is, the first determination unit 371 confirms "whether the other CPU unit has completed the execution of the self-diagnostic processing" from the point in time when the execution of the self-diagnostic processing of the own unit is completed until the "waiting time Tw for self-diagnostic processing" notified from the first waiting time setting unit 361 has passed. If it is not confirmed that "the other CPU unit has completed the execution of the self-diagnostic processing" until the "waiting time Tw for self-diagnostic processing" has passed, the first determination unit 371 determines that an abnormality has occurred in the other CPU unit.

[0225] <Synchronous check processing related to "command execution processing"> The second determination unit 372 performs synchronous check processing related to "command execution processing". That is, the second determination unit 372 confirms "whether the other CPU unit has completed the execution of the command execution processing" from the point in time when the execution of the command execution processing of the own unit is completed until the "waiting time Tw for command execution processing" notified from the second waiting time setting unit 362 has passed. If it is not confirmed that "the other CPU unit has completed the execution of the command execution processing" until the "waiting time Tw for command execution processing" has passed, the second determination unit 372 determines that an abnormality has occurred in the other CPU unit.

[0226] <Synchronous check processing related to "I / O refresh processing"> The third determination unit 373 performs a synchronous check processing related to "I / O refresh processing". That is, the third determination unit 373 checks "whether the partner CPU unit has completed the execution of the I / O refresh processing" from the point in time when the execution of the I / O refresh processing of the own unit is completed until the "wait time Tw for the I / O refresh processing" notified from the third wait time setting unit 363 has passed. If it is not possible to confirm "whether the partner CPU unit has completed the execution of the command execution processing" until the "wait time Tw for the I / O refresh processing" has passed, the third determination unit 373 determines that an abnormality has occurred in the partner CPU unit.

[0227] The determination unit 370A refers to the second register 220 of the common register 200 to check whether there is a written message that "the execution of the processing execution unit 120B has been completed" with respect to a certain processing that the processing execution unit 120A has completed. If there is no written message that "the execution of the processing execution unit 120B has been completed" in the second register 220 with respect to a certain processing that the processing execution unit 120A has completed, the determination unit 370A determines that an abnormality has occurred in the second CPU unit 300B.

[0228] The determination unit 370B refers to the first register 210 of the common register 200 to check whether there is a written message that "the execution of the processing execution unit 120A has been completed" with respect to a certain processing that the processing execution unit 120B has completed. If there is no written message that "the execution of the processing execution unit 120A has been completed" in the first register 210 with respect to a certain processing that the processing execution unit 120B has completed, the determination unit 370B determines that an abnormality has occurred in the first CPU unit 300A.

[0229] (Details of storage unit)

[0230] The storage unit 330 is a storage device for storing various data used by the first CPU unit 300A and the second CPU unit 300B. In addition, the storage unit 330 may also store non-temporarily (1) control programs, (2) OS programs, (3) application programs for executing various functions of the first CPU unit 300A and the second CPU unit 300B, and (4) various data read when the application programs are executed. The data (1) to (4) are stored in a non-volatile storage device such as a read-only memory (ROM), a flash memory, an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM (registered trademark)), a hard disk drive (HDD), etc. The first CPU unit 300A and the second CPU unit 300B may each include a temporary storage unit (not shown). The temporary storage unit is a so-called working memory that temporarily stores data and operation results used for calculations during various processing processes performed by the first CPU unit 300A and the second CPU unit 300B, and includes volatile storage devices such as random access memory (RAM). Which data is stored in which storage device is appropriately determined based on the purpose of use, convenience, cost or physical limitations of the first CPU unit 300A and the second CPU unit 300B. The storage unit 330 also stores the other machine capability table 340 and the local machine capability table 350.

[0231] In the other machine capability table 340, information indicating the performance Aby (processing capability) of the other machine CPU unit through duplexing, that is, other machine performance information, is stored. Figure 3 As described above, the capability acquisition unit 310 stores the other machine performance information acquired by referring to the own machine capability table 350 of the partner CPU unit via duplexing in the other machine capability table 340 of its own unit.

[0232] The “performance information indicating the performance Aby of the duplexed partner CPU unit related to the self-diagnosis process” stored in the first local capability table 351 of the duplexed partner CPU unit is stored in the first other machine capability table 341 by the capability acquisition unit 310 .

[0233] The “performance information indicating the performance Aby of the duplexed partner CPU unit related to the command execution process” stored in the second local capability table 352 of the duplexed partner CPU unit is stored in the second other machine capability table 342 by the capability acquisition unit 310 .

[0234] The “performance information indicating the performance Aby of the duplexed partner CPU unit related to the I / O refresh process” stored in the third local capability table 353 of the duplexed partner CPU unit is stored in the third other machine capability table 343 by the capability acquisition unit 310 .

[0235] The local performance table 350 stores information indicating the performance Abm (processing capacity) of the own unit, that is, local performance information, for example, local performance information indicating "how much performance (processing capacity) the own unit has compared with the reference CPU unit". The local performance information is stored in the local performance table 350, for example, when the first CPU unit 300A and the second CPU unit 300B are shipped from their respective factories.

[0236] The first local capability table 351 stores “performance information indicating the performance Abm of the own unit related to the self-diagnosis process (especially the relative performance Abm to the performance Abb of the reference CPU unit related to the self-diagnosis process)”.

[0237] The second local capability table 352 stores “performance information indicating the performance Abm of the own unit related to the command execution process (especially the relative performance Abm to the “performance Abb of the reference CPU unit related to the command execution process”)”.

[0238] The third local capability table 353 stores “performance information indicating the performance Abm of the own unit related to I / O refresh processing (especially the relative performance Abm relative to the performance Abb of the reference CPU unit related to I / O refresh processing)”.

[0239] (About CPU unit arrangement)

[0240] About the use up to now Figure 4The first CPU unit 300A and the second CPU unit 300B, which have been described in detail, are organized as follows for ease of understanding. That is, the first CPU unit 300A and the second CPU unit 300B are duplexed CPU units in the PLC 20 (controller), similarly to the first CPU unit 100A and the second CPU unit 100B. The first CPU unit 300A and the second CPU unit 300B each include a waiting time setting unit 360 (setting unit) and a determination unit 370. The waiting time setting unit 360 sets the waiting time Tw by considering the ratio of the performance Abm (processing capacity) of the own unit to the performance Aby of the duplexed counterpart CPU unit. If the determination unit 370 cannot confirm that the execution of the processing of the counterpart CPU unit has been completed from the time point when the processing of the own unit is completed until the waiting time Tw set by the waiting time setting unit 360 has passed, it is determined that an abnormality has occurred in the counterpart CPU unit.

[0241] Therefore, the first CPU unit 300A and the second CPU unit 300B can set an appropriate waiting time Tw in consideration of the difference in performance Ab between the own unit and the counterpart CPU unit, similarly to the first CPU unit 100A and the second CPU unit 100B. That is, the first CPU unit 300A and the second CPU unit 300B can accurately perform synchronization check processing by taking into account the difference in performance Ab between the counterpart CPU unit and the own unit through duplexing without setting an unnecessary waiting time Tw.

[0242] In each of the first CPU unit 300A and the second CPU unit 300B, the processing (processing to be the object of synchronization check processing) includes self-diagnosis processing, command execution processing, and I / O refresh processing. The waiting time setting unit 360 (specifically, each of the first waiting time setting unit 361, the second waiting time setting unit 362, and the third waiting time setting unit 363) sets the waiting time Tw for each of the self-diagnosis processing, command execution processing, and I / O refresh processing. The determination unit 370 (specifically, each of the first determination unit 371, the second determination unit 372, and the third determination unit 373) performs the determination for each of the self-diagnosis processing, command execution processing, and I / O refresh processing, that is, performs synchronization check processing.

[0243] Each of the first CPU unit 300A and the second CPU unit 300B can determine the synchronization between the own unit and the counterpart CPU unit at the timing when the self-diagnosis process, the command execution process, and the I / O refresh process are completed.

[0244] The first CPU unit 300A and the second CPU unit 300B each perform a duplex process once before sequentially repeating the self-diagnosis process, the command execution process, and the I / O refresh process. The first CPU unit 300A and the second CPU unit 300B each obtain the performance Aby of the other CPU unit from the other CPU unit during the duplex process.

[0245] The following effect is achieved: the first CPU unit 300A and the second CPU unit 300B can each set the waiting time Tw used for the determination regarding the respective processes in consideration of the performance Aby of the counterpart CPU unit acquired before repeatedly executing the respective processes.

[0246] In each of the first CPU unit 300A and the second CPU unit 300B, the waiting time setting unit 360 sets the waiting time Tw for each of the self-diagnosis process, the command execution process, and the I / O refresh process as follows. That is, the waiting time setting unit 360 sets the waiting time Tw for each process in consideration of the ratio of the performance Abm of the own unit and the performance Aby of the counterpart CPU unit related to the execution of each of the self-diagnosis process, the command execution process, and the I / O refresh process. Specifically, the first waiting time setting unit 361 sets the waiting time Tw for the synchronization check process for the self-diagnosis process in consideration of the ratio of the performance Abm of the own unit and the performance Aby of the counterpart CPU unit related to the self-diagnosis process. The second waiting time setting unit 362 sets the waiting time Tw for the synchronization check process for the command execution process in consideration of the ratio of the performance Abm of the own unit and the performance Aby of the counterpart CPU unit related to the command execution process. The third waiting time setting unit 363 sets the waiting time Tw for the synchronization check process for the I / O refresh process in consideration of the ratio of the performance Abm of the own unit and the performance Aby of the counterpart CPU unit related to the I / O refresh process.

[0247] The first CPU unit 300A and the second CPU unit 300B each set the waiting time Tw for each process in consideration of the difference in performance Ab between the own unit and the counterpart CPU unit regarding the self-diagnosis process, the command execution process, and the I / O refresh process.

[0248] Therefore, the following effect is achieved: each of the first CPU unit 100A and the second CPU unit 100B can set the waiting time Tw for each process according to the performance Ab of the own unit and the partner CPU unit related to each process.

[0249] (run)

[0250] Figure 6300A and 300B are diagrams for explaining the outline of the processing executed by each of the first CPU unit 300A and the second CPU unit 300B. Figure 6 The processing performed by the first CPU unit 300A and the second CPU unit 300B is the same as that performed by the first CPU unit 300A and the second CPU unit 300B. Figure 2 The differences in the processing executed by the first CPU unit 100A and the second CPU unit 100B are as follows.

[0251] That is, the first CPU unit 300A and the second CPU unit 300B each grasp the performance Ab of the own unit and the partner CPU unit for each of the repeatedly executed self-diagnosis processing, command execution processing, and I / O refresh processing. And, the first CPU unit 300A and the second CPU unit 300B each use the performance Ab of the own unit and the partner CPU unit related to each processing to set the "wait time Tw" for the synchronization check processing of each processing. The first CPU unit 300A and the second CPU unit 300B each determine whether "the partner CPU unit has completed the execution of each processing" from the execution completion time point of each processing of the own unit until the "wait time Tw" for each processing has passed.

[0252] In other respects, “processing executed by each of the first CPU unit 300A and the second CPU unit 300B” is the same as “processing executed by each of the first CPU unit 100A and the second CPU unit 100B”.

[0253] That is, "the processing executed by the first CPU unit 300A and the second CPU unit 300B respectively" is a control method of the CPU unit through duplexing in the PLC 20 (controller), and includes a setting step and a determination step. The setting step is: considering the ratio of the performance Abm of the own unit to the performance Aby of the other CPU unit through duplexing, to set the waiting time Tw. The determination step is: if the completion of the execution of the processing in the other CPU unit cannot be confirmed from the time point when the processing of the own unit is completed until the waiting time Tw set in the setting step has passed, it is determined that an abnormality has occurred in the other CPU unit.

[0254] Therefore, the following effect is achieved: even when the performance Ab of the own unit and the other CPU unit is inconsistent, the appropriate waiting time Tw can be set in consideration of the difference in performance Ab between the own unit and the other CPU unit. That is, the following effect is achieved: the "processing executed by each of the first CPU unit 300A and the second CPU unit 300B" takes into account the difference in performance Ab between the own unit and the other CPU unit through duplexing, and unnecessary waiting time Tw is not set, and synchronization check processing can be accurately performed.

[0255] §4. Variations

[0256] So far, an example of the first CPU unit 100A and the second CPU unit 100B (or the first CPU unit 300A and the second CPU unit 300B) using the common register 200 to perform synchronization check processing has been described. However, the method of using the common register 200 is only an example of a method for implementing the synchronization check processing. The synchronization check processing can also be implemented, for example, by the following method, that is, the first CPU unit 100A and the second CPU unit 100B (or the first CPU unit 300A and the second CPU unit 300B) communicate using each other's serial ports while checking synchronization. The first CPU unit 100A and the second CPU unit 100B (or the first CPU unit 300A and the second CPU unit 300B) can also communicate using each other's serial ports while confirming that the execution of the processing of the other CPU unit has been completed.

[0257] Furthermore, the example in which the self-diagnosis process, the command execution process, and the I / O refresh process are repeatedly executed in sequence and the synchronization check process related to each of these processes is executed after the execution of each of these processes is completed has been described so far. However, in addition to the self-diagnosis process, the command execution process, and the I / O refresh process, other processes may be repeatedly executed in the same manner as the self-diagnosis process, the command execution process, and the I / O refresh process. In this case, the synchronization check process is also executed after the execution of the other processes is completed.

[0258] For example, in addition to the self-diagnosis process, the command execution process, and the I / O refresh process, the "other communication process" may be repeatedly executed, that is, the signal transmission and reception to a communication network different from the communication network for signal transmission and reception in the I / O refresh process may be performed. In other words, the self-diagnosis process, the command execution process, the I / O refresh process, and the other communication processes may be repeatedly executed in sequence, and after the execution of each of these processes is completed, the synchronization check process related to each of these processes may be executed.

[0259] 〔Example of implementation using software〕

[0260] The control blocks of the first CPU unit 100A, the second CPU unit 100B, the first CPU unit 300A and the second CPU unit 300B (especially the capability acquisition unit 110, the processing execution unit 120, the waiting time setting unit 160, the determination unit 170, the capability acquisition unit 310, the waiting time setting unit 360 and the determination unit 370) can be implemented by a logic circuit (hardware) formed on an integrated circuit (IC chip), etc., or can be implemented by software using a central processing unit (CPU).

[0261] In the latter case, the first CPU unit 100A, the second CPU unit 100B, the first CPU unit 300A, and the second CPU unit 300B each include a CPU that executes commands of software that realizes each function, that is, a program, a read-only memory (ROM) or a storage device (these are referred to as "recording medium") that records the program and various data readable by a computer (or CPU), and a random access memory (RAM) that expands the program. And, the program is read and executed from the recording medium by the computer (or CPU), thereby achieving the purpose of the present invention. As the recording medium, a "non-temporary tangible medium" can be used, for example, a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, etc. can be used. Moreover, the program can also be provided to the computer via any transmission medium (communication network or broadcast wave, etc.) that can transmit the program. In addition, the present invention can also be implemented in an embodiment of a data signal embedded in a carrier wave to materialize the program by electronic transmission.

[0262] (Notes)

[0263] The CPU unit of one embodiment of the present invention is a duplexed CPU unit in a controller, and the CPU unit includes: a setting unit, which sets a waiting time in consideration of the ratio of the processing capacity of the own unit to the processing capacity of the other CPU unit via duplexing; and a determination unit, which determines that an abnormality has occurred in the other CPU unit if completion of the execution of the processing in the other CPU unit cannot be confirmed from the time point when the processing of the own unit is completed until the waiting time set by the setting unit has passed.

[0264] According to the configuration, the CPU unit determines synchronization (i.e., matching of completed processing) between the own unit and the partner CPU unit using the waiting time set in consideration of the ratio of the processing capabilities of the own unit and the partner CPU unit.

[0265] For example, when the performance of the other CPU unit is higher than that of the own unit (i.e., the processing execution speed is faster), the CPU unit sets the predetermined "normal waiting time" as the waiting time. Furthermore, when the performance Ab of the other CPU unit is equal to that of the own unit, the control method sets the predetermined "normal waiting time" as the waiting time Tw.

[0266] When the performance of the other CPU unit is higher than that of the own unit, the other CPU unit should have completed the execution of a certain process at the time when the own unit has completed the execution of the certain process. In addition, when the performance Ab of the other CPU unit is equal to that of the own unit, the other CPU unit should have completed the execution of the certain process at the time when the own unit has completed the execution of the certain process.

[0267] Therefore, when the performance of the partner CPU unit is higher than that of the own unit, the CPU unit sets the "normal waiting time" as the waiting time, thereby being able to accurately determine whether an abnormality has occurred in the partner CPU unit.

[0268] For example, when the performance of the partner CPU unit is lower than that of the own unit (i.e., the processing execution speed is slow), the CPU unit sets "the period obtained by adding the adjusted waiting time taking into account the performance difference to the normal waiting time" as the waiting time. Specifically, "the difference between the time point at which the execution of the processing in the own unit is completed and the time point at which the execution of the processing in the partner CPU unit is expected to be completed" is set as the adjusted waiting time.

[0269] In the case where the performance of the partner CPU unit is lower than that of the own unit, the partner CPU unit has not yet completed the execution of a certain process at the time point when the own unit has completed the execution of the certain process. Therefore, the CPU unit waits until the "time point when the execution of the process in the partner CPU unit is expected to be completed", and then determines whether the completion of the execution of the process in the partner CPU unit can be confirmed until the "usual waiting time" has passed. That is, the CPU unit determines whether the completion of the execution of the process in the partner CPU unit can be confirmed from the time point when the execution of the process in the own unit is completed until the "period obtained by adding the adjusted waiting time to the normal waiting time" has passed.

[0270] Therefore, when the performance of the partner CPU unit is lower than that of the own unit, the CPU unit sets "a period obtained by adding the adjusted waiting time to the normal waiting time" as the waiting time, thereby being able to accurately perform the determination.

[0271] As described above, the CPU unit can set the appropriate waiting time in consideration of the difference in processing capacity between the CPU unit and the counterpart CPU unit even when the processing capacity of the CPU unit itself and the counterpart CPU unit are inconsistent. That is, the CPU unit can accurately perform synchronization check processing without setting an unnecessary waiting time in consideration of the difference in processing capacity between the counterpart CPU unit and the CPU unit through duplexing.

[0272] In the CPU unit of one embodiment of the present invention, the processing may include a self-diagnosis processing for diagnosing whether the hardware of the own unit has abnormalities, a command execution processing for generating a signal for controlling an external device other than the partner CPU unit, and an I / O refresh processing for exchanging data with an external device other than the partner CPU unit, the setting unit sets the waiting time for each of the self-diagnosis processing, the command execution processing, and the I / O refresh processing, and the determination unit performs the determination for each of the self-diagnosis processing, the command execution processing, and the I / O refresh processing.

[0273] According to the above configuration, the CPU unit determines synchronization between the CPU unit and the partner CPU unit (that is, consistency of the executed processes) in the self-diagnosis process, the command execution process, and the I / O refresh process.

[0274] Therefore, there is an effect that the CPU unit can determine the synchronization between the CPU unit and the partner CPU unit at the timing when the self-diagnosis process, the command execution process, and the I / O refresh process are each completed.

[0275] Alternatively, the CPU unit of an embodiment of the present invention may perform a duplex process before repeatedly performing the self-diagnosis process, the command execution process and the I / O refresh process in sequence, wherein the duplex process is a process of obtaining the processing capacity of the other CPU unit from the other CPU unit.

[0276] According to the configuration, the CPU unit acquires the processing capacity of the partner CPU unit once before sequentially and repeatedly executing the self-diagnosis processing, the command execution processing, and the I / O refresh processing. Furthermore, the CPU unit sets the waiting time for the determination regarding each of the processing in consideration of the ratio of the acquired processing capacity of the partner CPU unit to the processing capacity of the CPU unit itself.

[0277] Therefore, there is an effect that the CPU unit can set the waiting time for the determination regarding each of the processes in consideration of the processing capacity of the counterpart CPU unit acquired in advance before repeatedly executing each of the processes.

[0278] In the CPU unit of one embodiment of the present invention, the setting unit may set the waiting time for the self-diagnosis processing, the command execution processing and the I / O refresh processing respectively, taking into account the ratio of the processing capacity of the own unit to the processing capacity of the other CPU unit in relation to the execution of each of the self-diagnosis processing, the command execution processing and the I / O refresh processing.

[0279] According to the configuration, the CPU unit sets the waiting time for each process in consideration of the difference in processing capabilities between the CPU unit itself and the partner CPU unit in relation to execution of each of the self-diagnosis process, the command execution process and the I / O refresh process.

[0280] Therefore, the CPU unit can set the waiting time for the self-diagnosis process, the command execution process, and the I / O refresh process according to the processing capabilities of the CPU unit and the partner CPU unit related to each process.

[0281] A control method according to an embodiment of the present invention is a control method for a duplexed CPU unit in a controller, the control method comprising: a setting step, setting a waiting time by taking into account the ratio of the processing capability of the own unit to the processing capability of the other CPU unit via duplexing; and a determination step, if completion of the execution of the processing in the other CPU unit cannot be confirmed from the time point when the processing of the own unit is completed until the waiting time set in the setting step has passed, it is determined that an abnormality has occurred in the other CPU unit.

[0282] According to the method, the control method determines synchronization of the own unit and the partner CPU unit (i.e., agreement of executed completed processes) using the waiting time set in consideration of the ratio of the processing capabilities of the own unit and the partner CPU unit.

[0283] For example, when the performance of the partner CPU unit is higher than that of the own unit (i.e., the processing execution speed is faster), the control method sets the predetermined "normal waiting time" as the waiting time. Furthermore, when the performance Ab of the partner CPU unit is equal to that of the own unit, the control method sets the predetermined "normal waiting time" as the waiting time Tw.

[0284] When the performance of the other CPU unit is higher than that of the own unit, the other CPU unit should have completed the execution of a certain process at the time when the own unit has completed the execution of the certain process. In addition, when the performance Ab of the other CPU unit is equal to that of the own unit, the other CPU unit should have completed the execution of the certain process at the time when the own unit has completed the execution of the certain process.

[0285] Therefore, when the performance of the partner CPU unit is higher than that of the own unit, the control method sets the "normal waiting time" as the waiting time, thereby accurately determining whether an abnormality has occurred in the partner CPU unit.

[0286] For example, when the performance of the partner CPU unit is lower than that of the own unit (i.e., the processing execution speed is slow), the control method sets "a period obtained by adding the adjusted waiting time considering the performance difference to the normal waiting time" as the waiting time. Specifically, "the difference between the time point at which the execution of the processing in the own unit is completed and the time point at which the execution of the processing in the partner CPU unit is expected to be completed" is set as the adjusted waiting time.

[0287] In the case where the performance of the partner CPU unit is lower than that of the own unit, the partner CPU unit has not yet completed the execution of a certain process at the time point when the own unit has completed the execution of the certain process. Therefore, the control method waits until the "time point when the execution of the process in the partner CPU unit is expected to be completed", and then determines whether the completion of the execution of the process in the partner CPU unit can be confirmed until the "usual waiting time" has passed. That is, the control method determines whether the completion of the execution of the process in the partner CPU unit can be confirmed from the time point when the execution of the process in the own unit is completed until the "period obtained by adding the adjusted waiting time to the usual waiting time" has passed.

[0288] Therefore, when the performance of the partner CPU unit is lower than that of the own unit, the control method sets "a period obtained by adding the adjusted waiting time to the normal waiting time" as the waiting time, thereby making it possible to accurately perform the determination.

[0289] As described above, the control method can set the appropriate waiting time in consideration of the difference in processing capacity between the own unit and the other CPU unit even when the processing capacity of the own unit and the other CPU unit is inconsistent. That is, the control method can accurately perform synchronization check processing without setting unnecessary waiting time in consideration of the difference in processing capacity between the duplexed other CPU unit and the own unit.

[0290] The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope of the claims. Embodiments obtained by appropriately combining technical components disclosed in different embodiments are also included in the technical scope of the present invention.

Claims

1. A central processing unit (CPU) is a duplexed CPU in a controller, the CPU comprising: a setting unit that sets a waiting time in consideration of a ratio of a processing capability of the own unit to a processing capability of a duplexed counterpart central processing unit; as well as The determination unit determines that an abnormality has occurred in the partner CPU unit if the completion of the processing in the partner CPU unit cannot be confirmed from the time when the processing in the own unit is completed until the waiting time set by the setting unit has passed, wherein The processing includes self-diagnosis processing for diagnosing whether the hardware of the own unit has abnormalities, command execution processing for generating signals for controlling external devices other than the partner CPU unit, and input / output refresh processing for exchanging data with external devices other than the partner CPU unit. The setting unit sets the waiting time for each of the self-diagnosis process, the command execution process, and the input / output refresh process. The determination section performs the determination on each of the self-diagnostic process, the command execution process, and the input / output refresh process.

2. The central processing unit according to claim 1, wherein Before the self-diagnosis process, the command execution process, and the input / output refresh process are sequentially and repeatedly executed, a duplex process is executed once. The duplex process is a process of acquiring the processing capability of the counterpart CPU unit from the counterpart CPU unit.

3. The central processing unit according to claim 1 or 2, wherein The setting unit sets the waiting time for each of the self-diagnosis processing, the command execution processing, and the input / output refresh processing, taking into account the ratio of the processing capacity of the own unit to the processing capacity of the other party's central processing unit in relation to the execution of each of the self-diagnosis processing, the command execution processing, and the input / output refresh processing.

4. A control method is a control method for a duplexed central processing unit in a controller, the control method comprising: A setting step of setting the waiting time in consideration of a ratio of the processing capability of the own unit to the processing capability of the other party's central processing unit via duplexing; as well as In the determination step, if the completion of the processing in the counterpart CPU unit cannot be confirmed from the point in time when the processing in the own unit is completed until the waiting time set in the setting step has passed, it is determined that an abnormality has occurred in the counterpart CPU unit, wherein The processing includes self-diagnosis processing for diagnosing whether the hardware of the own unit has abnormalities, command execution processing for generating signals for controlling external devices other than the partner CPU unit, and input / output refresh processing for exchanging data with external devices other than the partner CPU unit. The setting step sets the waiting time for each of the self-diagnosis process, the command execution process, and the input / output refresh process. The determination step performs the determination on each of the self-diagnosis process, the command execution process, and the input / output refresh process.

5. A computer-readable recording medium having recorded thereon an information processing program for causing a computer to function as the central processing unit according to claim 1 or 2, wherein: The information processing program is used to make the computer function as each unit.