JP7028124B2 - CPU unit, CPU unit control method, information processing program, and recording medium - Google Patents

CPU unit, CPU unit control method, information processing program, and recording medium Download PDF

Info

Publication number
JP7028124B2
JP7028124B2 JP2018179162A JP2018179162A JP7028124B2 JP 7028124 B2 JP7028124 B2 JP 7028124B2 JP 2018179162 A JP2018179162 A JP 2018179162A JP 2018179162 A JP2018179162 A JP 2018179162A JP 7028124 B2 JP7028124 B2 JP 7028124B2
Authority
JP
Japan
Prior art keywords
unit
cpu unit
execution
cpu
waiting time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018179162A
Other languages
Japanese (ja)
Other versions
JP2020052550A (en
Inventor
英男 桶田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp filed Critical Omron Corp
Priority to JP2018179162A priority Critical patent/JP7028124B2/en
Priority to PCT/JP2019/036311 priority patent/WO2020066737A1/en
Priority to CN201980051961.6A priority patent/CN112534411A/en
Publication of JP2020052550A publication Critical patent/JP2020052550A/en
Application granted granted Critical
Publication of JP7028124B2 publication Critical patent/JP7028124B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B9/00Safety arrangements
    • G05B9/02Safety arrangements electric
    • G05B9/03Safety arrangements electric with multiple-channel loop, i.e. redundant control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements

Description

本発明は、コントローラにおいて二重化されるCPUユニット等に関する。 The present invention relates to a CPU unit or the like that is duplicated in a controller.

従来、PLC(プログラマブル・ロジック・コントローラ、Programmable Logic Controller)について、システムの安全性、信頼性を向上すること等を目的として、CPUユニットを二重化する構成が知られている。例えば、下掲の特許文献1には、二重化運転開始に先立ち、実行系のCPUユニットが、待機系のCPUユニットのユニットバージョンを取得し、自己が記憶保持する機能バージョンと比較して、ユニットバージョンが機能バージョン以上である場合に二重化運転可能と判断する構成が開示されている。以下、図8および図9を参照して、PLCにおけるCPUユニットの、従来までの二重化について説明する。 Conventionally, with respect to PLC (Programmable Logic Controller), a configuration in which a CPU unit is duplicated is known for the purpose of improving the safety and reliability of the system. For example, in Patent Document 1 below, the CPU unit of the executing system acquires the unit version of the CPU unit of the standby system prior to the start of the redundant operation, and the unit version is compared with the functional version that is stored and retained by itself. Discloses a configuration that determines that duplicate operation is possible when is a functional version or higher. Hereinafter, the conventional duplication of the CPU unit in the PLC will be described with reference to FIGS. 8 and 9.

図8は、PLCにおいて二重化されたCPUユニットの、従来までの処理の概要を説明する図である。図8に例示するように、PLCにおいて二重化されたCPUユニットの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順に繰り返し実行する。I/Oリフレッシュ処理が実行されてから、次のI/Oリフレッシュ処理が実行されるまでを「1サイクル(1周期)」とも称する。つまり、PLCにおいて二重化されたCPUユニットの各々は、「1サイクル(1周期)」において、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で実行する。「1サイクル」に要する期間(つまり、I/Oリフレッシュ処理が実行されてから、次のI/Oリフレッシュが実行されるまでの期間)を、「サイクルタイム」とも称する。 FIG. 8 is a diagram illustrating an outline of conventional processing of the CPU unit duplicated in the PLC. As illustrated in FIG. 8, each of the CPU units duplicated in the PLC repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. The period from the execution of the I / O refresh process to the execution of the next I / O refresh process is also referred to as "1 cycle (1 cycle)". That is, each of the CPU units duplicated in the PLC executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order in "1 cycle (1 cycle)". The period required for "one cycle" (that is, the period from the execution of the I / O refresh process to the execution of the next I / O refresh) is also referred to as "cycle time".

自己診断処理は、自ユニットのハードウェアが正常に動作しているか、特にメモリおよびハードディスク等に異常がないかを診断する処理である。命令実行処理は、ユーザプログラム等を実行する処理であり、前の周期において実行されたI/Oリフレッシュ処理で取得したデータを用いて各種の演算を実行し、現在の周期におけるI/Oリフレッシュ処理で出力するデータを生成する処理である。I/Oリフレッシュ処理は、二重化された相手方のCPUユニット以外の、外部装置および外部ユニットとのデータ交換を実行する処理であり、直前の命令実行処理で生成されたデータを出力し、次の周期の命令実行処理に用いるデータを取得する処理である。 The self-diagnosis process is a process of diagnosing whether the hardware of the own unit is operating normally, and in particular, whether there is an abnormality in the memory, the hard disk, or the like. The instruction execution process is a process for executing a user program or the like, and various operations are executed using the data acquired in the I / O refresh process executed in the previous cycle, and the I / O refresh process in the current cycle is executed. It is a process to generate the data to be output in. The I / O refresh process is a process for executing data exchange with an external device and an external unit other than the duplicated CPU unit of the other party, outputs the data generated in the immediately preceding instruction execution process, and has the next cycle. This is the process of acquiring the data used for the instruction execution process of.

PLCにおいて二重化されるCPUユニットは、一方が実行系とされ、他方が待機系(STB)とされ、互いに、二重化された相手方のCPUユニットの状態を確認する。そして、前記実行系のCPUユニットがダウンした場合、前記待機系のCPUユニットが、ダウンした前記実行系のCPUユニットに切り替わって、運転を継続する。以下、実行系とされたCPUユニットを「ACT」と略記し、待機系とされたCPUユニットを「STB」と略記することがある。 One of the CPU units to be duplicated in the PLC is the execution system and the other is the standby system (STB), and the state of the duplicated CPU unit of the other party is confirmed with each other. Then, when the CPU unit of the execution system goes down, the CPU unit of the standby system switches to the down CPU unit of the execution system and continues the operation. Hereinafter, the CPU unit as an active system may be abbreviated as "ACT", and the CPU unit as a standby system may be abbreviated as "STB".

ACTがダウンした場合のACTからSTBへの切替をスムーズに行なうため、ACTとSTBとは、図8に示すように、各CPUユニットの内部処理の途中で、同期をとっている。すなわち、ACTとSTBとの各々は、自ユニットが、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了したタイミングで、二重化される相手方のユニットに異常が発生していないことを確認する。自ユニットが、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了したタイミングで実行する、「二重化される相手方のユニットに異常が発生していないことの確認処理」を、「同期チェック処理」とも称する。 As shown in FIG. 8, the ACT and the STB are synchronized in the middle of the internal processing of each CPU unit in order to smoothly switch from the ACT to the STB when the ACT goes down. That is, in each of the ACT and STB, an abnormality occurs in the other unit to be duplicated at the timing when the own unit completes the execution of each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. Make sure you haven't. "Confirmation processing that no abnormality has occurred in the other party's unit to be duplicated" that is executed when the own unit completes the execution of each of the self-diagnosis processing, instruction execution processing, and I / O refresh processing. Is also referred to as "synchronous check processing".

内部処理の途中で同期をとることによって、各CPUユニットのサイクル(より正確には、各CPUユニットの内部処理の開始時刻)はずれることがなく、二重化されるCPUユニットは、同一の処理を同じタイミングで実行することができる。ACTとSTBとの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行完了時点で、同期チェック処理を実行し、同期(つまり、相手方のユニットに異常が発生していないこと)を確認してから、次の処理の実行を開始する。したがって、ACTとSTBとの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を、同じタイミングで開始することができる。 By synchronizing in the middle of the internal processing, the cycle of each CPU unit (more accurately, the start time of the internal processing of each CPU unit) does not deviate, and the CPU units to be duplicated perform the same processing at the same timing. Can be done with. Each of the ACT and STB executes a synchronization check process at the completion of each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process, and synchronization (that is, an abnormality occurs in the other unit). After confirming that it has not been executed, the execution of the next process is started. Therefore, each of the ACT and the STB can start each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process at the same timing.

ACTおよびSTBの各々は、基本的に、この同期チェック処理において、互いに相手の状態を監視し(言い換えれば、確認し)、ACTが異常停止していれば、STBが、異常停止したACTに代わって、運転を引き継ぐ。 Each of the ACT and STB basically monitors the state of the other party (in other words, confirms) in this synchronization check process, and if the ACT is abnormally stopped, the STB replaces the abnormally stopped ACT. And take over the driving.

ここで、「ACTまたはSTBが、同期対象(つまり、二重化された相手方のCPUユニット)の異常を検知できない(特に、ACTがSTBの異常を検知できない)」場合を想定して、ACTおよびSTBの各々は、以下のように同期チェック処理を実行する。すなわち、ACTおよびSTBの各々は、各同期チェック処理において、相手方のCPUユニットの応答を所定期間内に取得できなかった場合、「二重化された相手方のCPUユニットに異常が発生した(つまり、同期エラーが発生した)」と判定する。具体的には、ACTおよびSTBの各々は、各同期チェック処理において、相手方のCPUユニットから「対応する処理の実行を完了した」旨の通知を、判定期間内に取得できなかった場合、「二重化された相手方のCPUユニットに異常が発生した」と判定する。 Here, assuming the case where "ACT or STB cannot detect an abnormality of the synchronization target (that is, the duplicated CPU unit of the other party) (in particular, ACT cannot detect an abnormality of STB)", the ACT and STB Each executes the synchronization check process as follows. That is, if each of the ACT and STB cannot acquire the response of the other CPU unit within a predetermined period in each synchronization check process, "an error has occurred in the duplicated CPU unit of the other party (that is, a synchronization error). Has occurred) ”. Specifically, each of the ACT and STB is "duplicated" when the notification that "the execution of the corresponding process is completed" cannot be obtained from the CPU unit of the other party in each synchronization check process within the determination period. An error has occurred in the CPU unit of the other party. "

「二重化された相手方のCPUユニットに異常が発生した」と判定すると、ACTおよびSTBの各々は、「二重化を解除する」処理を実行する。「二重化を解除する」ことによって、ACTおよびSTBの各々は、「異常が発生した相手方のCPUユニットとの同期を維持することによって、サイクルタイムが極端に長くなる」ことを防止している。二重化を解除しない場合、つまり、「相手方のユニットに異常が発生していないことを確認できるまで、次の処理の実行を開始しない」場合、相手方のCPUユニットに異常が発生すると、「相手方のユニットに異常が発生していないこと」の確認ができない。そのため、次の処理の実行を開始できず、サイクルタイムが極端に長くなる。 When it is determined that "an abnormality has occurred in the CPU unit of the other party to be duplicated", each of the ACT and STB executes the process of "removing the duplication". By "removing the duplication", each of the ACT and the STB prevents "the cycle time becomes extremely long by maintaining the synchronization with the CPU unit of the other party in which the abnormality has occurred". If the duplication is not canceled, that is, "the execution of the next process is not started until it can be confirmed that the other party's unit has not occurred", and if the other party's CPU unit has an error, "the other party's unit" It cannot be confirmed that there is no abnormality in the CPU. Therefore, the execution of the next process cannot be started, and the cycle time becomes extremely long.

図9は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行完了時点で実行される同期チェック処理の詳細を説明する図である。前述の通り、同期チェック処理において、ACTおよびSTBの各々は、相手方のCPUユニットから「対応する処理の実行を完了した」旨の通知を、判定期間内に取得できたかを確認する。 FIG. 9 is a diagram illustrating details of a synchronization check process executed at the time when each of the self-diagnosis process, the instruction execution process, and the I / O refresh process is completed. As described above, in the synchronization check process, each of the ACT and the STB confirms whether or not the notification to the effect that "the execution of the corresponding process has been completed" can be obtained from the CPU unit of the other party within the determination period.

同期チェック処理は、例えば、PLCにおいて二重化されるCPUユニット(つまり、ACTおよびSTB)の各々の内部、または、外部に、各CPUユニットが互いに読み書きすることのできるレジスタ(共通レジスタ)を設けることにより、実現できる。各CPUユニットは、同期チェック処理までの処理が完了した時点で、つまり、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行完了時点で、「自ユニットが、処理の実行を完了した」旨を、共通レジスタに書き込む。各CPUユニットは、相手方のCPUユニットによって共通レジスタに書き込まれた、「自ユニットが、処理の実行を完了した」旨を読込むことによって、相手方のCPUユニットが、処理の実行を完了したことを確認する。 The synchronization check process is performed, for example, by providing a register (common register) that each CPU unit can read and write to each other inside or outside each of the CPU units (that is, ACT and STB) to be duplicated in the PLC. ,realizable. Each CPU unit "executes the process by its own unit" at the time when the processes up to the synchronization check process are completed, that is, at the time when each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process is completed. Is completed. ”Written to the common register. Each CPU unit reads that "the own unit has completed the execution of the process" written in the common register by the CPU unit of the other party, thereby indicating that the CPU unit of the other party has completed the execution of the process. confirm.

すなわち、図9に例示するように、CPUユニット99Pは、処理を完了すると、つまり、処理の実行を完了すると、共通レジスタ98のREG1に、処理が完了したこと(つまり、「自ユニットが、処理の実行を完了した」旨)を書き込む。CPUユニット99Qは、REG1を読み出すことで、CPUユニット99Pが処理を完了したことを認識する。また、CPUユニット99Qは、処理を完了すると、つまり、処理の実行を完了すると、共通レジスタ98のREG2に、処理が完了したこと(つまり、「自ユニットが、処理の実行を完了した」旨)を書き込む。CPUユニット99Pは、REG2を読み出すことで、CPUユニット99Qが処理を完了したことを認識する。CPUユニット99PとCPUユニット99Qとが互いに処理完了を認識したら、CPUユニット99PとCPUユニット99Qとは各々、次の処理に移行する。 That is, as illustrated in FIG. 9, when the CPU unit 99P completes the processing, that is, when the execution of the processing is completed, the processing is completed in REG1 of the common register 98 (that is, "the own unit processes". The execution of "Completed") is written. The CPU unit 99Q recognizes that the processing is completed by the CPU unit 99P by reading the REG1. Further, when the CPU unit 99Q completes the processing, that is, when the processing execution is completed, the processing is completed in REG2 of the common register 98 (that is, "the own unit has completed the processing execution"). To write. By reading REG2, the CPU unit 99P recognizes that the processing has been completed by the CPU unit 99Q. When the CPU unit 99P and the CPU unit 99Q recognize each other that the processing is completed, the CPU unit 99P and the CPU unit 99Q move to the next processing, respectively.

共通レジスタ98を利用する同期チェック処理を採用した場合、相手方のCPUユニットに異常が発生すると、相手方のCPUユニットによる「自ユニットが、処理の実行を完了した」旨は、共通レジスタ98に書き込まれない。そこで、各CPUユニットは、自ユニットによる処理の実行完了の時点から所定期間待機した後に、共通レジスタ98への、相手方のCPUユニットによる「自ユニットが、処理の実行を完了した」旨の書込みの有無を判定する。例えば、CPUユニット99Pは、CPUユニット99Pが処理の実行を完了した時点から所定期間経過しても、REG2に、「自ユニットが、処理の実行を完了した」旨が書き込まれないと、CPUユニット99Qに異常が発生したと判定する。CPUユニット99Qは、CPUユニット99Qが処理の実行を完了した時点から所定期間経過しても、REG1に、「自ユニットが、処理の実行を完了した」旨が書き込まれないと、CPUユニット99Pに異常が発生したと判定する。以下の説明においては、各CPUユニットが、自ユニットによる処理の実行完了の時点から、相手方のCPUユニットによる「自ユニットが、処理の実行を完了した」旨の書込みの有無を判定するまでの、前記所定期間を、「待ち時間」とも称する。 When the synchronization check process using the common register 98 is adopted and an error occurs in the CPU unit of the other party, the fact that "the own unit has completed the execution of the process" by the CPU unit of the other party is written in the common register 98. do not have. Therefore, each CPU unit waits for a predetermined period from the time when the execution of the processing by the own unit is completed, and then writes to the common register 98 to the effect that "the own unit has completed the execution of the processing" by the CPU unit of the other party. Determine the presence or absence. For example, the CPU unit 99P does not write to REG2 that "the own unit has completed the execution of the process" even after a predetermined period has elapsed from the time when the CPU unit 99P completes the execution of the process. It is determined that an abnormality has occurred in 99Q. Even if a predetermined period has elapsed from the time when the CPU unit 99Q completes the execution of the process, the CPU unit 99Q does not write to the CPU unit 99P that "the own unit has completed the execution of the process" to the REG1. Judge that an abnormality has occurred. In the following description, each CPU unit determines whether or not the other CPU unit has written "the own unit has completed the execution of the process" from the time when the execution of the process by the own unit is completed. The predetermined period is also referred to as "waiting time".

特開2005-122716号公報Japanese Unexamined Patent Publication No. 2005-122716

上述のような従来技術には、PLCにおいて二重化されるCPUユニットのハードウェアがほぼ同一であることを、つまり、両者がほぼ同一の処理能力を備えていることを前提としており、両者の処理能力が異なる場合を想定できていないという問題がある。 The conventional technology as described above is based on the premise that the hardware of the CPU unit to be duplicated in the PLC is almost the same, that is, both have almost the same processing power, and both have the processing power. There is a problem that it is not possible to assume different cases.

従来、二重化されるCPUユニットの処理能力はほぼ同一であるとの前提の下、各CPUユニットは、自ユニットによる処理の実行完了の時点から、二重化されるCPUユニットで共通の「待ち時間」が経過した後に、相手方のCPUユニットの異常を判定する。 Conventionally, on the premise that the processing capacity of the duplicated CPU units is almost the same, each CPU unit has a common "waiting time" among the duplicated CPU units from the time when the execution of the processing by the own unit is completed. After that, the abnormality of the CPU unit of the other party is determined.

二重化される従来までのCPUユニットが、共通の「待ち時間」を用いて、同期チェック処理を行なうのは、以下の理由からである。すなわち、二重化されるCPUユニットの処理能力が同一であるとの前提の下では、二重化されるCPUユニットによる処理の実行完了の時点は、ほぼ同じタイミングとなるはずである。言い換えれば、自ユニットと、二重化される相手方のCPUユニットとの処理能力が同一であるとの前提の下では、自ユニットによる処理の実行完了の時点と、相手方のCPUユニットによる処理の実行完了の時点とは、ほぼ同じタイミングとなるはずである。そのため、二重化されるCPUユニットの各々において、相手方のCPUユニットの異常を判定するのに用いられる、つまり、同期チェック処理に用いられる、「待ち時間」は、従来、二重化されるCPUユニットで共通の、長さの固定された期間であった。 The reason why the conventional CPU units to be duplicated perform the synchronization check process using the common "waiting time" is as follows. That is, under the premise that the processing capabilities of the duplicated CPU units are the same, the time points at which the execution of the processing by the duplicated CPU units is completed should be approximately the same timing. In other words, under the premise that the processing capacity of the own unit and the CPU unit of the other party to be duplicated are the same, the time when the execution of the processing by the own unit is completed and the execution of the processing by the CPU unit of the other party are completed. It should be about the same timing as the time point. Therefore, in each of the CPU units to be duplicated, the "waiting time" used to determine the abnormality of the CPU unit of the other party, that is, used for the synchronization check process, is conventionally common to the CPU units to be duplicated. It was a fixed period of length.

しかしながら、CPUユニットは、例えば約20年以上の長期間にわたって使用されるケースが多く、その間に、CPUユニットに用いられている部品が生産中止されるなどして、CPUユニットについて大幅なリニューアルが実施されることがある。そして、例えばCPUユニットのハードウェアを大幅にリニューアルした場合、リニューアルの前後でCPUユニットの性能が、つまり、処理能力が、大きく変化することが考えられる。 However, the CPU unit is often used for a long period of time, for example, about 20 years or more, and during that time, the parts used in the CPU unit are discontinued, and the CPU unit is significantly renewed. May be done. Then, for example, when the hardware of the CPU unit is significantly renewed, it is conceivable that the performance of the CPU unit, that is, the processing capacity, changes significantly before and after the renewal.

そして、リニューアル前のCPUユニットと、リニューアル後のCPUユニットとを二重化した場合、同期チェック処理に用いられる「待ち時間」を、二重化されるCPUユニットで共通とすると、同期チェック処理を正しく実行できない等の問題が発生する。 When the CPU unit before the renewal and the CPU unit after the renewal are duplicated, if the "waiting time" used for the synchronization check process is common to the duplicated CPU units, the synchronization check process cannot be executed correctly, etc. Problem occurs.

(誤判定の発生)
すなわち、同じ処理であっても、リニューアル前のCPUユニットと、リニューアル後のCPUユニットとでは実行完了の時点が異なるため、共通の「待ち時間」後に判定を実行すると、相手方のCPUユニットが正常に動作していても、異常と誤判定してしまう。
(Occurrence of erroneous judgment)
That is, even if the processing is the same, the CPU unit before the renewal and the CPU unit after the renewal have different execution completion points. Therefore, if the determination is executed after the common "waiting time", the CPU unit of the other party normally operates. Even if it is operating, it will be erroneously determined as abnormal.

例えば、リニューアルによってリニューアル前に比べ処理能力が4倍に増加した場合、或る処理の実行に要する期間は、リニューアル後のCPUユニットが約「10ms(ミリ秒)」であれば、リニューアル前のCPUユニットは約「40ms」となる。そして、リニューアル前のCPUユニットと、リニューアル後のCPUユニットとで、同期チェック処理に用いる「待ち時間」を、両ユニットに共通の、「5ms」に固定すると、リニューアル後のCPUユニットは、以下の判定を行ってしまう。 For example, if the processing capacity is increased four times as much as before the renewal due to the renewal, and the CPU unit after the renewal is about "10 ms (milliseconds)" for the period required to execute a certain process, the CPU before the renewal is performed. The unit will be about "40ms". Then, if the "waiting time" used for the synchronization check process between the CPU unit before the renewal and the CPU unit after the renewal is fixed to "5 ms" which is common to both units, the CPU unit after the renewal is as follows. It makes a judgment.

すなわち、リニューアル後のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から「5ms」経過した時点で、同期を、つまり、リニューアル前のCPUユニットが、前記或る処理の実行を完了しているかを、判定する。しかしながら、リニューアル前のCPUユニットは、「リニューアル後のCPUユニットが前記或る処理の実行を完了した時点」から「30ms」経過した後でないと、前記或る処理の実行を完了することができない。そのため、リニューアル後のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から5ms経過した時点では、リニューアル前のCPUユニットから、「リニューアル前のCPUユニットが前記或る処理の実行を完了した」旨の通知を取得できない。したがって、リニューアル後のCPUユニットは、リニューアル前のCPUユニットが正常に動作している場合であっても、「リニューアル前のCPUユニットに異常が発生した(つまり、同期エラーが発生した)」と誤って判定してしまう。 That is, the CPU unit after the renewal synchronizes when "5 ms" has elapsed from the time when the own unit completes the execution of the certain process, that is, the CPU unit before the renewal executes the certain process. Determine if it is complete. However, the CPU unit before the renewal can complete the execution of the certain process only after "30 ms" has elapsed from "the time when the CPU unit after the renewal completes the execution of the certain process". Therefore, when 5 ms has elapsed from the time when the own unit completes the execution of the certain process, the CPU unit after the renewal has "the CPU unit before the renewal executes the certain process" from the CPU unit before the renewal. I can't get a notification that "completed". Therefore, the CPU unit after the renewal mistakenly states that "an error has occurred in the CPU unit before the renewal (that is, a synchronization error has occurred)" even if the CPU unit before the renewal is operating normally. Will be judged.

(判定の遅延の発生)
上述の例で、リニューアル前のCPUユニットと、リニューアル後のCPUユニットとに共通の「待ち時間」を、例えば「30ms」に固定することによって、リニューアル後のCPUユニットによる誤判定は防ぐことができる。
(Occurrence of judgment delay)
In the above example, by fixing the "waiting time" common to the CPU unit before the renewal and the CPU unit after the renewal to, for example, "30 ms", it is possible to prevent erroneous determination by the CPU unit after the renewal. ..

すなわち、リニューアル前のCPUユニットは、「リニューアル後のCPUユニットが前記或る処理の実行を完了した時点」から「30ms」経過した後であれば、前記或る処理の実行を完了することができる。したがって、リニューアル後のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から「30ms」経過した後であれば、「リニューアル前のCPUユニットに異常が発生したか否か」を、正しく判定することができる。 That is, the CPU unit before the renewal can complete the execution of the certain process if "30 ms" has elapsed from "the time when the CPU unit after the renewal completes the execution of the certain process". .. Therefore, the CPU unit after the renewal asks "whether or not an abnormality has occurred in the CPU unit before the renewal" if "30 ms" has elapsed from the time when the own unit completes the execution of the certain process. It can be judged correctly.

ただし、「30ms」の待ち時間は、リニューアル前のCPUユニットと、リニューアル後のCPUユニットとで共通であるため、リニューアル前のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から「30ms」経過した後に判定を行なう。つまり、リニューアル前のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から「30ms」経過した後に、「リニューアル後のCPUユニットに異常が発生したか否か」を、判定する。 However, since the waiting time of "30 ms" is common to the CPU unit before the renewal and the CPU unit after the renewal, the CPU unit before the renewal starts from the time when the own unit completes the execution of the certain process. The determination is made after "30 ms" has elapsed. That is, the CPU unit before the renewal determines "whether or not an abnormality has occurred in the CPU unit after the renewal" after "30 ms" has elapsed from the time when the own unit completes the execution of the certain process.

リニューアル前のCPUユニットと、リニューアル後のCPUユニットとは、互いに相手方のCPUユニットの処理完了を認識してから、次の処理に移行するため、両者の待ち時間を、両者に共通の「30ms」とすると、次の処理の実行開始が遅れる。リニューアル後のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から「30ms」経過した後に相手方のCPUユニットの異常を判定し、さらに、その「30ms」後に、リニューアル前のCPUユニットによる異常判定が実行される。つまり、リニューアル後のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から「60ms」した後でなければ、次の処理の実行を開始することができない。すなわち、リニューアル前のCPUユニットに合わせて、リニューアル前のCPUユニットと、リニューアル後のCPUユニットとが用いる待ち時間を両者に共通の「30ms」とすると、両者の判定が完了するのが遅くなる。 Since the CPU unit before the renewal and the CPU unit after the renewal recognize each other's processing completion of the CPU unit of the other party and then move to the next processing, the waiting time of both is set to "30 ms" common to both. Then, the start of execution of the next process is delayed. The CPU unit after the renewal determines the abnormality of the CPU unit of the other party after "30 ms" has elapsed from the time when the own unit completes the execution of the certain process, and further, after the "30 ms", the CPU unit before the renewal. Abnormality judgment is executed by. That is, the CPU unit after the renewal can start the execution of the next process only after "60 ms" from the time when the own unit completes the execution of the certain process. That is, if the waiting time used by the CPU unit before the renewal and the CPU unit after the renewal is set to "30 ms" common to both in accordance with the CPU unit before the renewal, the determination of both is delayed.

リニューアル前のCPUユニットは、自ユニットが前記或る処理の実行を完了した時点から「30ms」経過した後でなければ判定を実行しないため、リニューアル後のCPUユニットに異常が発生した場合、運転継続のためのACTからSTBへの切替が遅れる。 The CPU unit before the renewal does not execute the determination until "30 ms" has elapsed from the time when the own unit completes the execution of the certain process. Therefore, if an abnormality occurs in the CPU unit after the renewal, the operation is continued. Switching from ACT to STB for is delayed.

以上の通り、PLCにおいて二重化されるCPUユニットがほぼ同一の処理能力を備えることを前提とする従来技術には、二重化されるCPUユニットの処理能力が互いに異なる場合に、誤判定およびACTからSTBへの切替の遅延が発生するという問題がある。 As described above, in the conventional technique on the premise that the CPU units to be duplicated in the PLC have almost the same processing capacity, when the processing capacities of the CPU units to be duplicated are different from each other, erroneous determination and ACT to STB are performed. There is a problem that there is a delay in switching.

上記の課題を解決するために、本発明の一態様に係るCPUユニットは、コントローラにおいて二重化されるCPUユニットであって、自ユニットの処理能力と、二重化される相手方のCPUユニットの処理能力との比を考慮して、待ち時間を設定する設定部と、自ユニットにおける処理の実行完了時点から、前記設定部によって設定された前記待ち時間を経過するまでに、前記相手方のCPUユニットにおける前記処理の実行完了を確認できないと、前記相手方のCPUユニットに異常が発生したと判定する判定部と、を備えている。 In order to solve the above problems, the CPU unit according to one aspect of the present invention is a CPU unit that is duplicated in the controller, and has the processing capacity of the own unit and the processing capacity of the other CPU unit that is duplicated. In consideration of the ratio, the setting unit for setting the waiting time and the processing in the CPU unit of the other party from the time when the execution of the processing in the own unit is completed until the waiting time set by the setting unit elapses. If the execution completion cannot be confirmed, a determination unit for determining that an abnormality has occurred in the CPU unit of the other party is provided.

前記の構成によれば、前記CPUユニットは、自ユニットと前記相手方のCPUユニットとの前記処理能力の比を考慮して設定した前記待ち時間を用いて、自ユニットと前記相手方のCPUユニットとの同期(つまり、実行完了した処理の一致)を判定する。 According to the above configuration, the CPU unit uses the waiting time set in consideration of the ratio of the processing capacity of the own unit and the CPU unit of the other party to the CPU unit of the own unit and the CPU unit of the other party. Judge synchronization (that is, match of processed processes that have been executed).

例えば、前記相手方のCPUユニットの方が自ユニットより性能が高い(つまり、処理の実行速度が早い)場合、前記CPUユニットは、前記待ち時間として、予め決められた「通常の待ち時間」を設定する。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、前記制御方法は、待ち時間Twとして、予め決められた「通常の待ち時間」を設定する。 For example, when the CPU unit of the other party has higher performance (that is, the execution speed of processing is faster) than the own unit, the CPU unit sets a predetermined "normal waiting time" as the waiting time. do. Further, when the performance Ab is equal between the CPU unit of the other party and the own unit, the control method sets a predetermined "normal waiting time" as the waiting time Tw.

前記相手方のCPUユニットの方が自ユニットより性能が高い場合、自ユニットが或る処理の実行を完了した時点では既に前記相手方のCPUユニットは前記或る処理の実行を完了しているはずである。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、自ユニットが或る処理の実行を完了した時点で、相手方のCPUユニットは前記或る処理の実行を完了するはずである。 If the CPU unit of the other party has higher performance than the own unit, the CPU unit of the other party should have already completed the execution of the certain process when the own unit completes the execution of a certain process. .. Further, when the performance Ab is equal between the CPU unit of the other party and the own unit, the CPU unit of the other party should complete the execution of the certain process when the own unit completes the execution of a certain process.

したがって、前記相手方のCPUユニットの方が自ユニットより性能が高い場合でも、前記CPUユニットは、前記待ち時間として、前記「通常の待ち時間」を設定することで、前記相手方のCPUユニットに異常が発生したか否かを正確に判定することができる。 Therefore, even if the CPU unit of the other party has higher performance than the own unit, the CPU unit may have an abnormality in the CPU unit of the other party by setting the "normal waiting time" as the waiting time. It is possible to accurately determine whether or not it has occurred.

例えば、前記相手方のCPUユニットの方が自ユニットより性能が低い(つまり、処理の実行速度が遅い)場合、前記CPUユニットは、前記待ち時間として、「前記通常の待ち時間に、性能差を考慮した調整待ち時間を加えた期間」を設定する。具体的には、「自ユニットにおける前記処理の実行完了時点と、前記相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点との差」を、前記調整待ち時間とする。 For example, when the CPU unit of the other party has lower performance (that is, the execution speed of processing is slower) than the own unit, the CPU unit considers the performance difference in the normal waiting time as the waiting time. Set the period including the adjustment waiting time. Specifically, the "difference between the time when the execution of the process in the own unit is completed and the time when the execution of the process is expected to be completed in the CPU unit of the other party" is defined as the adjustment waiting time.

前記相手方のCPUユニットの方が自ユニットより性能が低い場合、自ユニットが或る処理の実行を完了した時点では、前記相手方のCPUユニットは、未だ前記或る処理の実行を完了していない。そこで、前記CPUユニットは、「前記相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点」まで待機し、その後、「通常の待ち時間」が経過するまでに前記相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。つまり、前記CPUユニットは、自ユニットにおける前記処理の実行完了時点から、「前記調整待ち時間を、前記通常の待ち時間に加えた期間」が経過するまでに、前記相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。 When the performance of the CPU unit of the other party is lower than that of the own unit, the CPU unit of the other party has not yet completed the execution of the certain process when the own unit completes the execution of a certain process. Therefore, the CPU unit waits until "a time when the execution of the process is expected to be completed in the other party's CPU unit", and then waits until the "normal waiting time" elapses. Judge whether the execution completion of the process can be confirmed. That is, the CPU unit performs the processing in the other CPU unit from the time when the execution of the processing in the own unit is completed until the "period in which the adjustment waiting time is added to the normal waiting time" elapses. Determine if execution completion can be confirmed.

したがって、前記相手方のCPUユニットの方が自ユニットより性能が低い場合でも、前記CPUユニットは、前記待ち時間として、「前記調整待ち時間を、前記通常の待ち時間に加えた期間」を設定することで、前記の判定を正確に実行できる。 Therefore, even if the CPU unit of the other party has lower performance than the own unit, the CPU unit sets "a period in which the adjustment waiting time is added to the normal waiting time" as the waiting time. Therefore, the above determination can be accurately executed.

以上の通り、前記CPUユニットは、自ユニットと前記相手方のCPUユニットとで前記処理能力が一致しない場合であっても、自ユニットと前記相手方のCPUユニットとの前記処理能力の違いを考慮した、適切な前記待ち時間を設定できるとの効果を奏する。すなわち、前記CPUユニットは、二重化される相手方のCPUユニットと自ユニットとの処理能力の違いを考慮して、不要な待ち時間を設けずに、同期チェック処理を正確に行なうことができるとの効果を奏する。 As described above, the CPU unit takes into consideration the difference in the processing capacity between the own unit and the CPU unit of the other party even when the processing capacity of the own unit and the CPU unit of the other party do not match. It has the effect of being able to set an appropriate waiting time. That is, the effect is that the CPU unit can accurately perform the synchronization check process without providing an unnecessary waiting time in consideration of the difference in processing capacity between the CPU unit of the other party to be duplicated and the own unit. Play.

本発明の一態様に係るCPUユニットにおいて、前記処理は、自ユニットのハードウェアに異常がないかを診断する自己診断処理、前記相手方のCPUユニット以外の外部装置を制御する信号を生成する命令実行処理、および、前記相手方のCPUユニット以外の外部装置との間でデータを交換するI/Oリフレッシュ処理を含み、前記設定部は、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々について、前記待ち時間を設定し、前記判定部は、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々について、前記判定を実行してもよい。 In the CPU unit according to one aspect of the present invention, the processing includes self-diagnosis processing for diagnosing whether or not there is an abnormality in the hardware of the own unit, and instruction execution for generating a signal for controlling an external device other than the other CPU unit. The setting unit includes the self-diagnosis process, the instruction execution process, and the I / O, including the process and the I / O refresh process for exchanging data with an external device other than the CPU unit of the other party. The waiting time may be set for each of the refresh processes, and the determination unit may execute the determination for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process.

前記の構成によれば、前記CPUユニットは、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々について、自ユニットと前記相手方のCPUユニットとの同期(つまり、実行完了した処理の一致)を判定する。 According to the above configuration, the CPU unit synchronizes its own unit with the other CPU unit (that is, execution is completed) for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. Matching of the processed processes) is judged.

したがって、前記CPUユニットは、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々の実行完了のタイミングで、自ユニットと前記相手方のCPUユニットとの同期を判定することができるとの効果を奏する。 Therefore, the CPU unit may determine the synchronization between the own unit and the other CPU unit at the timing of completion of each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. It has the effect of being able to do it.

本発明の一態様に係るCPUユニットは、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理を、この順で繰り返し実行する前に、前記相手方のCPUユニットの処理能力を、前記相手方のCPUユニットから取得する二重化処理を、1回実行してもよい。 The CPU unit according to one aspect of the present invention has the processing capacity of the other CPU unit before repeatedly executing the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. The duplication process acquired from the CPU unit of the other party may be executed once.

前記の構成によれば、前記CPUユニットは、前記相手方のCPUユニットの処理能力を、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理を、この順で繰り返し実行する前に、1回取得する。そして、前記CPUユニットは、取得した前記相手方のCPUユニットの処理能力と、自ユニットの前記処理能力との比を考慮して、前記各処理についての前記判定に用いる前記待ち時間を設定する。 According to the above configuration, the CPU unit repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order with respect to the processing capacity of the other CPU unit. Get it once. Then, the CPU unit sets the waiting time used for the determination for each of the processes in consideration of the ratio between the acquired processing capacity of the other party's CPU unit and the processing capacity of the own unit.

したがって、前記CPUユニットは、前記各処理を繰り返し実行する前に予め取得しておいた前記相手方のCPUユニットの処理能力を考慮して、前記各処理についての前記判定に用いる前記待ち時間を、設定することができるとの効果を奏する。 Therefore, the CPU unit sets the waiting time used for the determination for each process in consideration of the processing capacity of the other party's CPU unit acquired in advance before repeatedly executing each process. It has the effect of being able to.

本発明の一態様に係るCPUユニットにおいて、前記設定部は、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々の前記待ち時間を、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々の実行に係る、自ユニットの処理能力と、前記相手方のCPUユニットの処理能力との比を考慮して設定してもよい。 In the CPU unit according to one aspect of the present invention, the setting unit sets the waiting time for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process to the self-diagnosis process and the instruction execution. It may be set in consideration of the ratio of the processing capacity of the own unit and the processing capacity of the CPU unit of the other party related to the execution of each of the processing and the I / O refresh processing.

前記の構成によれば、前記CPUユニットは、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々の実行に係る、自ユニットと前記相手方のCPUユニットとの処理能力における違いを考慮して、各処理の前記待ち時間を設定する。 According to the above configuration, the CPU unit has a processing capacity between the own unit and the other CPU unit related to each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process. The waiting time for each process is set in consideration of the difference.

したがって、前記CPUユニットは、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々の前記待ち時間を、各処理に係る自ユニットおよび前記相手方のCPUユニットの各々の処理能力に応じて設定できるとの効果を奏する。 Therefore, the CPU unit has the processing capabilities of the own unit and the CPU unit of the other party for each of the waiting times of the self-diagnosis process, the instruction execution process, and the I / O refresh process. It has the effect of being able to be set according to.

上記の課題を解決するために、本発明の一態様に係る制御方法は、コントローラにおいて二重化されるCPUユニットの制御方法であって、自ユニットの処理能力と、二重化される相手方のCPUユニットの処理能力との比を考慮して、待ち時間を設定する設定ステップと、自ユニットにおける処理の実行完了時点から、前記設定ステップにて設定された前記待ち時間を経過するまでに、前記相手方のCPUユニットにおける前記処理の実行完了を確認できないと、前記相手方のCPUユニットに異常が発生したと判定する判定ステップと、を含んでいる。 In order to solve the above problems, the control method according to one aspect of the present invention is the control method of the CPU unit to be duplicated in the controller, and the processing capacity of the own unit and the processing of the CPU unit of the other party to be duplicated. The CPU unit of the other party from the setting step of setting the waiting time in consideration of the ratio with the capacity and the time when the execution of the process in the own unit is completed until the waiting time set in the setting step elapses. It includes a determination step of determining that an abnormality has occurred in the CPU unit of the other party when the completion of execution of the process cannot be confirmed.

前記の方法によれば、前記制御方法は、自ユニットと前記相手方のCPUユニットとの前記処理能力の比を考慮して設定した前記待ち時間を用いて、自ユニットと前記相手方のCPUユニットとの同期(つまり、実行完了した処理の一致)を判定する。 According to the above method, in the control method, the own unit and the CPU unit of the other party use the waiting time set in consideration of the ratio of the processing capacity of the own unit and the CPU unit of the other party. Judge synchronization (that is, match of processed processes that have been executed).

例えば、前記相手方のCPUユニットの方が自ユニットより性能が高い(つまり、処理の実行速度が早い)場合、前記制御方法は、前記待ち時間として、予め決められた「通常の待ち時間」を設定する。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、前記制御方法は、待ち時間Twとして、予め決められた「通常の待ち時間」を設定する。 For example, when the CPU unit of the other party has higher performance (that is, the execution speed of processing is faster) than the own unit, the control method sets a predetermined "normal waiting time" as the waiting time. do. Further, when the performance Ab is equal between the CPU unit of the other party and the own unit, the control method sets a predetermined "normal waiting time" as the waiting time Tw.

前記相手方のCPUユニットの方が自ユニットより性能が高い場合、自ユニットが或る処理の実行を完了した時点では既に前記相手方のCPUユニットは前記或る処理の実行を完了しているはずである。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、自ユニットが或る処理の実行を完了した時点で、相手方のCPUユニットは前記或る処理の実行を完了するはずである。 If the CPU unit of the other party has higher performance than the own unit, the CPU unit of the other party should have already completed the execution of the certain process when the own unit completes the execution of a certain process. .. Further, when the performance Ab is equal between the CPU unit of the other party and the own unit, the CPU unit of the other party should complete the execution of the certain process when the own unit completes the execution of a certain process.

したがって、前記相手方のCPUユニットの方が自ユニットより性能が高い場合でも、前記制御方法は、前記待ち時間として、前記「通常の待ち時間」を設定することで、前記相手方のCPUユニットに異常が発生したか否かを正確に判定することができる。 Therefore, even if the CPU unit of the other party has higher performance than the own unit, the control method sets the "normal waiting time" as the waiting time, so that the CPU unit of the other party has an abnormality. It is possible to accurately determine whether or not it has occurred.

例えば、前記相手方のCPUユニットの方が自ユニットより性能が低い(つまり、処理の実行速度が遅い)場合、前記制御方法は、前記待ち時間として、「前記通常の待ち時間に、性能差を考慮した調整待ち時間を加えた期間」を設定する。具体的には、「自ユニットにおける前記処理の実行完了時点と、前記相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点との差」を、前記調整待ち時間とする。 For example, when the CPU unit of the other party has lower performance (that is, the execution speed of processing is slower) than the own unit, the control method considers the performance difference in the normal waiting time as the waiting time. Set the period including the adjustment waiting time. Specifically, the "difference between the time when the execution of the process in the own unit is completed and the time when the execution of the process is expected to be completed in the CPU unit of the other party" is defined as the adjustment waiting time.

前記相手方のCPUユニットの方が自ユニットより性能が低い場合、自ユニットが或る処理の実行を完了した時点では、前記相手方のCPUユニットは、未だ前記或る処理の実行を完了していない。そこで、前記制御方法は、「前記相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点」まで待機し、その後、「通常の待ち時間」が経過するまでに前記相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。つまり、前記制御方法は、自ユニットにおける前記処理の実行完了時点から、「前記調整待ち時間を、前記通常の待ち時間に加えた期間」が経過するまでに、前記相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。 When the performance of the CPU unit of the other party is lower than that of the own unit, the CPU unit of the other party has not yet completed the execution of the certain process when the own unit completes the execution of a certain process. Therefore, the control method waits until "a time when the execution of the process is expected to be completed in the CPU unit of the other party", and then waits until the "normal waiting time" elapses. Judge whether the execution completion of the process can be confirmed. That is, in the control method, the processing in the CPU unit of the other party is performed from the time when the execution of the processing in the own unit is completed until the "period in which the adjustment waiting time is added to the normal waiting time" elapses. Determine if execution completion can be confirmed.

したがって、前記相手方のCPUユニットの方が自ユニットより性能が低い場合でも、前記制御方法は、前記待ち時間として、「前記調整待ち時間を、前記通常の待ち時間に加えた期間」を設定することで、前記の判定を正確に実行できる。 Therefore, even if the CPU unit of the other party has lower performance than the own unit, the control method sets "a period in which the adjustment waiting time is added to the normal waiting time" as the waiting time. Therefore, the above determination can be accurately executed.

以上の通り、前記制御方法は、自ユニットと前記相手方のCPUユニットとで前記処理能力が一致しない場合であっても、自ユニットと前記相手方のCPUユニットとの前記処理能力の違いを考慮した、適切な前記待ち時間を設定できるとの効果を奏する。すなわち、前記制御方法は、二重化される相手方のCPUユニットと自ユニットとの処理能力の違いを考慮して、不要な待ち時間を設けずに、同期チェック処理を正確に行なうことができるとの効果を奏する。 As described above, the control method takes into consideration the difference in the processing capacity between the own unit and the CPU unit of the other party even when the processing capacity does not match between the own unit and the CPU unit of the other party. It has the effect of being able to set an appropriate waiting time. That is, the above-mentioned control method has an effect that the synchronization check process can be accurately performed without providing an unnecessary waiting time in consideration of the difference in the processing capacity between the CPU unit of the other party to be duplicated and the own unit. Play.

本発明の一態様によれば、PLCにおいて二重化されるCPUユニットについて、二重化される相手方のCPUユニットと自ユニットとの処理能力の違いを考慮して、不要な待ち時間を設けずに、同期チェック処理を正確に行なうことができるとの効果を奏する。 According to one aspect of the present invention, with respect to the CPU unit to be duplicated in the PLC, a synchronization check is performed without providing an unnecessary waiting time in consideration of the difference in processing capacity between the CPU unit of the other party to be duplicated and the own unit. It has the effect of being able to perform processing accurately.

本発明の実施形態1に係るCPUユニット等の要部構成を示すブロック図である。It is a block diagram which shows the structure of the main part of the CPU unit and the like which concerns on Embodiment 1 of this invention. 図1に示す2つのCPUユニットの各々が実行する処理の概要を説明する図である。It is a figure explaining the outline of the process executed by each of the two CPU units shown in FIG. 1. 図1に示す2つのCPUユニットの各々が、二重化される相手方のCPUユニットの性能を示す性能情報を取得する処理の具体例を説明する図である。It is a figure explaining the specific example of the process which each of the two CPU units shown in FIG. 1 acquires the performance information which shows the performance of the CPU unit of the other party to be duplicated. 本発明の実施形態2に係るCPUユニット等の要部構成を示すブロック図である。It is a block diagram which shows the structure of the main part of the CPU unit and the like which concerns on Embodiment 2 of this invention. 図4に示すCPUユニットを実現するハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware configuration which realizes the CPU unit shown in FIG. 図4に示す2つのCPUユニットの各々が実行する処理の概要を説明する図である。It is a figure explaining the outline of the process executed by each of the two CPU units shown in FIG. 4. 図4に示す2つのCPUユニットの各々が、二重化される相手方のCPUユニットの性能を示す性能情報を取得する処理の具体例を説明する図である。It is a figure explaining the specific example of the process which each of the two CPU units shown in FIG. 4 acquires the performance information which shows the performance of the CPU unit of the other party to be duplicated. PLCにおいて二重化されたCPUユニットの、従来までの処理の概要を説明する図である。It is a figure explaining the outline of the processing of the CPU unit duplicated in a PLC up to the present. 自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行完了時点で実行される同期チェック処理の詳細を説明する図である。It is a figure explaining the details of the synchronization check process which is executed at the time of each execution completion of the self-diagnosis process, the instruction execution process, and the I / O refresh process.

〔実施形態1〕
以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰返さない。以下の各実施形態においては、機械および設備等の制御対象を制御するPLC(プログラマブル・ロジック・コントローラ、Programmable Logic Controller)10を、2つのCPUユニットが二重化されるコントローラの典型例として説明を行なう。
[Embodiment 1]
Hereinafter, an embodiment according to one aspect of the present invention (hereinafter, also referred to as “the present embodiment”) will be described with reference to the drawings. The same or corresponding parts in the drawings are designated by the same reference numerals and the description thereof will not be repeated. In each of the following embodiments, a PLC (Programmable Logic Controller) 10 that controls a control target such as a machine and equipment will be described as a typical example of a controller in which two CPU units are duplicated.

以下では先ず、PLC10において二重化される第1CPUユニット100Aおよび第2CPUユニット100Bの各々についての理解を容易にするために、両者が各々実行する処理の概要を、図2を用いて説明する。 In the following, first, in order to facilitate understanding of each of the first CPU unit 100A and the second CPU unit 100B to be duplicated in the PLC 10, an outline of the processing executed by both of them will be described with reference to FIG.

§1.適用例
図2は、図1を用いて後述する2つのCPUユニット(すなわち、第1CPUユニット100Aおよび第2CPUユニット100B)の各々が実行する処理の概要を説明する図である。第1CPUユニット100Aと第2CPUユニット100Bとは、PLC10において二重化され、一方が実行系(ACT)となるとともに、他方が待機系(STB)となり、互いに相手方のCPUユニットの状態を確認する。第1CPUユニット100Aと第2CPUユニット100Bとは、実行系のCPUユニット(ACT)がダウンした場合には、待機系のCPUユニット(STB)がACTに切り替わって運転を継続する。以下では、理解を容易にするため、第1CPUユニット100AがACTであり、第2CPUユニット100BがSTBである例を説明する。
§1. Application Example FIG. 2 is a diagram illustrating an outline of processing executed by each of two CPU units (that is, the first CPU unit 100A and the second CPU unit 100B) described later with reference to FIG. 1. The first CPU unit 100A and the second CPU unit 100B are duplicated in PLC10, one of which becomes an execution system (ACT) and the other of which becomes a standby system (STB), and each other confirms the state of the other CPU unit. When the CPU unit (ACT) of the executing system goes down, the CPU unit (STB) of the standby system switches to the ACT and continues the operation of the first CPU unit 100A and the second CPU unit 100B. Hereinafter, in order to facilitate understanding, an example in which the first CPU unit 100A is an ACT and the second CPU unit 100B is an STB will be described.

(待ち時間の概要)
図2に示すように、ACTおよびSTBの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する。以下では、繰り返しこの順に実行される「自己診断処理、命令実行処理、および、I/Oリフレッシュ処理」のセットを、「1サイクル(1周期)」と称する。
(Summary of waiting time)
As shown in FIG. 2, each of the ACT and the STB repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. Hereinafter, a set of "self-diagnosis processing, instruction execution processing, and I / O refresh processing" that is repeatedly executed in this order is referred to as "1 cycle (1 cycle)".

自己診断処理は、自ユニットのハードウェアが正常に動作しているかを診断する処理である。命令実行処理は、ユーザプログラム等を実行する処理であり、前の周期において実行されたI/Oリフレッシュ処理で取得したデータを用いて各種の演算を実行し、現在の周期におけるI/Oリフレッシュ処理で出力するデータを生成する処理である。命令実行処理において、PLC10(より正確には、第1CPUユニット100Aまたは第2CPUユニット100B)の制御対象である、相手方のCPUユニット以外の外部装置に対する、制御信号が生成される。I/Oリフレッシュ処理は、二重化された相手方のCPUユニット以外の、外部装置および外部ユニットとのデータ交換を実行する処理であり、現在の周期の命令実行処理で生成されたデータを出力し、次の周期の命令実行処理に用いるデータを取得する処理である。命令実行処理において生成された制御信号は、I/Oリフレッシュ処理において、制御対象へと出力される。 The self-diagnosis process is a process of diagnosing whether the hardware of the own unit is operating normally. The instruction execution process is a process for executing a user program or the like, and various operations are executed using the data acquired in the I / O refresh process executed in the previous cycle, and the I / O refresh process in the current cycle is executed. It is a process to generate the data to be output in. In the instruction execution process, a control signal is generated for an external device other than the other CPU unit, which is the control target of the PLC 10 (more accurately, the first CPU unit 100A or the second CPU unit 100B). The I / O refresh process is a process for executing data exchange with an external device and an external unit other than the duplicated CPU unit of the other party, and outputs the data generated in the command execution process of the current cycle, and then outputs the data. It is a process to acquire the data used for the instruction execution process of the cycle of. The control signal generated in the instruction execution process is output to the control target in the I / O refresh process.

図2に示すように、ACT(第1CPUユニット100A)とSTB(第2CPUユニット100B)との各々は、自ユニットが、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了した後に、「同期チェック処理」を実行する。ACTおよびSTBの各々は、この同期チェック処理において、互いに相手方のCPUユニットの状態を監視し(言い換えれば、確認し)、ACTが異常停止していれば、STBが、異常停止したACTに代わって、運転を引き継ぐ。 As shown in FIG. 2, in each of the ACT (first CPU unit 100A) and the STB (second CPU unit 100B), the own unit executes each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. After completing the above, execute the "synchronization check process". In this synchronization check process, each of the ACT and STB monitors the status of the CPU unit of the other party (in other words, confirms), and if the ACT is abnormally stopped, the STB replaces the abnormally stopped ACT. , Take over the driving.

「同期チェック処理」は、自ユニットが実行を完了した処理について、相手方のCPUユニットも自ユニットと同様に実行を完了しているかを確認する処理であり、相手方のCPUユニットの処理完了が確認できない場合、異常が発生したと判定される。例えば、ACTは、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了した後、STBが自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了しているかを確認する(判定する)。例えば、STBは、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了した後、ACTが自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了しているかを確認する(判定する)。 The "synchronous check process" is a process for confirming whether the CPU unit of the other party has completed the execution in the same manner as the own unit for the process in which the own unit has completed the execution, and the process completion of the CPU unit of the other party cannot be confirmed. If so, it is determined that an abnormality has occurred. For example, in the ACT, after each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process is completed, the STB executes each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. Confirm (determine) whether the is completed. For example, the STB completes each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process, and then the ACT executes each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. Confirm (determine) whether the is completed.

「同期チェック処理」において、ACTおよびSTBの各々は、自ユニットが或る処理の実行を完了してから所定時間(=待ち時間Tw)が経過した後、相手方のCPUユニットから「その或る処理の実行を完了した」旨の通知を取得したかを確認する。ACTおよびSTBの各々は、自ユニットが或る処理の実行を完了してから待ち時間Twが経過した後、相手方のCPUユニットの「その或る処理の実行を完了した」旨の通知を取得できないと、「二重化された相手方のCPUユニットに異常が発生した」と判定する。第1CPUユニット100AがACTであり、第2CPUユニット100BがSTBである場合、第1CPUユニット100Aに異常が発生したと判定すると、第2CPUユニット100Bは、自ユニットがACTへと切り替わって、運転を継続する。 In the "synchronous check process", each of the ACT and STB "is a certain process" from the CPU unit of the other party after a predetermined time (= waiting time Tw) has elapsed since the own unit completed the execution of a certain process. Confirm that you have received the notification that "execution has been completed". Each of the ACT and STB cannot obtain the notification that the other CPU unit has "completed the execution of a certain process" after the waiting time Tw has elapsed since the own unit completed the execution of a certain process. And, it is determined that "an error has occurred in the duplicated CPU unit of the other party". When the first CPU unit 100A is an ACT and the second CPU unit 100B is an STB, when it is determined that an abnormality has occurred in the first CPU unit 100A, the second CPU unit 100B switches to the ACT and continues the operation. do.

前述の通り、ACT(第1CPUユニット100A)とSTB(第2CPUユニット100B)とで「待ち時間Tw」の長さを同じにした場合、ACTとSTBとで性能Abが異なると、誤判定およびACTからSTBへの切替の遅延が発生するという問題がある。そこで、ACTとSTBとの各々は、以下の処理を実行することにより、両者の性能Abが異なる場合であっても、不要な待ち時間Twを設けずに、正確な同期チェック処理を実行する。 As described above, when the length of the "waiting time Tw" is the same for the ACT (first CPU unit 100A) and the STB (second CPU unit 100B), if the performance Ab is different between the ACT and the STB, an erroneous judgment and an ACT are made. There is a problem that a delay in switching from to STB occurs. Therefore, each of the ACT and the STB executes the following processing to perform an accurate synchronization check processing without providing an unnecessary waiting time Tw even if the performance Abs of the two are different.

すなわち、先ず「基準となるハードウェアのCPUユニット(基準CPUユニット)」を予め想定しておき、この基準CPUユニットについて、予め性能Ab(処理能力)および処理時間を定義しておく。以下の説明においては、基準CPUユニットの性能Abを「性能Abb」と表すことがある。 That is, first, a "reference CPU unit (reference CPU unit) of hardware" is assumed in advance, and the performance Ab (processing capacity) and processing time are defined in advance for this reference CPU unit. In the following description, the performance Ab of the reference CPU unit may be referred to as "performance Abb".

そして、ACTとSTBとの各々に、自ユニットの性能Abを示す情報を、例えば「自ユニットが、基準CPUユニットと比較して、どの程度の性能Abを備えているのか」を示す情報(自機性能情報)を、保有させておく。ACTとSTBとがPLC10において二重化される際、ACTとSTBとの各々は、互いの性能Ab(相手方のCPUユニットの、基準CPUユニットの性能Abbに対する相対的な性能Ab)を把握する。そして、ACTとSTBとの各々は、把握した互いの性能Abに基づいて、同期チェック処理のための待ち時間Twを柔軟に設定する。以下の説明においては、自ユニットの性能Ab(自ユニットの、基準CPUユニットの性能Abbに対する相対的な性能Ab)を、「性能Abm」と表すことがある。同様に、相手方のCPUユニットの性能Ab(相手方のCPUユニットの、基準CPUユニットの性能Abbに対する相対的な性能Ab)を、「性能Aby」と表すことがある。 Then, information indicating the performance Ab of the own unit is given to each of the ACT and STB, for example, information indicating "how much the performance Ab the own unit has as compared with the reference CPU unit" (self). Machine performance information) is retained. When the ACT and the STB are duplicated in the PLC 10, each of the ACT and the STB grasps each other's performance Ab (the performance Ab of the other CPU unit relative to the performance Abb of the reference CPU unit). Then, each of the ACT and the STB flexibly sets the waiting time Tw for the synchronization check process based on each other's performance Ab that has been grasped. In the following description, the performance Ab of the own unit (the performance Ab of the own unit relative to the performance Abb of the reference CPU unit) may be expressed as "performance Abm". Similarly, the performance Ab of the CPU unit of the other party (the performance Ab of the CPU unit of the other party relative to the performance Abb of the reference CPU unit) may be expressed as "performance Aby".

具体的には、ACTとSTBとの各々は、PLC10において二重化される際、同期チェック処理のための待ち時間Twについて、以下のように設定を行なう。すなわち、二重化される相手方のCPUユニットの性能Abyが、自ユニットの性能Abmより高い場合、つまり、二重化される相手方のCPUユニットの方が自ユニットより処理の実行速度が早い場合、通常の待ち時間Twoを待ち時間Twに設定する。二重化される相手方のCPUユニットの性能Abyと、自ユニットの性能Abmとが等しい場合、つまり、二重化される相手方のCPUユニットと自ユニットとで処理の実行速度が等しい場合、通常の待ち時間Twoを待ち時間Twに設定する。二重化される相手方のCPUユニットの性能Abyが、自ユニットの性能Abmより低い場合、つまり、二重化される相手方のCPUユニットの方が自ユニットより処理の実行速度が遅い場合、待ち時間Twを、相手方のCPUユニットの性能Abyに合わせて設定する。 Specifically, when each of the ACT and the STB is duplicated in the PLC 10, the waiting time Tw for the synchronization check process is set as follows. That is, when the performance Aby of the CPU unit of the other party to be duplicated is higher than the performance Abm of the own unit, that is, when the CPU unit of the other party to be duplicated has a faster processing execution speed than the own unit, the normal waiting time Set Two to the waiting time Tw. When the performance Aby of the CPU unit of the other party to be duplicated and the performance Abm of the own unit are equal, that is, when the execution speed of the processing is the same between the CPU unit of the other party to be duplicated and the own unit, the normal waiting time Two is set. Set the waiting time Tw. If the performance Aby of the CPU unit of the other party to be duplicated is lower than the performance Abm of the own unit, that is, if the CPU unit of the other party to be duplicated has a slower processing execution speed than the own unit, the waiting time Tw is set to the other party. Set according to the performance Aby of the CPU unit of.

例えば、自ユニットの性能Abmが基準CPUユニットの性能Abbの2倍であり、二重化される相手方のCPUユニットの性能Abyが基準CPUユニットの性能Abbの1/2倍であれば、性能Abmは性能Abyの4倍である。その場合、同期チェック処理の対象である或る処理を実行するのに、自ユニットが「10ms(ミリ秒)」要したならば、相手方のCPUユニットは「40ms」要することになるので、自ユニットの待ち時間Twを「30ms+通常の待ち時間Two」に設定する。 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 other CPU unit to be duplicated is 1/2 times the performance Abb of the reference CPU unit, the performance Abm is the performance. It is four times as much as Aby. In that case, if the own unit takes "10 ms (milliseconds)" to execute a certain process that is the target of the synchronization check process, the CPU unit of the other party will take "40 ms". Waiting time Tw is set to "30ms + normal waiting time Two".

例えば、自ユニットの性能Abmが基準CPUユニットの性能Abbの1/2倍であり、二重化される相手方のCPUユニットの性能Abyが基準CPUユニットの性能Abbの2倍であれば、性能Abmは性能Abyの1/4倍である。その場合、同期チェック処理の対象である或る処理を実行するのに、自ユニットが「40ms」要したならば、相手方のCPUユニットは「10ms」要することになるから、自ユニットの待ち時間Twを「通常の待ち時間Two」に設定する。 For example, if the performance Abm of the own unit is 1/2 of the performance Abb of the reference CPU unit and the performance Aby of the other CPU unit to be duplicated is twice the performance Abb of the reference CPU unit, the performance Abm is the performance. It is 1/4 times Aby. In that case, if the own unit takes "40 ms" to execute a certain process that is the target of the synchronization check process, the CPU unit of the other party needs "10 ms", so that the waiting time Tw of the own unit Is set to "normal waiting time Two".

ACT(第1CPUユニット100A)とSTB(第2CPUユニット100B)との各々は、自ユニットの待ち時間Twを、自ユニットと二重化される相手方のCPUユニットとの性能Abの差によって、柔軟に設定する。 Each of the 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 other CPU unit to be duplicated. ..

(処理の具体例)
図2に示すように、PLC10において第1CPUユニット100A(ACT)と第2CPUユニット100B(STB)とを二重化する場合、ACTとSTBとは各々、通常のサイクルとは別に、「二重化処理」を実行する。すなわち、ACTおよびSTBの各々は、サイクリック(周期的)に繰り返し実行する、「自己診断処理、命令実行処理、および、I/Oリフレッシュ処理」の前に、「二重化処理」を実行する。
(Specific example of processing)
As shown in FIG. 2, when the first CPU unit 100A (ACT) and the second CPU unit 100B (STB) are duplicated in the PLC 10, the ACT and the STB each execute a "duplication process" separately from the normal cycle. do. That is, each of the ACT and STB executes the "duplication process" before the "self-diagnosis process, instruction execution process, and I / O refresh process" that are cyclically and repeatedly executed.

ACTおよびSTBの各々は、「二重化処理」において、互いの性能Abを把握し、二重化状態となる。ACTおよびSTBの各々の性能情報(自機性能情報)は、例えば各CPUユニットの生産時に、各CPUユニットの備える不揮発性メモリに書き込まれる。この自機性能情報は、例えば、「特定のハードウェアの仕様のCPUユニット(前述の「基準CPUユニット」)の性能Abbを基準として、この基準CPUユニットの性能Abbに対して、自ユニットの性能Abmは、何%の性能UP/DOWNか」を示す。 Each of the ACT and the STB grasps each other's performance Ab in the "duplication process" and becomes a duplication state. The performance information (own machine performance information) of each of the ACT and STB is written in the non-volatile memory included in each CPU unit, for example, at the time of production of each CPU unit. This own machine performance information is, for example, "the performance of the own unit with respect to the performance Abb of the reference CPU unit based on the performance Abb of the CPU unit of the specific hardware specifications (the above-mentioned" reference CPU unit "). Abm indicates what percentage of performance UP / DOWN. "

ACTおよびSTBの各々は、自ユニットの性能情報を、各CPUユニットの不揮発性メモリに、「自機性能情報」として格納している。ACTおよびSTBの各々は、この自機性能情報を二重化処理の中で互いに転送し合い、相手方のCPUユニットの自機性能情報を、「他機性能情報」として、各CPUユニットの不揮発性メモリに格納する。 Each of the ACT and STB stores the performance information of its own unit in the non-volatile memory of each CPU unit as "own machine performance information". Each of the ACT and STB transfers this own machine performance information to each other in the duplication process, and the own machine performance information of the other CPU unit is used as "other machine performance information" in the non-volatile memory of each CPU unit. Store.

例えば、自機性能情報が150%(つまり、処理の実行速度(処理速度)が、基準CPUユニットの1.5倍)であり、他機性能情報が75%(処理速度が、基準CPUユニットの0.75倍)である場合、ACTは以下の情報を把握する。すなわち、ACTは、自ユニット(ACT)の処理速度は、相手方のCPUユニット(STB)の処理速度の「2倍(=1.5倍/0.75倍)」であることを把握する。 For example, the performance information of the own machine is 150% (that is, the execution speed (processing speed) of the processing is 1.5 times that of the reference CPU unit), and the performance information of the other machine is 75% (the processing speed is the reference CPU unit). If it is 0.75 times), the ACT grasps the following information. That is, the ACT grasps that the processing speed of the own unit (ACT) is "twice (= 1.5 times / 0.75 times)" the processing speed of the CPU unit (STB) of the other party.

例えば、自機性能情報が75%(処理速度が、基準CPUユニットの0.75倍)であり、他機性能情報が150%(つまり、処理の実行速度(処理速度)が、基準CPUユニットの1.5倍)である場合、STBは以下の情報を把握する。すなわち、自ユニット(STB)の処理速度は、相手方のCPUユニット(ACT)の処理速度の「1/2倍(=0.75倍/1.5倍)」であることを把握する。 For example, the performance information of the own machine is 75% (the processing speed is 0.75 times that of the reference CPU unit), and the performance information of the other machine is 150% (that is, the execution speed (processing speed) of the processing is the reference CPU unit. If it is 1.5 times), the STB grasps the following information. That is, it is understood that the processing speed of the own unit (STB) is "1/2 times (= 0.75 times / 1.5 times)" the processing speed of the CPU unit (ACT) of the other party.

「二重化処理」において、自ユニットと相手方のCPUユニットとの性能Abの差を把握して、二重化状態になると、ACTおよびSTBの各々は、この性能Abの差を用いて、自ユニットの待ち時間Twを設定する。 In the "duplication process", the difference in performance Ab between the own unit and the CPU unit of the other party is grasped, and when the duplication state is reached, each of the ACT and STB uses this difference in performance Ab to wait for the own unit. Set Tw.

ACTおよびSTBの各々は、例えば、図2の「命令実行」処理の実行開始から実行完了までの実行時間を、各CPUユニットの備える内部タイマを用いて、各CPUユニットにおいて計測する。ここで、「命令実行」処理について、ACTの実行時間が「100ms」だとすると、前述の通り、STBとの性能Abの差は「2倍」だったので、相手方のCPUユニット(STB)は「200ms」かかることになる。 Each of the ACT and STB measures, for example, the execution time from the start of execution of the "instruction execution" process of FIG. 2 to the completion of execution in each CPU unit using an internal timer included in each CPU unit. Here, regarding the "instruction execution" process, assuming that the ACT execution time is "100 ms", the difference in performance Ab from the STB is "double" as described above, so the CPU unit (STB) of the other party is "200 ms". It will take.

そのため、ACTは、通常の待ち時間Twoに、「100ms(=200ms-100ms)」を加えた期間を、自ユニットの「命令実行」処理に係る同期チェック処理の待ち時間Twとして設定する。図2に示す例では、ACTは、自ユニットでの「命令実行」処理の実行完了時点から、「100ms」の期間、待機処理を実行し、その後に、「命令実行」処理に係る同期チェック処理を実行している。つまり、ACTは、自ユニットでの「命令実行」処理の実行完了時点から、「100ms+通常の待ち時間Two」が経過するまでの間に、相手方のCPUユニット(STB)から、「命令実行」処理の実行完了の通知を取得するか否かを判定する。そして、ACTは、自ユニットでの「命令実行」処理の実行完了時点から、「100ms+通常の待ち時間Two」が経過するまでの間に、STBから、「命令実行」処理の実行完了の通知を取得できないと、STBに異常が発生したと判定する。 Therefore, the ACT sets the period obtained by adding "100 ms (= 200 ms-100 ms)" to the normal waiting time Two as the waiting time Tw of the synchronization check process related to the "instruction execution" process of the own unit. In the example shown in FIG. 2, the ACT executes the standby process for a period of "100 ms" from the time when the execution of the "instruction execution" process in the own unit is completed, and then the synchronous check process related to the "instruction execution" process. Is running. That is, the ACT performs the "instruction execution" process from the CPU unit (STB) of the other party between the time when the execution of the "instruction execution" process in the own unit is completed and the time when "100 ms + normal waiting time Two" elapses. Determines whether or not to acquire the notification of the completion of execution of. Then, the ACT notifies the STB of the completion of the execution of the "instruction execution" process from the time when the execution of the "instruction execution" process in the own unit is completed until "100 ms + normal waiting time Two" elapses. If it cannot be acquired, it is determined that an abnormality has occurred in the STB.

「相手方のCPUユニット(ACT)の方が、性能Abが高く、または、性能Abが等しい(つまり、処理速度が速く、または、同じ)」ことを把握したSTBは、通常の待ち時間Twoをそのまま、自ユニットの「命令実行」処理に係る同期チェック処理の待ち時間Twとして設定する。図2に示す例では、STBは、自ユニットでの「命令実行」処理の実行を完了すると直ぐに、「命令実行」処理に係る同期チェック処理を実行している。つまり、STBは、自ユニットでの「命令実行」処理の実行完了時点から、通常の待ち時間Twoが経過するまでの間に、相手方のCPUユニット(ACT)から、「命令実行」処理の実行完了の通知を取得するか否かを判定する。そして、STBは、自ユニットでの「命令実行」処理の実行完了時点から、通常の待ち時間Twoが経過するまでの間に、ACTから、「命令実行」処理の実行完了の通知を取得できないと、ACTに異常が発生したと判定する。ACT(第1CPUユニット100A)に異常が発生したと判定すると、STB(第2CPUユニット100B)は、自ユニットがACTへと切り替わって、運転を継続する。 The STB who grasps that "the CPU unit (ACT) of the other party has higher performance Ab or equal performance Ab (that is, the processing speed is faster or the same)" keeps the normal waiting time Two as it is. , Set as the waiting time Tw of the synchronization check process related to the "command execution" process of the own unit. In the example shown in FIG. 2, the STB executes the synchronization check process related to the "instruction execution" process as soon as the execution of the "instruction execution" process in the own unit is completed. That is, the STB completes the execution of the "instruction execution" process from the CPU unit (ACT) of the other party between the time when the execution of the "instruction execution" process in the own unit is completed and the time when the normal waiting time Two elapses. Determine whether to get the notification of. Then, the STB cannot obtain the notification of the execution completion of the "instruction execution" process from the ACT between the time when the execution of the "instruction execution" process in the own unit is completed and the time when the normal waiting time Two elapses. , It is determined that an abnormality has occurred in the ACT. When it is determined that an abnormality has occurred in the ACT (first CPU unit 100A), the STB (second CPU unit 100B) switches its own unit to the ACT and continues the operation.

§2.構成例
これまでに図2を用いて概要を説明してきた第1CPUユニット100Aおよび第2CPUユニット100Bについて、次に、図1を参照してその詳細を説明していく。
§2. Configuration Example The first CPU unit 100A and the second CPU unit 100B, which have been outlined with reference to FIG. 2, will be described in detail with reference to FIG. 1.

図1は、本発明の実施形態1に係る第1CPUユニット100Aおよび第2CPUユニット100BCPUユニットを含むPLC10の要部構成を示すブロック図である。図1に例示するように、PLC10は、PLC10において二重化される第1CPUユニット100Aと第2CPUユニット100Bとを含んでいる。第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、PLC10全体の制御を統括する機能ユニットである。 FIG. 1 is a block diagram showing a main configuration of a PLC 10 including a first CPU unit 100A and a second CPU unit 100B CPU unit according to the first embodiment of the present invention. As illustrated in FIG. 1, the PLC 10 includes a first CPU unit 100A and a second CPU unit 100B that are duplicated in the PLC 10. Each of the first CPU unit 100A and the second CPU unit 100B is a functional unit that controls the control of the entire PLC 10.

PLC10は、図1に図示していない機能ユニットをさらに備えていてもよい。PLC10は、例えば、第1CPUユニット100Aおよび第2CPUユニット100Bを含むPLC10の全体に電源を供給する、不図示の電源ユニットをさらに含んでいる。PLC10は、また、生産装置および設備装置の適所に取り付けたスイッチおよびセンサの信号を入力する入力ユニット、アクチュエータ等に制御信号を出す出力ユニット、通信ネットワークに接続するための通信ユニット等の不図示の機能ユニットを含んでいてもよい。 The PLC 10 may further include a functional unit (not shown in FIG. 1). The PLC 10 further includes, for example, a power supply unit (not shown) that supplies power to the entire PLC 10 including the first CPU unit 100A and the second CPU unit 100B. The PLC 10 is also not shown, such as an input unit for inputting signals of switches and sensors mounted at appropriate positions in production equipment and equipment, an output unit for outputting control signals to actuators, and a communication unit for connecting to a communication network. It may include a functional unit.

前述の通り、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順に繰り返し実行する。I/Oリフレッシュ処理は、入力ユニット等が取得した各種の入力信号を、各CPUユニットのI/Oメモリに取り込む処理(INリフレッシュ)と、命令実行処理の処理結果をI/Oメモリに書き込んで出力ユニット等へ出力する処理(OUTリフレッシュ)と、を含んでいる。つまり、I/Oリフレッシュ処理は、「第1CPUユニット100Aおよび第2CPUユニット100Bの各々」と、「第1CPUユニット100Aおよび第2CPUユニット100B以外の、外部のユニット、外部の装置」との、サイクリックなデータ交換である。命令実行処理では、コントローラであるPLC10が制御対象に対して出力する各種の制御信号が生成され、例えば、ユーザプログラムに基づいて、INリフレッシュでI/Oメモリに取り込んだ入力信号を用いた論理演算が実行され、制御信号が生成される。 As described above, each of the first CPU unit 100A and the second CPU unit 100B repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. In the I / O refresh process, various input signals acquired by the input unit or the like are taken into the I / O memory of each CPU unit (IN refresh), and the processing result of the instruction execution process is written to the I / O memory. It includes a process (OUT refresh) to output to an output unit or the like. That is, the I / O refresh process is cyclic between "each of the first CPU unit 100A and the second CPU unit 100B" and "an external unit and an external device other than the first CPU unit 100A and the second CPU unit 100B". Data exchange. In the instruction execution process, various control signals output by the controller PLC10 to the control target are generated. For example, a logical operation using an input signal taken into the I / O memory by IN refresh based on a user program. Is executed and a control signal is generated.

PLC10においては、PLC10によって制御される制御システムの安全性、信頼性を向上するため、第1CPUユニット100Aと第2CPUユニット100Bとが二重化され、両者は、例えばCPU間バスにより接続される。第1CPUユニット100Aと第2CPUユニット100Bとは、両者に異常がなければ、同じタイミングで、同じ処理(自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々)の実行を開始する。例えば、第1CPUユニット100Aと第2CPUユニット100Bとは、両者に異常がなければ、同じ入力信号を用いた、同じユーザプログラムの実行を、同じタイミングで、開始する。 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 duplicated, and both are connected by, for example, an inter-CPU bus. If there is no abnormality in both the first CPU unit 100A and the second CPU unit 100B, the first CPU unit 100A and the second CPU unit 100B start executing the same processing (each of the self-diagnosis processing, the instruction execution processing, and the I / O refresh processing) at the same timing. For example, if there is no abnormality in both the first CPU unit 100A and the second CPU unit 100B, the execution of the same user program using the same input signal is started at the same timing.

第1CPUユニット100Aおよび第2CPUユニット100Bのうち、一方が実行系のCPUユニット(ACT)となり、他方が待機系のCPUユニット(STB)となる。前述の通り、本明細書においては、「第1CPUユニット100AがACTであり、第2CPUユニット100BがSTBである」例を説明するが、「第1CPUユニット100AがSTBであり、第2CPUユニット100BがACTである」場合も同様である。 Of the first CPU unit 100A and the second CPU unit 100B, one is an executing CPU unit (ACT) and the other is a standby CPU unit (STB). As described above, in the present specification, an example of "the first CPU unit 100A is an ACT and the second CPU unit 100B is an STB" will be described, but "the first CPU unit 100A is an STB and the second CPU unit 100B is an STB". The same applies to the case of "ACT".

ACTである第1CPUユニット100Aは、実際にサイクリックな処理を行い、メモリに対して読み書きを行ない、また、外部のI/O機器等との間で制御データ(I/Oデータ)の送受を行い、PLC10によって制御される制御システムの制御を司る。STBである第2CPUユニット100Bは、待機中(すなわち、ACTである第1CPUユニット100Aに異常が発生していない間)は、ACTである第1CPUユニット100Aが実行するのと同一のユーザプログラムを実行する。ただし、STBである第2CPUユニット100Bは、実行したユーザプログラムの実行結果(演算実行結果)を、外部のI/O機器等へ出力することはしない。また、STBである第2CPUユニット100Bは、ACTである第1CPUユニット100Aから処理結果(演算実行結果、および、ACTである第1CPUユニット100Aの取得した各種の入力信号)等を受信する。そして、STBである第2CPUユニット100Bは、ACTである第1CPUユニット100Aから受信した処理結果等により、自ユニットのメモリの内容を更新する。これにより、STBである第2CPUユニット100BとACTである第1CPUユニット100Aのメモリの内容の同一性が確保される。 The first CPU unit 100A, which is an ACT, actually performs cyclic processing, reads and writes to the memory, and sends and receives control data (I / O data) to and from an external I / O device or the like. It controls the control system controlled by the PLC 10. The second CPU unit 100B, which is an STB, executes the same user program as that executed by the first CPU unit 100A, which is an ACT, while waiting (that is, while no abnormality has occurred in the first CPU unit 100A, which is an ACT). do. However, the second CPU unit 100B, which is an STB, does not output the execution result (calculation execution result) of the executed user program to an external I / O device or the like. Further, the second CPU unit 100B, which is an STB, receives processing results (calculation execution results and various input signals acquired by the first CPU unit 100A, which is an ACT) from the first CPU unit 100A, which is an ACT. Then, the second CPU unit 100B, which is an STB, updates the contents of the memory of its own unit according to the processing result or the like received from the first CPU unit 100A, which is an ACT. As a result, the sameness of the contents of the memories of the second CPU unit 100B, which is an STB, and the first CPU unit 100A, which is an ACT, is ensured.

ACTである第1CPUユニット100Aが故障した場合、STBである第2CPUユニット100BがACTである第1CPUユニット100Aに切り替わって実際の制御等の動作を行う。PLC10において第1CPUユニット100Aと第2CPUユニット100Bとを二重化しておくことにより、ACTである第1CPUユニット100Aが故障しても、PLC10の全体が直ぐに停止することはなく、継続して運転できるので、信頼性が向上する。 When the first CPU unit 100A, which is an ACT, fails, the second CPU unit 100B, which is an STB, is switched to the first CPU unit 100A, which is an ACT, and an operation such as actual control is performed. By duplicating the first CPU unit 100A and the second CPU unit 100B in the PLC10, even if the first CPU unit 100A, which is an ACT, fails, the entire PLC10 does not stop immediately and can be continuously operated. , Improves reliability.

(CPUユニットの詳細)
図1に示すように、PLC10は、PLC10において二重化される第1CPUユニット100Aと第2CPUユニット100Bとに加え、両者が各々、書込および読込を実行することのできる共通レジスタ200を備えている。記載の簡潔性を担保するため、本実施の形態に直接関係のない構成は、説明およびブロック図から省略している。ただし、実施の実情に則して、PLC10は、当該省略された構成を備えてもよい。
(Details of CPU unit)
As shown in FIG. 1, the PLC 10 includes, in addition to the first CPU unit 100A and the second CPU unit 100B, which are duplicated in the PLC 10, both have a common register 200 capable of executing writing and reading, respectively. In order to ensure the conciseness of the description, the configuration not directly related to the present embodiment is omitted from the description and the block diagram. However, according to the actual situation of implementation, the PLC 10 may have the omitted configuration.

共通レジスタ200は、第1レジスタ210および第2レジスタ220を含む。 The common register 200 includes a first register 210 and a second register 220.

第1レジスタ210は、第1CPUユニット100Aにより、「自ユニット(つまり、第1CPUユニット100)が、或る処理(自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々)の実行を完了した」旨の情報が書き込まれる。第1CPUユニット100Aによって第1レジスタ210に書き込まれた情報は、第2CPUユニット100Bによって読み込まれる。 The first register 210 uses the first CPU unit 100A to "execute a certain process (self-diagnosis process, instruction execution process, and I / O refresh process) by the own unit (that is, the first CPU unit 100). Information to the effect that "completed" is written. The information written in the first register 210 by the first CPU unit 100A is read by the second CPU unit 100B.

第2レジスタ220は、第2CPUユニット100Bにより、「自ユニット(つまり、第2CPUユニット100B)が、或る処理(自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々)の実行を完了した」旨の情報が書き込まれる。第2CPUユニット100Bによって第2レジスタ220に書き込まれた情報は、第1CPUユニット100Aによって読み込まれる。 The second register 220 uses the second CPU unit 100B to "execute a certain process (self-diagnosis process, instruction execution process, and I / O refresh process) by the own unit (that is, the second CPU unit 100B). Information to the effect that "completed" is written. The information written in the second register 220 by the second CPU unit 100B is read by the first CPU unit 100A.

第1CPUユニット100Aは、記憶部130Aに加えて、機能ブロックとして、能力取得部110A、処理実行部120A、待ち時間設定部160A、および、判定部170Aを備えている。記憶部130Aは、他機能力テーブル140Aおよび自機能力テーブル150Aを格納している。 In addition to the storage unit 130A, the first CPU unit 100A includes a capacity acquisition unit 110A, a processing execution unit 120A, a waiting time setting unit 160A, and a determination unit 170A as functional blocks. The storage unit 130A stores the other functional power table 140A and the self-functional power table 150A.

第2CPUユニット100Bは、記憶部130Bに加えて、機能ブロックとして、能力取得部110B、処理実行部120B、待ち時間設定部160B、および、判定部170Bを備えている。記憶部130Bは、他機能力テーブル140Bおよび自機能力テーブル150Bを格納している。 In addition to the storage unit 130B, the second CPU unit 100B includes a capacity acquisition unit 110B, a processing execution unit 120B, a waiting time setting unit 160B, and a determination unit 170B as functional blocks. The storage unit 130B stores the other functional power table 140B and the self-functional power table 150B.

以下では、能力取得部110Aと能力取得部110Bとの各々を特に区別する必要がない場合は単に「能力取得部110」と称する。同様に、処理実行部120Aと処理実行部120Bとの各々を特に区別する必要がない場合は単に「処理実行部120」と称する。記憶部130Aと記憶部130Bとの各々を特に区別する必要がない場合は単に「記憶部130」と称する。他機能力テーブル140Aと他機能力テーブル140Bとの各々を特に区別する必要がない場合は単に「他機能力テーブル140」と称する。自機能力テーブル150Aと自機能力テーブル150Bとの各々を特に区別する必要がない場合は単に「自機能力テーブル150」と称する。待ち時間設定部160Aと待ち時間設定部160Bとの各々を特に区別する必要がない場合は単に「待ち時間設定部160」と称する。判定部170Aと判定部170Bとの各々を特に区別する必要がない場合は単に「判定部170」と称する。 In the following, when it is not necessary to distinguish each of the ability acquisition unit 110A and the ability acquisition unit 110B, it is simply referred to as "ability acquisition unit 110". Similarly, when it is not necessary to distinguish each of the processing execution unit 120A and the processing execution unit 120B, it is simply referred to as "processing execution unit 120". When it is not necessary to distinguish each of the storage unit 130A and the storage unit 130B, it is simply referred to as "storage unit 130". When it is not necessary to distinguish each of the other functional power table 140A and the other functional power table 140B, it is simply referred to as "other functional power table 140". When it is not necessary to distinguish between the self-functional power table 150A and the self-functional power table 150B, it is simply referred to as "self-functional power table 150". When it is not necessary to distinguish between the waiting time setting unit 160A and the waiting time setting unit 160B, it is simply referred to as "waiting time setting unit 160". When it is not necessary to distinguish each of the determination unit 170A and the determination unit 170B, it is simply referred to as "determination unit 170".

能力取得部110、処理実行部120、待ち時間設定部160、および、判定部170等の各機能ブロックは、例えば、CPU(central processing unit)等が、ROM(read only memory)、NVRAM(non-Volatile random access memory)等で実現された記憶装置(記憶部130)に記憶されているプログラムを不図示のRAM(random access memory)等に読み出して実行することで実現できる。 Each functional block such as the capacity acquisition unit 110, the processing execution unit 120, the waiting time setting unit 160, and the determination unit 170 has, for example, a CPU (central processing unit) or the like having a ROM (read only memory) or NVRAM (non-). It can be realized by reading a program stored in a storage device (storage unit 130) realized by a Volatile random access memory) or the like into a RAM (random access memory) or the like (not shown) and executing the program.

(機能ブロックの詳細)
能力取得部110は、二重化される相手方のCPUユニットの性能Aby(処理能力)を示す情報(「性能情報」)を、相手方のCPUユニットの自機能力テーブル150を参照して取得する。能力取得部110は、取得した相手方のCPUユニットの性能情報(他機性能情報)を、自ユニットの他機能力テーブル140に格納する。
(Details of functional blocks)
The capacity acquisition unit 110 acquires information (“performance information”) indicating the performance Aby (processing capacity) of the CPU unit of the other party to be duplicated with reference to the self-functioning power table 150 of the CPU unit of the other party. The capacity acquisition unit 110 stores the acquired performance information (performance information of another machine) of the other party's CPU unit in the other function power table 140 of the own unit.

特に、能力取得部110は、処理実行部120が自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する前に1回、図2に例示した「二重化処理」において、他機性能情報を取得する。 In particular, the capability acquisition unit 110 has the “duplication process” illustrated in FIG. 2 once before the process execution unit 120 repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. To acquire the performance information of other machines.

図3は、「二重化処理」において1回実行される、「二重化される相手方のCPUユニットの性能Abyを示す性能情報を取得する」処理の具体例を説明する図である。図3に示すように、能力取得部110Aは、第2CPUユニット100Bの性能Abyを示す性能情報を、自機能力テーブル150Bを参照して取得し、取得した第2CPUユニット100Bの性能情報(他機性能情報)を、他機能力テーブル140Aに格納する。また、能力取得部110Bは、第1CPUユニット100Aの性能Abyを示す性能情報を、自機能力テーブル150Aを参照して取得し、取得した第1CPUユニット100Aの性能情報(他機性能情報)を、他機能力テーブル140Bに格納する。 FIG. 3 is a diagram illustrating a specific example of a process of "acquiring performance information indicating the performance Aby of the CPU unit of the other party to be duplicated", which is executed once in the "duplication process". As shown in FIG. 3, the capability acquisition unit 110A acquires the performance information indicating the performance Aby of the second CPU unit 100B with reference to the self-functioning power table 150B, and acquires the performance information of the second CPU unit 100B (other machine). Performance information) is stored in the other functional power table 140A. Further, the capability acquisition unit 110B acquires the performance information indicating the performance Aby of the first CPU unit 100A with reference to the self-functional power table 150A, and obtains the acquired performance information (other machine performance information) of the first CPU unit 100A. It is stored in the other functional power table 140B.

処理実行部120は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行し、各処理の実行を完了すると、「自ユニットが各処理の実行を完了した」旨を、共通レジスタ200に書き込む。 The process execution unit 120 repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order, and when the execution of each process is completed, "the own unit has completed the execution of each process". This is written in the common register 200.

また、処理実行部120は、各処理の実行を完了すると、「自ユニットが各処理の実行を完了した」旨を、待ち時間設定部160および判定部170に通知する。処理実行部120は、待ち時間設定部160に、「自ユニットが各処理の実行を完了した」旨と共に、「各処理の実行時間(各処理について、実行開始から実行完了までの時間)」を通知してもよい。すなわち、処理実行部120は、内部タイマを用いて「各処理の実行時間」を計時し、計時した「各処理の実行時間」を待ち時間設定部160に通知してもよい。 Further, when the process execution unit 120 completes the execution of each process, the process execution unit 120 notifies the waiting time setting unit 160 and the determination unit 170 that "the own unit has completed the execution of each process". The process execution unit 120 informs the waiting time setting unit 160 that "the own unit has completed the execution of each process" and "execution time of each process (time from the start of execution to the completion of execution of each process)". You may notify. That is, the process execution unit 120 may use an internal timer to time the "execution time of each process" and notify the timed-out "execution time of each process" to the waiting time setting unit 160.

<処理の実行完了の書込>処理実行部120は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を完了すると、その旨(つまり、「自ユニットが、その処理の実行を完了した」旨)を、共通レジスタ200に書き込む。すなわち、自己診断処理の実行を完了した処理実行部120Aは、「自ユニットが、自己診断処理の実行を完了した」旨を第1レジスタ210に書き込み、自己診断処理の実行を完了した処理実行部120は、「自ユニットが、自己診断処理の実行を完了した」旨を第2レジスタ220に書き込む。命令実行処理の実行を完了した処理実行部120Aは、「自ユニットが、命令実行処理の実行を完了した」旨を第1レジスタ210に書き込み、命令実行処理の実行を完了した処理実行部120Bは、「自ユニットが、命令実行処理の実行を完了した」旨を第2レジスタ220に書き込む。I/Oリフレッシュ処理の実行を完了した処理実行部120Aは、「自ユニットが、I/Oリフレッシュ処理の実行を完了した」旨を第1レジスタ210に書き込み、I/Oリフレッシュ処理の実行を完了した処理実行部120Bは、「自ユニットが、I/Oリフレッシュ処理の実行を完了した」旨を第2レジスタ220に書き込む。 <Writing the execution completion of the process> When the process execution unit 120 completes each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process, that effect (that is, "the own unit performs the process". Has been completed) is written in the common register 200. That is, the process execution unit 120A that has completed the execution of the self-diagnosis process writes to the first register 210 that "the own unit has completed the execution of the self-diagnosis process", and completes the execution of the self-diagnosis process. The 120 writes to the second register 220 that "the own unit has completed the execution of the self-diagnosis process". The process execution unit 120A that has completed the execution of the instruction execution process writes to the first register 210 that "the own unit has completed the execution of the instruction execution process", and the process execution unit 120B that has completed the execution of the instruction execution process is , "The own unit has completed the execution of the instruction execution process" is written in the second register 220. The process execution unit 120A that has completed the execution of the I / O refresh process writes to the first register 210 that "the own unit has completed the execution of the I / O refresh process", and completes the execution of the I / O refresh process. The processing execution unit 120B writes to the second register 220 that "the own unit has completed the execution of the I / O refresh processing".

<処理の実行開始のタイミング>第1CPUユニット100Aと第2CPUユニット100Bとが二重化されている間、処理実行部120は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を、以下のタイミングで開始する。言い換えれば、第1CPUユニット100Aと第2CPUユニット100Bとの各々について異常が発生したと判定されない間、処理実行部120は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を、以下のタイミングで開始する。 <Timing of Processing Execution Start> While the first CPU unit 100A and the second CPU unit 100B are duplicated, the processing execution unit 120 executes each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. Is started at the following timing. In other words, while it is not determined that an abnormality has occurred in each of the first CPU unit 100A and the second CPU unit 100B, the processing execution unit 120 executes each of the self-diagnosis processing, the instruction execution processing, and the I / O refresh processing. Is started at the following timing.

すなわち、処理実行部120は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行を、前の処理の実行完了後の同期チェック処理で、第1CPUユニット100Aと第2CPUユニット100Bとの正常が確認されてから、開始する。 That is, the process execution unit 120 executes each of the self-diagnosis process, the instruction execution process, and the I / O refresh process in the synchronous check process after the execution of the previous process is completed, and the first CPU unit 100A and the second CPU unit. It starts after the normality with 100B is confirmed.

具体的には、自己診断処理の実行完了後の同期チェック処理において、第1CPUユニット100Aと第2CPUユニット100Bとの正常が確認されてから、処理実行部120は、命令実行処理の実行を開始する。命令実行処理の実行完了後の同期チェック処理において、第1CPUユニット100Aと第2CPUユニット100Bとの正常が確認されてから、処理実行部120は、I/Oリフレッシュ処理の実行を開始する。I/Oリフレッシュ処理の実行完了後の同期チェック処理において、第1CPUユニット100Aと第2CPUユニット100Bとの正常が確認されてから、処理実行部120は、次の周期における自己診断処理の実行を開始する。 Specifically, in the synchronization check process after the execution of the self-diagnosis process is completed, the process execution unit 120 starts executing the instruction execution process after the normality of the first CPU unit 100A and the second CPU unit 100B is confirmed. .. In the synchronization check process after the execution of the instruction execution process is completed, the process execution unit 120 starts executing the I / O refresh process after the normality of the first CPU unit 100A and the second CPU unit 100B is confirmed. After the normality of the first CPU unit 100A and the second CPU unit 100B is confirmed in the synchronization check process after the execution of the I / O refresh process is completed, the process execution unit 120 starts executing the self-diagnosis process in the next cycle. do.

待ち時間設定部160は、他機能力テーブル140を参照して他機性能情報を取得し、自機能力テーブル150を参照して自機性能情報を取得する。また、待ち時間設定部160は、処理実行部120から、「自ユニットが各処理の実行を完了した」旨を取得する。待ち時間設定部160は、「自ユニットが各処理の実行を完了した」旨を取得する前に処理実行部120から取得していた「自ユニットが各処理の実行を開始した」旨と併せて、各処理の実行時間を演算する。すなわち、待ち時間設定部160は、内部タイマにより計時した「自ユニットが各処理の実行を開始した」時刻と、内部タイマにより計時した「自ユニットが各処理の実行を完了した」時刻とから、各処理の実行時間を演算する。なお、各処理の実行時間は、処理実行部120が内部タイマを用いて計時し、処理実行部120から待ち時間設定部160へと通知されてもよい。 The waiting time setting unit 160 refers to the other functional power table 140 to acquire the performance information of the other machine, and refers to the self-functional power table 150 to acquire the performance information of the own machine. Further, the waiting time setting unit 160 acquires from the processing execution unit 120 that "the own unit has completed the execution of each process". The waiting time setting unit 160 together with the fact that "the own unit has started the execution of each process" acquired from the process execution unit 120 before acquiring "the own unit has completed the execution of each process". , Calculate the execution time of each process. That is, the waiting time setting unit 160 is based on the time when "the own unit starts executing each process" timed by the internal timer and the time when "the own unit completes the execution of each process" timed by the internal timer. Calculate the execution time of each process. The execution time of each process may be timed by the process execution unit 120 using an internal timer, and may be notified from the process execution unit 120 to the waiting time setting unit 160.

待ち時間設定部160は、取得した他機性能情報、自機性能情報、および、各処理の実行時間から、各処理についての同期チェック処理のための「待ち時間Tw」を算出し、算出した待ち時間Twを、判定部170へ通知する。具体的には、待ち時間設定部160は、他機性能情報、自機性能情報、および、各処理の実行時間を用いて、以下のように、各処理についての同期チェック処理のための「待ち時間Tw」を算出する。 The waiting time setting unit 160 calculates the "waiting time Tw" for the synchronization check processing for each processing from the acquired other machine performance information, the own machine performance information, and the execution time of each processing, and the calculated waiting time. Notify the determination unit 170 of the time Tw. Specifically, the waiting time setting unit 160 uses the performance information of other machines, the performance information of its own machine, and the execution time of each process to "wait" for the synchronization check process for each process as follows. "Time Tw" is calculated.

すなわち、他機性能情報に示される「二重化される相手方のCPUユニットの性能Aby」が、自機性能情報に示される「自ユニットの性能Abm」より高い場合、待ち時間設定部160は、「通常の待ち時間Two」を「待ち時間Tw」とする。また、二重化される相手方のCPUユニットの性能Abyが自ユニットの性能Abmに等しい場合、待ち時間設定部160は、「通常の待ち時間Two」を「待ち時間Tw」とする。 That is, when the "performance Aby of the other party's CPU unit to be duplicated" shown in the performance information of the other machine is higher than the "performance Abm of the own unit" shown in the performance information of the own machine, the waiting time setting unit 160 is "normally". "Waiting time Tw" is defined as "waiting time Tw". Further, when the performance Aby of the CPU unit of the other party to be duplicated is equal to the performance Abm of the own unit, the waiting time setting unit 160 sets "normal waiting time Two" to "waiting time Tw".

「通常の待ち時間Two」は、予め長さの決められている、第1CPUユニット100Aと第2CPUユニット100Bとで共通の期間であり、例えば、各ユニットの工場出荷時に設定され、ユーザによって更新可能な期間である。「通常の待ち時間Two」は、第1CPUユニット100Aと第2CPUユニット100Bとで性能Abが等しいとの前提で設定される期間である。 The "normal waiting time Two" is a period common to the first CPU unit 100A and the second CPU unit 100B, which has a predetermined length. For example, it is set at the time of factory shipment of each unit and can be updated by the user. It is a period. The "normal waiting time Two" is a period set on the assumption that the performance Ab of the first CPU unit 100A and the second CPU unit 100B is equal.

二重化される相手方のCPUユニットの性能Abyが自ユニットの性能Abmより低い場合、待ち時間設定部160は、自ユニットの性能Abmを相手方のCPUユニットの性能Abyで除した値に、各処理の実行時間を乗じた期間を、調整待ち時間Taとする。そして、待ち時間設定部160は、「通常の待ち時間Twoに調整待ち時間Taを加えた期間(つまり、「通常の待ち時間Two+調整待ち時間Ta」)」を、「待ち時間Tw」とする。 When the performance Aby of the CPU unit of the other party to be duplicated is lower than the performance Abm of the own unit, the waiting time setting unit 160 executes each process to the value obtained by dividing the performance Abm of the own unit by the performance Aby of the CPU unit of the other party. The period multiplied by the time is defined as the adjustment waiting time Ta. Then, the waiting time setting unit 160 sets the "period in which the adjustment waiting time Ta is added to the normal waiting time Two (that is," normal waiting time Two + adjustment waiting time Ta ")" as "waiting time Tw".

判定部170は、処理実行部120による各処理の実行完了時点から、待ち時間設定部160から通知された待ち時間Twが経過するまでに、処理実行部120が実行完了した処理について、相手方のCPUユニットが実行を完了するかを判定する(同期チェック処理)。例えば、判定部170は、「自ユニットが各処理の実行を完了した」時点から待ち時間Twが経過した時点で、共通レジスタ200を参照し、自ユニットが実行を完了した或る処理について、二重化される相手方のCPUユニットの実行が完了しているかを確認する。 The determination unit 170 is the CPU of the other party for the processing completed by the processing execution unit 120 from the time when the execution of each processing by the processing execution unit 120 is completed until the waiting time Tw notified from the waiting time setting unit 160 elapses. Determines if the unit completes execution (synchronous check process). For example, the determination unit 170 refers to the common register 200 when the waiting time Tw has elapsed from the time when the own unit has completed the execution of each process, and duplicates the certain process for which the own unit has completed the execution. Check if the execution of the CPU unit of the other party is completed.

待ち時間Twとして「通常の待ち時間Two+調整待ち時間Ta」を通知された判定部170は、「自ユニットが各処理の実行を完了した」時点から調整待ち時間Taがするまで待機処理を実行する。そして、判定部170は、待機処理の実行完了後(つまり、「自ユニットが各処理の実行を完了した」時点から調整待ち時間Taが経過した後)に、同期チェック処理を実行する。すなわち、判定部170は、待機処理の実行完了後に、「通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理の実行を、相手方のCPUユニットが完了していることを確認できるか」を判定する。言い換えれば、判定部170は、待機処理の実行完了時点から通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理について、相手方のCPUユニットによる実行完了を確認できるかを判定する。「待機処理の実行完了時点」は、「自ユニットが実行完了した或る処理の、相手方のCPUユニットにおける実行が完了すると予想される時点」である。 The determination unit 170 notified of "normal waiting time Two + adjustment waiting time Ta" as the waiting time Tw executes the waiting process from the time when "the own unit completes the execution of each process" until the adjustment waiting time Ta occurs. .. Then, the determination unit 170 executes the synchronization check process after the execution of the standby process is completed (that is, after the adjustment waiting time Ta has elapsed from the time when the own unit has completed the execution of each process). That is, after the execution of the standby process is completed, the determination unit 170 can confirm that the CPU unit of the other party has completed the execution of the process whose execution has been completed by the own unit by the time the normal waiting time Two elapses. Is it judged? In other words, the determination unit 170 determines whether the processing completed by the own unit can be confirmed to be completed by the CPU unit of the other party from the time when the execution of the standby processing is completed until the normal waiting time Two elapses. The "time when the execution of the standby process is completed" is "the time when the execution of a certain process whose execution is completed by the own unit is expected to be completed in the CPU unit of the other party".

待ち時間Twとして「通常の待ち時間Two」を通知された判定部170は、「自ユニットが各処理の実行を完了した」時点で直ぐに、同期チェック処理を実行する。すなわち、判定部170は、「通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理の実行を、相手方のCPUユニットが完了していることを確認できるか」を判定する。言い換えれば、判定部170は、自ユニットの実行完了時点から通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理について、相手方のCPUユニットによる実行完了を確認できるかを判定する。 The determination unit 170 notified of the "normal waiting time Two" as the waiting time Tw immediately executes the synchronization check process when "the own unit completes the execution of each process". That is, the determination unit 170 determines "whether it is possible to confirm that the CPU unit of the other party has completed the execution of the process for which the own unit has completed execution by the time the normal waiting time Two elapses". In other words, the determination unit 170 determines whether the processing completed by the own unit can be confirmed by the CPU unit of the other party from the time when the execution of the own unit is completed until the normal waiting time Two elapses.

判定部170Aは、共通レジスタ200の第2レジスタ220を参照し、処理実行部120Aが実行を完了した或る処理について、「処理実行部120Bによる実行が完了した」旨の書込があるかを確認する。判定部170Aは、処理実行部120Aが実行を完了した或る処理について、第2レジスタ220に「処理実行部120Bによる実行が完了した」旨の書込がないと、第2CPUユニット100Bに異常が発生したと判定する。 The determination unit 170A refers to the second register 220 of the common register 200, and indicates whether or not there is a writing that "execution by the processing execution unit 120B has been completed" for a certain process for which the processing execution unit 120A has completed execution. confirm. If the determination unit 170A does not write in the second register 220 that "execution by the process execution unit 120B has been completed" for a certain process for which the process execution unit 120A has completed execution, an error occurs in the second CPU unit 100B. Judge that it has occurred.

判定部170Bは、共通レジスタ200の第1レジスタ210を参照し、処理実行部120Bが実行を完了した或る処理について、「処理実行部120Aによる実行が完了した」旨の書込があるかを確認する。判定部170Bは、処理実行部120Bが実行を完了した或る処理について、第1レジスタ210に「処理実行部120Aによる実行が完了した」旨の書込がないと、第1CPUユニット100Aに異常が発生したと判定する。 The determination unit 170B refers to the first register 210 of the common register 200, and indicates whether or not there is a writing that "execution by the processing execution unit 120A has been completed" for a certain process for which the processing execution unit 120B has completed execution. confirm. If the determination unit 170B does not write in the first register 210 that "execution by the process execution unit 120A has been completed" for a certain process for which the process execution unit 120B has completed execution, an error occurs in the first CPU unit 100A. Judge that it has occurred.

(記憶部の詳細)
記憶部130は、第1CPUユニット100Aと第2CPUユニット100Bとの各々が使用する各種データを格納する記憶装置である。なお、記憶部130は、第1CPUユニット100Aと第2CPUユニット100Bとの各々が実行する(1)制御プログラム、(2)OSプログラム、(3)第1CPUユニット100Aと第2CPUユニット100Bとの各々が有する各種機能を実行するためのアプリケーションプログラム、および、(4)該アプリケーションプログラムを実行するときに読み出す各種データを非一時的に記憶してもよい。上記の(1)~(4)のデータは、例えば、ROM(read only memory)、フラッシュメモリ、EPROM(Erasable Programmable ROM)、EEPROM(登録商標)(Electrically EPROM)、HDD(Hard Disc Drive)等の不揮発性記憶装置に記憶される。第1CPUユニット100Aと第2CPUユニット100Bとの各々は、図示しない一時記憶部を備えていてもよい。一時記憶部は、第1CPUユニット100Aと第2CPUユニット100Bとの各々が実行する各種処理の過程で、演算に使用するデータおよび演算結果等を一時的に記憶するいわゆるワーキングメモリであり、RAM(Random Access Memory)等の揮発性記憶装置で構成される。どのデータをどの記憶装置に記憶するのかについては、第1CPUユニット100Aと第2CPUユニット100Bとの各々の使用目的、利便性、コスト、または、物理的な制約等から適宜決定される。記憶部130はさらに、他機能力テーブル140および自機能力テーブル150を格納している。
(Details of memory)
The storage unit 130 is a storage device that stores various data used by each of the first CPU unit 100A and the second CPU unit 100B. In the storage unit 130, each of (1) a control program, (2) an OS program, and (3) a first CPU unit 100A and a second CPU unit 100B executed by each of the first CPU unit 100A and the second CPU unit 100B The application program for executing the various functions possessed by the application program and (4) various data to be read when the application program is executed may be stored non-temporarily. The data of (1) to (4) above may be, for example, ROM (read only memory), flash memory, EPROM (Erasable Programmable ROM), EEPROM (registered trademark) (Electrically EPROM), HDD (Hard Disc Drive), or the like. Stored in a non-volatile storage device. Each of the first CPU unit 100A and the second CPU unit 100B may include a temporary storage unit (not shown). The temporary storage unit is a so-called working memory that temporarily stores data used for calculation, calculation results, etc. in the process of various processes executed by each of the first CPU unit 100A and the second CPU unit 100B, and is a RAM (Random). It consists of volatile storage devices such as Access Memory). Which data is stored in which storage device is appropriately determined from the purpose of use, convenience, cost, physical restrictions, etc. of each of the first CPU unit 100A and the second CPU unit 100B. The storage unit 130 further stores the other functional power table 140 and the self-functional power table 150.

他機能力テーブル140には、二重化される相手方のCPUユニットの性能Abyを示す情報である他機性能情報が格納される。図3を用いて説明したように、能力取得部110は、二重化される相手方のCPUユニットの自機能力テーブル150を参照して取得した他機性能情報を、自ユニットの他機能力テーブル140に格納する。 In the other functional power table 140, the performance information of the other machine, which is the information indicating the performance Aby of the CPU unit of the other party to be duplicated, is stored. As described with reference to FIG. 3, the capability acquisition unit 110 transfers the performance information of the other machine acquired by referring to the self-functional power table 150 of the other party's CPU unit to be duplicated in the other functional power table 140 of the own unit. Store.

自機能力テーブル150には、自ユニットの性能Abmを示す情報である自機性能情報が格納され、例えば、「自ユニットが、基準CPUユニットと比較して、どの程度の性能Ab(処理能力)を備えているのか」を示す自機性能情報が格納されている。自機性能情報は、例えば第1CPUユニット100Aと第2CPUユニット100Bとの各々の工場出荷時に、自機能力テーブル150に格納される。 The self-functioning power table 150 stores the own-machine performance information, which is information indicating the performance Abm of the own unit. For example, "how much performance Ab (processing capacity) the own unit has as compared with the reference CPU unit). The performance information of the own machine indicating "Is it equipped?" Is stored. The own machine performance information is stored in the self-functional power table 150 at the time of shipment from each of the first CPU unit 100A and the second CPU unit 100B, for example.

(CPUユニットについての整理)
これまでに図1を用いて構成を説明してきた第1CPUユニット100Aおよび第2CPUユニット100Bの各々について、その理解を容易にするため、以下のように整理しておく。すなわち、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、PLC10(コントローラ)において二重化されるCPUユニットであって、待ち時間設定部160(設定部)と判定部170とを備えている。待ち時間設定部160は、自ユニットの性能Abm(処理能力)と、二重化される相手方のCPUユニットの性能Abyとの比を考慮して、待ち時間Twを設定する。判定部170は、自ユニットにおける処理の実行完了時点から、待ち時間設定部160によって設定された待ち時間Twを経過するまでに、相手方のCPUユニットの前記処理の実行完了を確認できないと、相手方のCPUユニットに異常が発生したと判定する。
(Arrangement of CPU units)
In order to facilitate understanding of each of the first CPU unit 100A and the second CPU unit 100B whose configurations have been described with reference to FIG. 1, they are arranged as follows. That is, each of the first CPU unit 100A and the second CPU unit 100B is a CPU unit duplicated in the PLC 10 (controller), and includes a waiting time setting unit 160 (setting unit) and a determination unit 170. The waiting time setting unit 160 sets the waiting time Tw in consideration of the ratio between the performance Abm (processing capacity) of the own unit and the performance Aby of the CPU unit of the other party to be duplicated. If the determination unit 170 cannot confirm the completion of the execution of the processing of the other CPU unit from the time when the execution of the processing in the own unit is completed until the waiting time Tw set by the waiting time setting unit 160 elapses, the other party's CPU unit It is determined that an abnormality has occurred in the CPU unit.

前記の構成によれば、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自ユニットと相手方のCPUユニットとの性能Ab(処理能力)の比を考慮して待ち時間Twを設定する。そして、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、設定した待ち時間Twを利用して、自ユニットと相手方のCPUユニットとの同期(つまり、実行完了した処理の一致)を判定する。 According to the above configuration, each of the first CPU unit 100A and the second CPU unit 100B sets the waiting time Tw in consideration of the ratio of the performance Ab (processing capacity) between the own unit and the other CPU unit. Then, each of the first CPU unit 100A and the second CPU unit 100B uses the set waiting time Tw to determine the synchronization between the own unit and the CPU unit of the other party (that is, the match of the processing completed).

例えば、相手方のCPUユニットの方が自ユニットより性能Abが高い(つまり、処理の実行速度が早い)場合、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、待ち時間Twとして、予め決められた通常の待ち時間Twoを設定する。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、待ち時間Twとして、予め決められた「通常の待ち時間Two」を設定する。 For example, when the performance Ab of the other CPU unit is higher than that of the own unit (that is, the processing execution speed is faster), each of the first CPU unit 100A and the second CPU unit 100B is predetermined as a waiting time Tw. Set the normal waiting time Two. When the performance Ab of the other CPU unit and the own unit is the same, each of the first CPU unit 100A and the second CPU unit 100B sets a predetermined "normal waiting time Two" as the waiting time Tw.

相手方のCPUユニットの方が自ユニットより性能Abが高い場合、自ユニットが或る処理の実行を完了した時点では既に相手方のCPUユニットはその或る処理の実行を完了しているはずである。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、自ユニットが或る処理の実行を完了した時点で、相手方のCPUユニットは前記或る処理の実行を完了するはずである。 If the CPU unit of the other party has a higher performance Ab than the own unit, the CPU unit of the other party should have already completed the execution of the certain process when the own unit completes the execution of a certain process. Further, when the performance Ab is equal between the CPU unit of the other party and the own unit, the CPU unit of the other party should complete the execution of the certain process when the own unit completes the execution of a certain process.

したがって、相手方のCPUユニットの方が自ユニットより性能Abが高い場合でも、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、待ち時間Twとして、通常の待ち時間Twoを設定することで、相手方のCPUユニットに異常が発生したか否かを正確に判定することができる。 Therefore, even if the CPU unit of the other party has a higher performance Ab than the own unit, each of the first CPU unit 100A and the second CPU unit 100B can set the normal waiting time Tw as the waiting time Tw of the other party. It is possible to accurately determine whether or not an abnormality has occurred in the CPU unit.

例えば、相手方のCPUユニットの方が自ユニットより性能Abが低い場合、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、待ち時間Twとして、「通常の待ち時間Twoに、調整待ち時間Taを加えた期間」を設定する。調整待ち時間Taは、自ユニットと相手方のCPUユニットとの性能Abの差を考慮して設定される。例えば、「自ユニットにおける前記処理の実行完了時点と、相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点との差」が、調整待ち時間Taとされる。 For example, when the performance Ab of the other CPU unit is lower than that of the own unit, each of the first CPU unit 100A and the second CPU unit 100B has a waiting time Tw of "normal waiting time Two plus adjustment waiting time Ta". Set the period. The adjustment waiting time Ta is set in consideration of the difference in performance Ab between the own unit and the CPU unit of the other party. For example, "the difference between the time when the execution of the process in the own unit is completed and the time when the execution of the process is expected to be completed in the CPU unit of the other party" is defined as the adjustment waiting time Ta.

相手方のCPUユニットの方が自ユニットより性能Abが低い場合、自ユニットが或る処理の実行を完了した時点では、相手方のCPUユニットは、未だ前記或る処理の実行を完了していない。そこで、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、「相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点(実行完了予想時点)」まで待機する。そして、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、実行完了予想時点から、通常の待ち時間Twoが経過するまでに、相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。つまり、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自ユニットにおける前記処理の実行完了時点から、「調整待ち時間Taを、通常の待ち時間Twoに加えた期間」が経過するまでに、相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。 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 the certain process when the own unit completes the execution of a certain process. Therefore, each of the first CPU unit 100A and the second CPU unit 100B waits until "a time when the execution of the process in the other CPU unit is expected to be completed (execution completion expected time)". Then, each of the first CPU unit 100A and the second CPU unit 100B determines whether or not the execution completion of the process in the other CPU unit can be confirmed from the time when the execution completion is predicted until the normal waiting time Two elapses. That is, each of the first CPU unit 100A and the second CPU unit 100B is the other party from the time when the execution of the process in the own unit is completed until the "period in which the adjustment waiting time Ta is added to the normal waiting time Two" elapses. It is determined whether or not the execution completion of the process can be confirmed in the CPU unit of the above.

したがって、相手方のCPUユニットの方が自ユニットより性能Abが低い場合でも、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、待ち時間Twとして、「調整待ち時間Taを、通常の待ち時間Twoに加えた期間」を設定することで、前記の判定を正確に実行できる。 Therefore, even if the performance Ab of the other CPU unit is lower than that of the own unit, each of the first CPU unit 100A and the second CPU unit 100B sets the waiting time Tw to "adjustment waiting time Ta to normal waiting time Two". By setting the "added period", the above determination can be accurately executed.

以上の通り、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自ユニットと相手方のCPUユニットとで性能Abが一致しない場合であっても、自ユニットと相手方のCPUユニットとの性能Abの違いを考慮した、適切な待ち時間Twを設定できるとの効果を奏する。すなわち、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、二重化される相手方のCPUユニットと自ユニットとの性能Abの違いを考慮して、不要な待ち時間Twを設けずに、同期チェック処理を正確に行なうことができるとの効果を奏する。 As described above, each of the first CPU unit 100A and the second CPU unit 100B has a difference in performance Ab between the own unit and the other CPU unit even if the performance Ab does not match between the own unit and the other CPU unit. It is effective that an appropriate waiting time Tw can be set in consideration of the above. That is, each of the first CPU unit 100A and the second CPU unit 100B performs the synchronization check process without providing an unnecessary waiting time Tw in consideration of the difference in performance Ab between the CPU unit of the other party to be duplicated and the own unit. It has the effect of being able to be done accurately.

第1CPUユニット100Aおよび第2CPUユニット100Bの各々において、前記処理(同期チェック処理の対象となる処理)は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を含む。自己診断処理は、自ユニットのハードウェアに異常がないかを診断する処理である。命令実行処理は、「相手方のCPUユニット以外の、外部装置および外部ユニット」を制御する信号を生成する処理である。I/Oリフレッシュ処理は、「相手方のCPUユニット以外の、外部装置および外部ユニット」との間でデータを交換する処理である。待ち時間設定部160は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々について、待ち時間Twを設定する。判定部170は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々について、前記判定を、つまり、同期チェック処理を実行する。 In each of the first CPU unit 100A and the second CPU unit 100B, the process (process to be the target of the synchronization check process) includes a self-diagnosis process, an instruction execution process, and an I / O refresh process. The self-diagnosis process is a process of diagnosing whether or not there is an abnormality in the hardware of the own unit. The instruction execution process is a process of generating a signal for controlling "an external device and an external unit other than the CPU unit of the other party". The I / O refresh process is a process of exchanging data with "an external device and an external unit other than the other CPU unit". The waiting time setting unit 160 sets the waiting time Tw for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. The determination unit 170 executes the determination, that is, the synchronization check process, for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process.

第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々について、自ユニットと相手方のCPUユニットとの同期(つまり、実行完了した処理の一致)を判定する。 Each of the first CPU unit 100A and the second CPU unit 100B synchronizes the self-diagnosis process, the instruction execution process, and the I / O refresh process with the CPU unit of the other party (that is, the process of completing the execution). Match) is determined.

第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行完了のタイミングで、自ユニットと相手方のCPUユニットとの同期を判定することができるとの効果を奏する。 Each of the first CPU unit 100A and the second CPU unit 100B determines the synchronization between the own unit and the other CPU unit at the timing of completion of each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process. It has the effect of being able to.

第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する前に、二重化処理を1回実行する。第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、二重化処理において、相手方のCPUユニットの性能Abyを、相手方のCPUユニットから取得する。 Each of the first CPU unit 100A and the second CPU unit 100B executes the duplication process once before repeatedly executing the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. Each of the first CPU unit 100A and the second CPU unit 100B acquires the performance Aby of the other CPU unit from the other CPU unit in the duplication process.

前記の構成によれば、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、相手方のCPUユニットの性能Abyを、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する前に、1回取得する。そして、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、取得した相手方のCPUユニットの性能Abyと、自ユニットの性能Abmとの比を考慮して、前記各処理についての前記判定に用いる待ち時間Twを設定する。 According to the above configuration, each of the first CPU unit 100A and the second CPU unit 100B repeats the performance Aby of the other CPU unit, the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. Get it once before executing. Then, each of the first CPU unit 100A and the second CPU unit 100B takes into consideration the ratio between the acquired performance Aby of the other CPU unit and the performance Abm of the own unit, and waits for the determination for each of the processes. Set Tw.

第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、前記各処理を繰り返し実行する前に取得しておいた相手方のCPUユニットの性能Abyを考慮して、前記各処理についての前記判定に用いる待ち時間Twを、設定できるとの効果を奏する。 Each of the first CPU unit 100A and the second CPU unit 100B takes into consideration the performance Aby of the other CPU unit acquired before repeatedly executing each of the processes, and waits for the determination of each process. It has the effect of being able to set Tw.

§3.動作例
第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、図2に示すように、以下の処理を実行する。すなわち、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する。具体的には、各ユニットの処理実行部120が、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する。また、第1CPUユニット100Aおよび第2CPUユニット100Bの各々(特に、各ユニットの能力取得部110)は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する前に二重化処理を1回実行する。第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、二重化処理において、二重化される相手方のCPUユニットの性能Abyを示す他機性能情報を取得する。
§3. Operation Example Each of the first CPU unit 100A and the second CPU unit 100B executes the following processing as shown in FIG. That is, each of the first CPU unit 100A and the second CPU unit 100B repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. Specifically, the process execution unit 120 of each unit repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. Further, each of the first CPU unit 100A and the second CPU unit 100B (particularly, the capacity acquisition unit 110 of each unit) before repeatedly executing the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. The duplication process is executed once. Each of the first CPU unit 100A and the second CPU unit 100B acquires the performance information of another machine indicating the performance Aby of the other CPU unit to be duplicated in the duplication process.

各ユニット(特に、各ユニットの処理実行部120)は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各処理の実行を完了すると、「自ユニットが各処理の実行を完了した」旨を、共通レジスタ200に書き込む。 When each unit (particularly, the process execution unit 120 of each unit) completes the execution of each process of the self-diagnosis process, the instruction execution process, and the I / O refresh process, "the own unit has completed the execution of each process." Is written in the common register 200.

各ユニット(特に、各ユニットの待ち時間設定部160)は、他機性能情報、自機性能情報、および、自ユニットが実行完了した各処理の実行時間から、各処理についての同期チェック処理のための「待ち時間Tw」を設定する。 Each unit (particularly, the waiting time setting unit 160 of each unit) is used for synchronization check processing for each processing from the performance information of other machines, the performance information of own machine, and the execution time of each processing completed by the own unit. Set the "waiting time Tw" of.

具体的には、待ち時間設定部160は、各処理について、「自ユニットの性能Abmと二重化される相手方のCPUユニットの性能Abyとの比を考慮して算出する調整待ち時間Ta」を算出する。そして、待ち時間設定部160は、「各処理について算出した、調整待ち時間Ta」を、「各処理の、通常の待ち時間Two」に追加した期間を、各処理についての同期チェック処理のための「待ち時間Tw」として設定する。 Specifically, the waiting time setting unit 160 calculates "adjustment waiting time Ta calculated in consideration of the ratio between the performance Abm of the own unit and the performance Aby of the CPU unit of the other party to be duplicated" for each process. .. Then, the waiting time setting unit 160 adds the "adjustment waiting time Ta calculated for each process" to the "normal waiting time Two for each process" for the synchronization check process for each process. Set as "waiting time Tw".

「Abm/Aby」が「1」以下である場合、待ち時間設定部160は、各処理の「調整待ち時間Ta=0」とする。「Abm/Aby」が「1」より大きい場合、待ち時間設定部160は、各処理の「調整待ち時間Ta」を、各処理の実行時間に「Abm/Aby」を乗じた値とする。 When "Abm / Aby" is "1" or less, the waiting time setting unit 160 sets "adjustment waiting time Ta = 0" for each process. When "Abm / Aby" is larger than "1", the waiting time setting unit 160 sets the "adjustment waiting time Ta" of each process as the value obtained by multiplying the execution time of each process by "Abm / Aby".

各ユニット(特に、各ユニットの判定部170)は、自ユニットによる自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行完了後に、同期チェック処理を実行する。すなわち、判定部170は、共通レジスタ200を参照し、自ユニットによる各処理の実行完了時点から、待ち時間Twが経過するまでに、自ユニットが実行完了した処理について、相手方のCPUユニットが実行を完了するかを判定する。 Each unit (particularly, the determination unit 170 of each unit) executes the synchronization check process after each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process by the own unit is completed. That is, the determination unit 170 refers to the common register 200, and the CPU unit of the other party executes the processing completed by the own unit from the time when the execution of each process by the own unit is completed until the waiting time Tw elapses. Determine if it is complete.

同期チェック処理は、二重化される相手方のCPUユニットの状態を互いに監視する処理である。具体的には、同期チェック処理は、自ユニットにおいて実行の完了した処理について、二重化される相手方のCPUユニットにおいても、その処理の実行を完了しているかを確認する(判定する)処理である。 The synchronization check process is a process of mutually monitoring the status of the CPU units of the other party to be duplicated. Specifically, the synchronization check process is a process of confirming (determining) whether or not the CPU unit of the other party to be duplicated has completed the execution of the process whose execution has been completed in the own unit.

同期チェック処理において、同期が確認できないと、つまり、自ユニットで実行完了した処理について、相手方のCPUユニットにおける実行完了が確認できないと、第1CPUユニット100Aと第2CPUユニット100Bとは二重化を解消する。そして、例えばACTに異常が発生したと判定したSTBは、ACTに代わって自ユニットが運転を継続する。 In the synchronization check process, if synchronization cannot be confirmed, that is, if execution completion cannot be confirmed in the other CPU unit for the process whose execution has been completed in the own unit, the duplication of the first CPU unit 100A and the second CPU unit 100B is eliminated. Then, for example, in the STB that determines that an abnormality has occurred in the ACT, the own unit continues to operate in place of the ACT.

同期チェック処理において同期が確認できると、各ユニット(特に、各ユニットの処理実行部120)は、「同期チェック処理において自ユニットおよび相手方のCPUユニットによる実行完了が確認できた処理」の次の処理の実行を開始する。同期チェック処理は、具体的には、以下に示すように実行される。 When synchronization can be confirmed in the synchronization check process, each unit (particularly, the process execution unit 120 of each unit) performs the next process of "the process in which the execution completion by the own unit and the CPU unit of the other party can be confirmed in the synchronization check process". Starts executing. Specifically, the synchronization check process is executed as shown below.

すなわち、処理実行部120Aは、或る処理の実行を完了すると、共通レジスタ200の第1レジスタ210に、「自ユニット(つまり、処理実行部120A)が、或る処理の実行を完了した」旨を書き込む。判定部170Bは、第1レジスタ210を読み出すことで、第1CPUユニット100Aが或る処理の実行を完了したことを認識する。また、処理実行部120Bは、或る処理の実行を完了すると、共通レジスタ200の第2レジスタ220に、「自ユニット(つまり、処理実行部120B)が、或る処理の実行を完了した」旨を書き込む。判定部170Aは、第2レジスタ220を読み出すことで、第2CPUユニット100Bが或る処理の実行を完了したことを認識する。判定部170Aと判定部170Bとが各々、「相手方のCPUユニットによる、或る処理の実行完了」を認識したら、処理実行部120Aと処理実行部120Bとは各々、その或る処理の次の処理の実行を開始する。 That is, when the process execution unit 120A completes the execution of a certain process, the unit (that is, the process execution unit 120A) has completed the execution of the process in the first register 210 of the common register 200. To write. 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. Further, when the processing execution unit 120B completes the execution of a certain processing, the second register 220 of the common register 200 indicates that "the own unit (that is, the processing execution unit 120B) has completed the execution of the certain processing". To write. 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. When the determination unit 170A and the determination unit 170B each recognize "the execution completion of a certain process by the CPU unit of the other party", the process execution unit 120A and the process execution unit 120B each perform the next process of the certain process. Starts executing.

これまで説明してきた「第1CPUユニット100Aおよび第2CPUユニット100Bの各々が実行する処理」は、以下のように整理することができる。すなわち、「第1CPUユニット100Aおよび第2CPUユニット100Bの各々が実行する処理」は、PLC10(コントローラ)において二重化されるCPUユニットの制御方法であって、設定ステップと、判定ステップとを含んでいる。設定ステップは、自ユニットの性能Abmと、二重化される相手方のCPUユニットの性能Abyとの比を考慮して、待ち時間Twを設定する。判定ステップは、自ユニットにおける処理の実行完了時点から、設定ステップにて設定された待ち時間Twを経過するまでに、相手方のCPUユニットにおける前記処理の実行完了を確認できないと、相手方のCPUユニットに異常が発生したと判定する。 The "processes executed by each of the first CPU unit 100A and the second CPU unit 100B" described so far can be organized as follows. That is, the "process executed by each of the first CPU unit 100A and the second CPU unit 100B" is a control method of the CPU unit duplicated in the PLC 10 (controller), and includes a setting step and a determination step. In the setting step, the waiting time Tw is set in consideration of the ratio between the performance Abm of the own unit and the performance Aby of the CPU unit of the other party to be duplicated. In the determination step, if it is not possible to confirm the completion of execution of the process in the CPU unit of the other party from the time when the execution of the process in the own unit is completed until the waiting time Tw set in the setting step elapses, the CPU unit of the other party is informed. Judge that an abnormality has occurred.

前記の方法によれば、前記制御方法は、自ユニットと相手方のCPUユニットとの性能Abの比を考慮して設定した待ち時間Twを利用して、自ユニットと相手方のCPUユニットとの同期(つまり、実行完了した処理の一致)を判定する。 According to the above method, in the control method, synchronization between the own unit and the CPU unit of the other party is performed by using the waiting time Tw set in consideration of the ratio of the performance Ab between the own unit and the CPU unit of the other party. That is, the match of the processed processing completed) is determined.

例えば、相手方のCPUユニットの方が自ユニットより性能Abが高い(つまり、処理の実行速度が早い)場合、前記制御方法は、待ち時間Twとして、予め決められた「通常の待ち時間Two」を設定する。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、前記制御方法は、待ち時間Twとして、予め決められた「通常の待ち時間Two」を設定する。 For example, when the CPU unit of the other party has a higher performance Ab (that is, the execution speed of processing is faster) than the own unit, the control method uses a predetermined "normal waiting time Two" as the waiting time Tw. Set. Further, when the performance Ab is equal between the CPU unit of the other party and the own unit, the control method sets a predetermined "normal waiting time Two" as the waiting time Tw.

相手方のCPUユニットの方が自ユニットより性能Abが高い場合、自ユニットが或る処理の実行を完了した時点では既に相手方のCPUユニットは前記或る処理の実行を完了しているはずである。また、相手方のCPUユニットと自ユニットとで性能Abが等しい場合、自ユニットが或る処理の実行を完了した時点で、相手方のCPUユニットは前記或る処理の実行を完了するはずである。 If the CPU unit of the other party has a higher performance Ab than the own unit, the CPU unit of the other party should have already completed the execution of the certain process when the own unit completes the execution of a certain process. Further, when the performance Ab is equal between the CPU unit of the other party and the own unit, the CPU unit of the other party should complete the execution of the certain process when the own unit completes the execution of a certain process.

したがって、相手方のCPUユニットの方が自ユニットより性能Abが高い場合でも、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、待ち時間Twとして、通常の待ち時間Twoを設定することで、相手方のCPUユニットに異常が発生したか否かを正確に判定することができる。 Therefore, even if the CPU unit of the other party has a higher performance Ab than the own unit, each of the first CPU unit 100A and the second CPU unit 100B can set the normal waiting time Tw as the waiting time Tw of the other party. It is possible to accurately determine whether or not an abnormality has occurred in the CPU unit.

例えば、相手方のCPUユニットの方が自ユニットより性能Abが低い(つまり、処理の実行速度が遅い)場合、前記制御方法は、待ち時間Twとして、「通常の待ち時間Twoに、性能Abの差を考慮した調整待ち時間Taを加えた期間」を設定する。具体的には、「自ユニットにおける前記処理の実行完了時点と、相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点との差」を、調整待ち時間Taとする。 For example, when the CPU unit of the other party has a lower performance Ab than the own unit (that is, the execution speed of the process is slower), the control method uses the waiting time Tw as "the difference between the normal waiting time Two and the performance Ab". The period in which the adjustment waiting time Ta is added in consideration of the above is set. Specifically, the "difference between the time when the execution of the process in the own unit is completed and the time when the execution of the process in the other CPU unit is expected to be completed" is defined as the adjustment waiting time Ta.

相手方のCPUユニットの方が自ユニットより性能Abが低い場合、自ユニットが或る処理の実行を完了した時点では、相手方のCPUユニットは、未だ前記或る処理の実行を完了していない。そこで、前記制御方法は、「相手方のCPUユニットにおける前記処理の実行が完了すると予想される時点」まで待機し、その後、「通常の待ち時間Two」が経過するまでに相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。つまり、前記制御方法は、自ユニットにおける前記処理の実行完了時点から、「調整待ち時間Taを、通常の待ち時間Twoに加えた期間」が経過するまでに、相手方のCPUユニットにおける前記処理の実行完了を確認できるかを判定する。 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 the certain process when the own unit completes the execution of a certain process. Therefore, the control method waits until "a time when the execution of the process is expected to be completed in the CPU unit of the other party", and then waits until the "normal waiting time Two" elapses, and then the process in the CPU unit of the other party. Judge whether the execution completion of is confirmed. That is, in the control method, the execution of the processing in the CPU unit of the other party elapses from the time when the execution of the processing in the own unit is completed until the "period in which the adjustment waiting time Ta is added to the normal waiting time Two" elapses. Determine if completion can be confirmed.

したがって、相手方のCPUユニットの方が自ユニットより性能Abが低い場合でも、前記制御方法は、待ち時間Twとして、「調整待ち時間Taを、通常の待ち時間Twoに加えた期間」を設定することで、前記の判定を正確に実行できる。 Therefore, even if the performance Ab of the CPU unit of the other party is lower than that of the own unit, the control method sets "the period in which the adjustment waiting time Ta is added to the normal waiting time Two" as the waiting time Tw. Therefore, the above determination can be accurately executed.

以上の通り、前記制御方法は、自ユニットと相手方のCPUユニットとで性能Abが一致しない場合であっても、自ユニットと相手方のCPUユニットとの性能Abの違いを考慮した、適切な待ち時間Twを設定できるとの効果を奏する。すなわち、前記制御方法は、二重化される相手方のCPUユニットと自ユニットとの性能Abの違いを考慮して、不要な待ち時間Twを設けずに、同期チェック処理を正確に行なうことができるとの効果を奏する。 As described above, the control method has an appropriate waiting time in consideration of the difference in performance Ab between the own unit and the CPU unit of the other party even if the performance Ab does not match between the own unit and the CPU unit of the other party. It has the effect of being able to set Tw. That is, the control method can accurately perform the synchronization check process without providing an unnecessary waiting time Tw in consideration of the difference in performance Ab between the CPU unit of the other party to be duplicated and the own unit. It works.

〔実施形態2〕
本発明の他の実施形態について、図4から図7に基づいて説明すれば、以下のとおりである。なお記載の簡潔性を担保するため、実施形態1とは異なる構成(処理の手順および処理の内容)のみについて説明する。すなわち、実施形態1で記載された構成等は、本実施形態にもすべて含まれ得る。また、実施形態1で記載した用語の定義も同じである。
[Embodiment 2]
The other embodiments of the present invention will be described below with reference to FIGS. 4 to 7. In order to ensure the conciseness of the description, only the configuration (processing procedure and processing content) different from the first embodiment will be described. That is, all the configurations and the like described in the first embodiment can be included in the present embodiment. Further, the definitions of the terms described in the first embodiment are the same.

実施形態1において、PLC10において二重化される第1CPUユニット100Aと第2CPUユニット100Bとが、自ユニットの「待ち時間Tw」を設定するのに用いた相手方のCPUユニットの性能Abyは1種類であった。 In the first embodiment, the first CPU unit 100A and the second CPU unit 100B duplicated in the PLC 10 have one type of performance Aby of the other CPU unit used to set the "waiting time Tw" of the own unit. ..

これに対し、本実施形態に係る、PLC20において二重化される第1CPUユニット300Aと第2CPUユニット300Bとが、自ユニットの「待ち時間Tw」を設定するのに用いる相手方のCPUユニットの性能Abyは複数である。以下、詳細を説明する。 On the other hand, the first CPU unit 300A and the second CPU unit 300B duplicated in the PLC 20 according to the present embodiment have a plurality of performance Abys of the other CPU unit used to set the "waiting time Tw" of the own unit. Is. The details will be described below.

図5は、第1CPUユニット300Aおよび第2CPUユニット300Bの各々を実現するハードウェア構成の一例を示す図である。すなわち、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、メモリ410と、CPU420(マイコン)と、専用LSI(Large Scale Integration)430とを用いて実現される。専用LSIは、「ASIC(Application Specific Integrated Circuit)」とも呼ばれ、専用LSIの代わりに、FPGA(Field Programmable Gate Array)が用いられてもよい。 FIG. 5 is a diagram showing an example of a hardware configuration that realizes each of the first CPU unit 300A and the second CPU unit 300B. That is, each of the first CPU unit 300A and the second CPU unit 300B is realized by using the memory 410, the CPU 420 (microcomputer), and the dedicated LSI (Large Scale Integration) 430. The dedicated LSI is also called an "ASIC (Application Specific Integrated Circuit)", and an FPGA (Field Programmable Gate Array) may be used instead of the dedicated LSI.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、第1CPUユニット100Aおよび第2CPUユニット100Bの各々と同様に、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順に繰り返し実行する。例えば、自己診断処理は主にCPU420で実行され、命令実行処理は主に専用LSI430で実行され、I/Oリフレッシュ処理は主に専用LSI430を経由してCPU420で実行される。 Each of the first CPU unit 300A and the second CPU unit 300B repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order, similarly to each of the first CPU unit 100A and the second CPU unit 100B. .. For example, the self-diagnosis process is mainly executed by the CPU 420, the instruction execution process is mainly executed by the dedicated LSI 430, and the I / O refresh process is mainly executed by the CPU 420 via the dedicated LSI 430.

自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々が主として実行されるハードウェアが異なる場合、各処理について、第1CPUユニット300Aと第2CPUユニット300Bとで性能Abが異なる場合がある。例えば、第1CPUユニット300AのCPU420は、第2CPUユニット300BのCPU420より性能Abが高く、第1CPUユニット300Aの専用LSI430は、第2CPUユニット300Bの専用LSI430より性能Abが低いことがあり得る。この場合、自己診断処理については、第1CPUユニット300Aの方が第2CPUユニット300Bより早く実行完了し、命令実行処理については、第1CPUユニット300Aの方が第2CPUユニット300Bより遅く実行完了する。 When the hardware in which the self-diagnosis process, the instruction execution process, and the I / O refresh process are mainly executed is different, the performance Ab may differ between the first CPU unit 300A and the second CPU unit 300B for each process. .. For example, the CPU 420 of the first CPU unit 300A may have a higher performance Ab than the CPU 420 of the second CPU unit 300B, and the dedicated LSI 430 of the first CPU unit 300A may have a lower performance Ab than the dedicated LSI 430 of the second CPU unit 300B. In this case, the first CPU unit 300A completes the execution of the self-diagnosis process earlier than the second CPU unit 300B, and the first CPU unit 300A completes the execution of the instruction execution process later than the second CPU unit 300B.

そこで、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、繰り返し実行する自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々について、自ユニットおよび相手方のCPUユニットの性能Abを把握する。そして、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、各処理に係る自ユニットおよび相手方のCPUユニットの性能Abを用いて、各処理についての同期チェック処理の際の「待ち時間Tw」を設定する。以下、詳細を説明する。 Therefore, each of the first CPU unit 300A and the second CPU unit 300B grasps the performance Ab of the own unit and the other CPU unit for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process that are repeatedly executed. .. Then, each of the first CPU unit 300A and the second CPU unit 300B sets the "waiting time Tw" at the time of the synchronization check processing for each processing by using the performance Ab of the own unit and the other CPU unit related to each processing. do. The details will be described below.

(CPUユニットの詳細)
図4は、第1CPUユニット300Aおよび第2CPUユニット300Bを含むPLC20の要部構成を示すブロック図である。PLC20は、PLC10と同様に、電源ユニット、入力ユニット、出力ユニット、および、通信ユニット等の不図示の機能ユニットを含んでいてもよい。
(Details of CPU unit)
FIG. 4 is a block diagram showing a main configuration of the PLC 20 including the first CPU unit 300A and the second CPU unit 300B. Like the PLC 10, the PLC 20 may include a power supply unit, an input unit, an output unit, and a functional unit (not shown) such as a communication unit.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、第1CPUユニット100Aおよび第2CPUユニット100Bの各々と同様に、PLC10全体の制御を統括する機能ユニットである。第1CPUユニット300Aと第2CPUユニット300Bとは、PLC20において二重化される。すなわち、第1CPUユニット300Aと第2CPUユニット300Bとは、一方が実行系のCPUユニット(ACT)となり、他方が待機系のCPUユニット(STB)となって、互いに相手の状態を監視する。同期チェック処理においてACTに異常が発生したと判定すると、STBは、それまでACTであったCPUユニットに代わって自ユニットがACTへと切り替わって、運転を継続する。本実施形態においては、「第1CPUユニット300AがACTであり、第2CPUユニット300BがSTBである」例を説明するが、「第1CPUユニット300AがSTBであり、第2CPUユニット300BがACTである」場合も同様である。 Each of the first CPU unit 300A and the second CPU unit 300B is a functional unit that controls the control of the entire PLC 10 like each of the first CPU unit 100A and the second CPU unit 100B. The first CPU unit 300A and the second CPU unit 300B are duplicated in the PLC 20. That is, one of the first CPU unit 300A and the second CPU unit 300B becomes the CPU unit (ACT) of the executing system, and the other becomes the CPU unit (STB) of the standby system, and monitors the state of each other. When it is determined that an abnormality has occurred in the ACT in the synchronization check process, the STB switches its own unit to the ACT instead of the CPU unit which was the ACT until then, and continues the operation. In the present embodiment, an example of "the first CPU unit 300A is an ACT and the second CPU unit 300B is an STB" will be described, but "the first CPU unit 300A is an STB and the second CPU unit 300B is an ACT". The same applies to the case.

図4に示すように、PLC20は、PLC20において二重化される第1CPUユニット300Aと第2CPUユニット300Bとに加え、両者が各々、書込および読込を実行することのできる共通レジスタ200を備えている。共通レジスタ200については既に説明しているので、ここでは詳細は略記する。 As shown in FIG. 4, the PLC 20 includes, in addition to the first CPU unit 300A and the second CPU unit 300B, which are duplicated in the PLC 20, a common register 200 in which both can execute writing and reading, respectively. Since the common register 200 has already been described, the details will be omitted here.

記載の簡潔性を担保するため、本実施の形態に直接関係のない構成は、説明およびブロック図から省略している。ただし、実施の実情に則して、PLC10は、当該省略された構成を備えてもよい。 In order to ensure the conciseness of the description, the configuration not directly related to the present embodiment is omitted from the description and the block diagram. However, according to the actual situation of implementation, the PLC 10 may have the omitted configuration.

第1CPUユニット300Aは、記憶部330Aに加えて、機能ブロックとして、能力取得部310A、処理実行部120A、待ち時間設定部360A、および、判定部370Aを備えている。記憶部330Aは、他機能力テーブル340Aおよび自機能力テーブル350Aを格納している。 In addition to the storage unit 330A, the first CPU unit 300A includes a capacity acquisition unit 310A, a processing execution unit 120A, a waiting time setting unit 360A, and a determination unit 370A as functional blocks. The storage unit 330A stores the other functional power table 340A and the self-functional power table 350A.

待ち時間設定部360Aは、第1待ち時間設定部361A、第2待ち時間設定部362A、第3待ち時間設定部363Aを含み、判定部370Aは、第1判定部371A、第2判定部372A、第3判定部373Aを含む。他機能力テーブル340Aは、第1他機能力テーブル341A、第2他機能力テーブル342A、第3他機能力テーブル343Aを含む。自機能力テーブル350Aは、第1自機能力テーブル351A、第2自機能力テーブル352A、第3自機能力テーブル353Aを含む。 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, and the determination unit 370A includes a first determination unit 371A and a second determination unit 372A. The third determination unit 373A is included. The other functional force table 340A includes a first other functional force table 341A, a second other functional force table 342A, and a third other functional force table 343A. The self-functional power table 350A includes a first self-functional power table 351A, a second self-functional power table 352A, and a third self-functional power table 353A.

第2CPUユニット300Bは、記憶部330Bに加えて、機能ブロックとして、能力取得部310B、処理実行部120B、待ち時間設定部360B、および、判定部370Bを備えている。記憶部330Bは、他機能力テーブル340Bおよび自機能力テーブル350Bを格納している。 In addition to the storage unit 330B, the second CPU unit 300B includes a capacity acquisition unit 310B, a processing execution unit 120B, a waiting time setting unit 360B, and a determination unit 370B as functional blocks. The storage unit 330B stores the other functional power table 340B and the self-functional power table 350B.

待ち時間設定部360Bは、第1待ち時間設定部361B、第2待ち時間設定部362B、第3待ち時間設定部363Bを含み、判定部370Bは、第1判定部371B、第2判定部372B、第3判定部373Bを含む。他機能力テーブル340Bは、第1他機能力テーブル341B、第2他機能力テーブル342B、第3他機能力テーブル343Bを含む。自機能力テーブル350Bは、第1自機能力テーブル351B、第2自機能力テーブル352B、第3自機能力テーブル353Bを含む。 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, and the determination unit 370B includes a first determination unit 371B and a second determination unit 372B. The third determination unit 373B is included. The other functional force table 340B includes a first other functional force table 341B, a second other functional force table 342B, and a third other functional force table 343B. The self-functional power table 350B includes a first self-functional power table 351B, a second self-functional power table 352B, and a third self-functional power table 353B.

実施形態1における第1CPUユニット100Aおよび第2CPUユニット100Bと同様、図4に示す第1CPUユニット300Aおよび第2CPUユニット300Bは、互いに同様の構成を備えている。第1CPUユニット300Aおよび第2CPUユニット300Bの各々が共通して備える構成を特に区別する必要がある場合、第1CPUユニット300Aの構成である場合には「A」を、第2CPUユニット300Bの構成である場合には「B」を付す。第1CPUユニット300Aおよび第2CPUユニット300Bの各々が共通して備える構成について、どちらが備える構成であるかを特に区別する必要がない場合、「A」または「B」の添え字は略記する。 Similar to the first CPU unit 100A and the second CPU unit 100B in the first embodiment, the first CPU unit 300A and the second CPU unit 300B shown in FIG. 4 have similar configurations to each other. When it is necessary to particularly distinguish the configurations provided in common by each of the first CPU unit 300A and the second CPU unit 300B, "A" is the configuration of the second CPU unit 300B in the case of the configuration of the first CPU unit 300A. In the case, "B" is added. When it is not necessary to distinguish which of the first CPU unit 300A and the second CPU unit 300B has in common, the subscripts of "A" and "B" are abbreviated.

能力取得部310、処理実行部120、待ち時間設定部360、および、判定部370等の各機能ブロックは、例えば、CPU(central processing unit)等が、ROM(read only memory)、NVRAM(non-Volatile random access memory)等で実現された記憶装置(記憶部330)に記憶されているプログラムを不図示のRAM(random access memory)等に読み出して実行することで実現できる。 Each functional block such as the capacity acquisition unit 310, the processing execution unit 120, the waiting time setting unit 360, and the determination unit 370 includes, for example, a CPU (central processing unit) or the like having a ROM (read only memory) or NVRAM (non-). It can be realized by reading a program stored in a storage device (storage unit 330) realized by a Volatile random access memory) or the like into a RAM (random access memory) or the like (not shown) and executing the program.

(機能ブロックの詳細)
能力取得部310は、処理実行部120によって繰り返し実行される自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々に係る、二重化される相手方のCPUユニットの性能Aby(処理能力)を示す情報(「性能情報」)を取得する。具体的には、能力取得部310は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々に係る相手方のCPUユニットの性能情報を、相手方のCPUユニットの自機能力テーブル350を参照して取得する。能力取得部310は、取得した「自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々に係る、相手方のCPUユニットの性能情報(他機性能情報)」を、自ユニットの他機能力テーブル340に格納する。
(Details of functional blocks)
The capacity acquisition unit 310 determines the performance Aby (processing capacity) of the CPU unit of the other party to be duplicated, which is related to each of the self-diagnosis process, the instruction execution process, and the I / O refresh process, which are repeatedly executed by the process execution unit 120. Acquires the indicated information (“performance information”). Specifically, the capability acquisition unit 310 displays the performance information of the other party's CPU unit related to each of the self-diagnosis process, the instruction execution process, and the I / O refresh process, and displays the self-functioning power table 350 of the other party's CPU unit. Refer to and get. The capability acquisition unit 310 uses the acquired "performance information of the other CPU unit (performance information of other machines) related to each of the self-diagnosis process, the instruction execution process, and the I / O refresh process" to other functions of the own unit. Store in the force table 340.

特に、能力取得部310は、処理実行部120が自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する前に1回、図6に例示する「二重化処理」において、各処理に係る他機性能情報を取得する。 In particular, the capability acquisition unit 310 has the “duplication process” illustrated in FIG. 6 once before the process execution unit 120 repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. In, the performance information of other machines related to each process is acquired.

能力取得部310は、二重化される相手方のCPUユニットの第1自機能力テーブル351を参照し、「自己診断処理に係る、二重化される相手方のCPUユニットの性能Abyを示す性能情報(自己診断用他機性能情報)」を取得する。能力取得部310は、取得した自己診断用他機性能情報を、自ユニットの第1他機能力テーブル341に格納する。 The capacity acquisition unit 310 refers to the first self-functioning power table 351 of the CPU unit of the other party to be duplicated, and "performance information indicating the performance Aby of the CPU unit of the other party to be duplicated related to the self-diagnosis process (for self-diagnosis). Other machine performance information) ”is acquired. The capacity acquisition unit 310 stores the acquired performance information of the other machine for self-diagnosis in the first other functional power table 341 of the own unit.

能力取得部310は、二重化される相手方のCPUユニットの第2自機能力テーブル352を参照し、「命令実行処理に係る、二重化される相手方のCPUユニットの性能Abyを示す性能情報(命令実行用他機性能情報)」を取得する。能力取得部310は、取得した命令実行用他機性能情報を、自ユニットの第2他機能力テーブル342に格納する。 The capacity acquisition unit 310 refers to the second self-functioning power table 352 of the CPU unit of the other party to be duplicated, and "performance information indicating the performance Aby of the CPU unit of the other party to be duplicated related to the instruction execution process (for instruction execution). Other machine performance information) ”is acquired. The capability acquisition unit 310 stores the acquired instruction execution other machine performance information in the second other functional force table 342 of the own unit.

能力取得部310は、二重化される相手方のCPUユニットの第3自機能力テーブル353を参照し、「I/Oリフレッシュ処理に係る、二重化される相手方のCPUユニットの性能Abyを示す性能情報(I/Oリフレッシュ用他機性能情報)」を取得する。能力取得部310は、取得したI/Oリフレッシュ用他機性能情報を、自ユニットの第3他機能力テーブル343に格納する。 The capacity acquisition unit 310 refers to the third self-functioning power table 353 of the CPU unit of the other party to be duplicated, and "performance information (I) indicating the performance Aby of the CPU unit of the other party to be duplicated related to the I / O refresh process. / O Performance information of other machines for refreshing) ”is acquired. The capacity acquisition unit 310 stores the acquired performance information of the other machine for I / O refresh in the third other functional power table 343 of the own unit.

図7は、「二重化処理」において1回実行される、「二重化される相手方のCPUユニットの性能Abyを示す性能情報を取得する」処理の具体例を説明する図である。図7に示すように、能力取得部310Aは、「自己診断処理に係る、第2CPUユニット300Bの性能Abyを示す性能情報(自己診断用他機性能情報)」を、第2CPUユニット300Bの第1自機能力テーブル351Bを参照して取得する。能力取得部310Aは、取得した自己診断用他機性能情報を、自ユニットの第1他機能力テーブル341Aに格納する。 FIG. 7 is a diagram illustrating a specific example of a process of "acquiring performance information indicating the performance Aby of the CPU unit of the other party to be duplicated", which is executed once in the "duplication process". As shown in FIG. 7, the capability acquisition unit 310A provides "performance information indicating the performance Aby of the second CPU unit 300B (performance information of another machine for self-diagnosis) related to the self-diagnosis process" to the first of the second CPU unit 300B. Obtained by referring to the self-functioning power table 351B. The capacity acquisition unit 310A stores the acquired performance information of the other machine for self-diagnosis in the first other functional power table 341A of the own unit.

能力取得部310Bは、「自己診断処理に係る、第1CPUユニット300Aの性能Abyを示す性能情報(自己診断用他機性能情報)」を、第1CPUユニット300Aの第1自機能力テーブル351Aを参照して取得する。能力取得部310Bは、取得した自己診断用他機性能情報を、自ユニットの第1他機能力テーブル341Bに格納する。 The capacity acquisition unit 310B refers to "performance information indicating the performance Aby of the first CPU unit 300A related to the self-diagnosis process (performance information of other machines for self-diagnosis)" with reference to the first self-functioning power table 351A of the first CPU unit 300A. And get it. The capacity acquisition unit 310B stores the acquired performance information of the other machine for self-diagnosis in the first other functional power table 341B of the own unit.

能力取得部310Aは、「命令実行処理に係る、第2CPUユニット300Bの性能Abyを示す性能情報(命令実行用他機性能情報)」を、第2CPUユニット300Bの第2自機能力テーブル352Bを参照して取得する。能力取得部310Aは、取得した命令実行用他機性能情報を、自ユニットの第2他機能力テーブル342Aに格納する。 The capacity acquisition unit 310A refers to "performance information indicating the performance Aby of the second CPU unit 300B related to the instruction execution process (performance information of another machine for instruction execution)" with reference to the second self-functioning power table 352B of the second CPU unit 300B. And get it. The capability acquisition unit 310A stores the acquired instruction execution other machine performance information in the second other functional force table 342A of the own unit.

能力取得部310Bは、「命令実行処理に係る、第1CPUユニット300Aの性能Abyを示す性能情報(命令実行用他機性能情報)」を、第1CPUユニット300Aの第2自機能力テーブル352Aを参照して取得する。能力取得部310Bは、取得した命令実行用他機性能情報を、自ユニットの第2他機能力テーブル342Bに格納する。 The capability acquisition unit 310B refers to "performance information indicating the performance Aby of the first CPU unit 300A related to the instruction execution process (performance information of another machine for instruction execution)" with reference to the second self-functioning power table 352A of the first CPU unit 300A. And get it. The capability acquisition unit 310B stores the acquired instruction execution other machine performance information in the second other functional force table 342B of the own unit.

能力取得部310Aは、「I/Oリフレッシュ処理に係る、第2CPUユニット300Bの性能Abyを示す性能情報(I/Oリフレッシュ処理用他機性能情報)」を、第2CPUユニット300Bの第3自機能力テーブル353Bを参照して取得する。能力取得部310Aは、取得したI/Oリフレッシュ処理用他機性能情報を、自ユニットの第3他機能力テーブル343Aに格納する。 The capacity acquisition unit 310A provides "performance information indicating the performance Aby of the second CPU unit 300B related to the I / O refresh process (performance information of other machines for the I / O refresh process)" to the third self-function of the second CPU unit 300B. Obtained with reference to the force table 353B. The capacity acquisition unit 310A stores the acquired performance information of the other machine for I / O refresh processing in the third other functional power table 343A of the own unit.

能力取得部310Bは、「I/Oリフレッシュ処理に係る、第1CPUユニット300Aの性能Abyを示す性能情報(I/Oリフレッシュ処理用他機性能情報)」を、第1CPUユニット300Aの第3自機能力テーブル353Aを参照して取得する。能力取得部310Bは、取得したI/Oリフレッシュ処理用他機性能情報を、自ユニットの第3他機能力テーブル343Bに格納する。 The capacity acquisition unit 310B provides "performance information indicating the performance Aby of the first CPU unit 300A related to the I / O refresh process (performance information of other machines for the I / O refresh process)" to the third self-function of the first CPU unit 300A. Obtained with reference to force table 353A. The capacity acquisition unit 310B stores the acquired performance information of the other machine for I / O refresh processing in the third other functional power table 343B of the own unit.

処理実行部120は、実施形態1で説明したように、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行し、各処理の実行を完了すると、「自ユニットが各処理の実行を完了した」旨を、共通レジスタ200に書き込む。 As described in the first embodiment, the process execution unit 120 repeatedly executes the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order, and when the execution of each process is completed, the "own unit" Has completed the execution of each process "is written in the common register 200.

また、処理実行部120は、各処理の実行を完了すると、「自ユニットが各処理の実行を完了した」旨を、待ち時間設定部360および判定部370に通知する。処理実行部120は、待ち時間設定部360に、「自ユニットが各処理の実行を完了した」旨と共に、「各処理の実行時間(各処理について、実行開始から実行完了までの時間)」を通知してもよい。すなわち、処理実行部120は、内部タイマを用いて「各処理の実行時間」を計時し、計時した「各処理の実行時間」を待ち時間設定部360に通知してもよい。 Further, when the process execution unit 120 completes the execution of each process, the process execution unit 120 notifies the waiting time setting unit 360 and the determination unit 370 that "the own unit has completed the execution of each process". The process execution unit 120 informs the waiting time setting unit 360 that "the own unit has completed the execution of each process" and "execution time of each process (time from the start of execution to the completion of execution of each process)". You may notify. That is, the process execution unit 120 may use an internal timer to time the "execution time of each process" and notify the timed-out "execution time of each process" to the waiting time setting unit 360.

待ち時間設定部360は、他機能力テーブル340を参照して他機性能情報を取得し、自機能力テーブル350を参照して自機性能情報を取得する。また、待ち時間設定部360は、処理実行部120から、「自ユニットが各処理の実行を完了した」旨を取得する。待ち時間設定部360は、「自ユニットが各処理の実行を完了した」旨を取得する前に処理実行部120から取得していた「自ユニットが各処理の実行を開始した」旨と併せて、各処理の実行時間を演算する。すなわち、待ち時間設定部360は、内部タイマにより計時した「自ユニットが各処理の実行を開始した」時刻と、内部タイマにより計時した「自ユニットが各処理の実行を完了した」時刻とから、各処理の実行時間を演算する。なお、各処理の実行時間は、処理実行部120が内部タイマを用いて計時し、処理実行部120から待ち時間設定部360へと通知されてもよい。 The waiting time setting unit 360 refers to the other functional power table 340 to acquire the performance information of the other machine, and refers to the self-functional power table 350 to acquire the performance information of the own machine. Further, the waiting time setting unit 360 acquires from the processing execution unit 120 that "the own unit has completed the execution of each processing". The waiting time setting unit 360 together with the fact that "the own unit has started the execution of each process" acquired from the process execution unit 120 before acquiring "the own unit has completed the execution of each process". , Calculate the execution time of each process. That is, the waiting time setting unit 360 is based on the time when "the own unit starts executing each process" timed by the internal timer and the time when "the own unit completes the execution of each process" timed by the internal timer. Calculate the execution time of each process. The execution time of each process may be timed by the process execution unit 120 using an internal timer, and may be notified from the process execution unit 120 to the waiting time setting unit 360.

待ち時間設定部360は、取得した他機性能情報、自機性能情報、および、各処理の実行時間から、各処理についての同期チェック処理のための「待ち時間Tw」を算出し、算出した待ち時間Twを、判定部370へ通知する。具体的には、待ち時間設定部360は、他機性能情報、自機性能情報、および、各処理の実行時間を用いて、以下のように、各処理についての同期チェック処理のための「待ち時間Tw」を算出する。 The waiting time setting unit 360 calculates the "waiting time Tw" for the synchronization check processing for each processing from the acquired other machine performance information, the own machine performance information, and the execution time of each processing, and the calculated waiting time. Notify the determination unit 370 of the time Tw. Specifically, the waiting time setting unit 360 uses the performance information of other machines, the performance information of its own machine, and the execution time of each process to "wait" for the synchronization check process for each process as follows. "Time Tw" is calculated.

すなわち、他機性能情報に示される「二重化される相手方のCPUユニットの性能Aby」が、自機性能情報に示される「自ユニットの性能Abm」より高い場合、待ち時間設定部360は、「通常の待ち時間Two」を「待ち時間Tw」とする。二重化される相手方のCPUユニットの性能Abyと自ユニットの性能Abmとが等しい場合、待ち時間設定部360は、「通常の待ち時間Two」を「待ち時間Tw」とする。 That is, when the "performance Aby of the other party's CPU unit to be duplicated" shown in the performance information of the other machine is higher than the "performance Abm of the own unit" shown in the performance information of the own machine, the waiting time setting unit 360 is "normally". "Waiting time Tw" is defined as "waiting time Tw". When the performance Aby of the CPU unit of the other party to be duplicated and the performance Abm of the own unit are equal, the waiting time setting unit 360 sets "normal waiting time Two" to "waiting time Tw".

「通常の待ち時間Two」は、予め長さの決められている、第1CPUユニット300Aと第2CPUユニット300Bとで共通の期間であり、例えば、各ユニットの工場出荷時に設定され、ユーザによって更新可能な期間である。「通常の待ち時間Two」は、第1CPUユニット300Aと第2CPUユニット300Bとで性能Ab(特に、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々に係る性能Ab)が等しいとの前提で設定される期間である。 The "normal waiting time Two" is a period common to the first CPU unit 300A and the second CPU unit 300B, which has a predetermined length. For example, it is set at the time of factory shipment of each unit and can be updated by the user. It is a period. The "normal waiting time Two" means that the performance Ab (particularly, the performance Ab related to each of the self-diagnosis processing, the instruction execution processing, and the I / O refresh processing) is equal between the first CPU unit 300A and the second CPU unit 300B. It is a period set on the premise of.

二重化される相手方のCPUユニットの性能Abyが自ユニットの性能Abmより低い場合、待ち時間設定部360は、自ユニットの性能Abmを相手方のCPUユニットの性能Abyで除した値に、各処理の実行時間を乗じた期間を、「調整待ち時間Ta」とする。二重化される相手方のCPUユニットの性能Abyが自ユニットの性能Abmより低い場合、待ち時間設定部360は、「通常の待ち時間Twoに調整待ち時間Taを加えた期間(つまり、「通常の待ち時間Two+調整待ち時間Ta」)」を「待ち時間Tw」とする。 When the performance Aby of the CPU unit of the other party to be duplicated is lower than the performance Abm of the own unit, the waiting time setting unit 360 executes each process to the value obtained by dividing the performance Abm of the own unit by the performance Aby of the CPU unit of the other party. The period multiplied by the time is defined as "adjustment waiting time Ta". When the performance Aby of the CPU unit of the other party to be duplicated is lower than the performance Abm of the own unit, the waiting time setting unit 360 sets the "normal waiting time Two plus the adjustment waiting time Ta" (that is, "normal waiting time". "Two + adjustment waiting time Ta") "is defined as" waiting time Tw ".

<「自己診断処理」に係る同期チェック処理のための「待ち時間」>「自己診断処理」に係る同期チェック処理のための「待ち時間Tw」は、第1待ち時間設定部361によって設定される。 <"Waiting time" for synchronization check processing related to "self-diagnosis processing"> "Waiting time Tw" for synchronization check processing related to "self-diagnosis processing" is set by the first waiting time setting unit 361. ..

第1待ち時間設定部361は、第1他機能力テーブル341を参照して自己診断用他機性能情報を取得し、第1自機能力テーブル351を参照して自己診断用自機性能情報を取得する。また、第1待ち時間設定部361は、処理実行部120からの、「自ユニットが自己診断処理の実行を開始した」旨、および、「自ユニットが自己診断処理の実行を完了した」旨の通知から、自己診断処理の実行時間を演算する。 The first waiting time setting unit 361 acquires the performance information of the other machine for self-diagnosis by referring to the first other functional power table 341, and obtains the performance information of the self-diagnosis machine by referring to the first self-function power table 351. get. In addition, the first waiting time setting unit 361 indicates that "the own unit has started the execution of the self-diagnosis process" and "the own unit has completed the execution of the self-diagnosis process" from the process execution unit 120. From the notification, calculate the execution time of the self-diagnosis process.

第1待ち時間設定部361は、取得した自己診断用他機性能情報および自己診断用自機性能情報と、演算して求めた「自己診断処理の実行時間」とから、自己診断処理についての同期チェック処理のための「待ち時間Tw」を算出する。 The first waiting time setting unit 361 synchronizes the self-diagnosis process from the acquired other machine performance information for self-diagnosis and the self-diagnosis own machine performance information and the calculated "execution time of the self-diagnosis process". Calculate the "waiting time Tw" for the check process.

具体的には、第1待ち時間設定部361は、「自己診断処理に係る、自ユニットの性能Abm」と、「自己診断処理に係る、二重化される相手方のCPUユニットの性能Aby」との比を考慮して、「自己診断処理に係る、調整待ち時間Ta」を算出する。そして、第1待ち時間設定部361は、算出した「自己診断処理に係る、調整待ち時間Ta」を、「自己診断処理に係る、通常の待ち時間Two」に追加した期間を、自己診断処理についての同期チェック処理のための「待ち時間Tw」として設定する。「Abm/Aby」が「1」以下である場合、第1待ち時間設定部361は、「自己診断処理に係る、調整待ち時間Ta」を「0」とする。「Abm/Aby」が「1」より大きい場合、第1待ち時間設定部361は、「自己診断処理に係る、調整待ち時間Ta」を、「自ユニットの自己診断処理の実行時間に、『Abm/Aby』を乗じた値」とする。 Specifically, the first waiting time setting unit 361 has a ratio of "performance Abm of own unit related to self-diagnosis processing" and "performance Aby of the other party's CPU unit related to self-diagnosis processing". In consideration of, "adjustment waiting time Ta related to self-diagnosis processing" is calculated. Then, the first waiting time setting unit 361 adds the calculated "adjustment waiting time Ta related to the self-diagnosis processing" to the "normal waiting time Two related to the self-diagnosis processing" for the self-diagnosis processing. It is set as "waiting time Tw" for the synchronization check process of. When "Abm / Aby" is "1" or less, the first waiting time setting unit 361 sets "adjustment waiting time Ta related to self-diagnosis processing" to "0". When "Abm / Aby" is larger than "1", the first waiting time setting unit 361 sets "Adjustment waiting time Ta related to self-diagnosis processing" to "Abm" as the execution time of self-diagnosis processing of the own unit. / Aby ”multiplied value”.

第1待ち時間設定部361は、上述の方法により算出した「自己診断処理についての同期チェック処理のための『待ち時間Tw』」を、判定部370へ通知する。 The first waiting time setting unit 361 notifies the determination unit 370 of the "waiting time Tw" for the synchronization check process for the self-diagnosis process calculated by the above method.

<「命令実行処理」に係る同期チェック処理のための「待ち時間」>「命令実行処理」に係る同期チェック処理のための「待ち時間Tw」は、第2待ち時間設定部362によって設定される。 <"Waiting time" for synchronization check processing related to "instruction execution processing"> "Waiting time Tw" for synchronization check processing related to "instruction execution processing" is set by the second waiting time setting unit 362. ..

第2待ち時間設定部362は、第2他機能力テーブル342を参照して命令実行用他機性能情報を取得し、第2自機能力テーブル352を参照して命令実行用自機性能情報を取得する。また、第2待ち時間設定部362は、処理実行部120からの、「自ユニットが命令実行処理の実行を開始した」旨、および、「自ユニットが命令実行処理の実行を完了した」旨の通知から、命令実行処理の実行時間を演算する。 The second waiting time setting unit 362 acquires the performance information of the other machine for instruction execution by referring to the second other functional power table 342, and obtains the performance information of the own machine for instruction execution by referring to the second self-functional power table 352. get. Further, the second waiting time setting unit 362 indicates that "the own unit has started the execution of the instruction execution process" and "the own unit has completed the execution of the instruction execution process" from the process execution unit 120. From the notification, calculate the execution time of the instruction execution process.

第2待ち時間設定部362は、取得した命令実行用他機性能情報および命令実行用自機性能情報と、演算して求めた「命令実行処理の実行時間」とから、命令実行処理についての同期チェック処理のための「待ち時間Tw」を算出する。 The second waiting time setting unit 362 synchronizes the instruction execution process from the acquired instruction execution other machine performance information and the instruction execution own machine performance information and the "execution time of the instruction execution process" obtained by calculation. Calculate the "waiting time Tw" for the check process.

具体的には、第2待ち時間設定部362は、「命令実行処理に係る、自ユニットの性能Abm」と、「命令実行処理に係る、二重化される相手方のCPUユニットの性能Aby」との比を考慮して、「命令実行処理に係る、調整待ち時間Ta」を算出する。そして、第2待ち時間設定部362は、算出した「命令実行処理に係る、調整待ち時間Ta」を、「命令実行処理に係る、通常の待ち時間Two」に追加した期間を、命令実行処理についての同期チェック処理のための「待ち時間Tw」として設定する。「Abm/Aby」が「1」以下である場合、第2待ち時間設定部362は、「命令実行処理に係る、調整待ち時間Ta」を「0」とする。「Abm/Aby」が「1」より大きい場合、第2待ち時間設定部362は、「命令実行処理に係る、調整待ち時間Ta」を、「自ユニットの命令実行処理の実行時間に、『Abm/Aby』を乗じた値」とする。 Specifically, the second waiting time setting unit 362 is a ratio of "performance Abm of own unit related to instruction execution processing" and "performance Aby of the other party's CPU unit related to instruction execution processing". In consideration of, "adjustment waiting time Ta related to instruction execution processing" is calculated. Then, the second waiting time setting unit 362 adds the calculated "adjustment waiting time Ta related to the instruction execution process" to the "normal waiting time Two related to the instruction execution process" for the instruction execution process. It is set as "waiting time Tw" for the synchronization check process of. When "Abm / Aby" is "1" or less, the second waiting time setting unit 362 sets "adjustment waiting time Ta related to instruction execution processing" to "0". When "Abm / Aby" is larger than "1", the second waiting time setting unit 362 sets "Adjustment waiting time Ta related to instruction execution processing" to "Abm" as the execution time of the instruction execution processing of the own unit. / Aby ”multiplied value”.

第1待ち時間設定部361は、上述の方法により算出した「命令実行処理についての同期チェック処理のための『待ち時間Tw』」を、判定部370へ通知する。 The first waiting time setting unit 361 notifies the determination unit 370 of the "waiting time Tw" for the synchronization check processing for the instruction execution processing calculated by the above method.

<「I/Oリフレッシュ処理」に係る同期チェック処理のための「待ち時間」>「I/Oリフレッシュ処理」に係る同期チェック処理のための「待ち時間Tw」は、第3待ち時間設定部363によって設定される。 <"Waiting time" for synchronization check processing related to "I / O refresh processing"> "Waiting time Tw" for synchronization check processing related to "I / O refresh processing" is the third waiting time setting unit 363. Set by.

第3待ち時間設定部363は、第3他機能力テーブル343を参照してI/Oリフレッシュ用他機性能情報を取得し、第3自機能力テーブル353を参照してI/Oリフレッシュ用自機性能情報を取得する。また、第3待ち時間設定部363は、処理実行部120からの、「自ユニットがI/Oリフレッシュ処理の実行を開始した」旨、および、「自ユニットがI/Oリフレッシュ処理の実行を完了した」旨の通知から、I/Oリフレッシュ処理の実行時間を演算する。 The third waiting time setting unit 363 acquires the performance information of the other machine for I / O refresh by referring to the third other functional power table 343, and refers to the third self-functional power table 353 for the I / O refresh. Acquire machine performance information. In addition, the third waiting time setting unit 363 tells 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" from the process execution unit 120. The execution time of the I / O refresh process is calculated from the notification to that effect.

第3待ち時間設定部363は、取得したI/Oリフレッシュ用他機性能情報およびI/Oリフレッシュ用自機性能情報と、演算して求めた「I/Oリフレッシュ処理の実行時間」とから、I/Oリフレッシュ処理についての同期チェック処理のための「待ち時間Tw」を算出する。 The third waiting time setting unit 363 is based on the acquired performance information of the other machine for I / O refresh and the performance information of the own machine for I / O refresh, and the calculated "execution time of the I / O refresh process". The "waiting time Tw" for the synchronization check processing for the I / O refresh processing is calculated.

具体的には、第3待ち時間設定部363は、「I/Oリフレッシュ処理に係る、自ユニットの性能Abm」と、「I/Oリフレッシュ処理に係る、二重化される相手方のCPUユニットの性能Aby」との比を考慮して、「I/Oリフレッシュ処理に係る、調整待ち時間Ta」を算出する。そして、第3待ち時間設定部363は、算出した「I/Oリフレッシュ処理に係る、調整待ち時間Ta」を、「I/Oリフレッシュ処理に係る、通常の待ち時間Two」に追加した期間を、I/Oリフレッシュ処理についての同期チェック処理のための「待ち時間Tw」として設定する。「Abm/Aby」が「1」以下である場合、第3待ち時間設定部363は、「I/Oリフレッシュ処理に係る、調整待ち時間Ta」を「0」とする。「Abm/Aby」が「1」より大きい場合、第3待ち時間設定部363は、「I/Oリフレッシュ処理に係る、調整待ち時間Ta」を、「自ユニットのI/Oリフレッシュ処理の実行時間に、『Abm/Aby』を乗じた値」とする。 Specifically, the third waiting time setting unit 363 has "performance Abm of own unit related to I / O refresh processing" and "performance Aby of the CPU unit of the other party to be duplicated related to I / O refresh processing". In consideration of the ratio with "", "Adjustment waiting time Ta related to I / O refresh processing" is calculated. Then, the third waiting time setting unit 363 adds the calculated "adjustment waiting time Ta related to the I / O refresh process" to the "normal waiting time Two related to the I / O refresh process". Set as "waiting time Tw" for synchronization check processing for I / O refresh processing. When "Abm / Aby" is "1" or less, the third waiting time setting unit 363 sets "adjustment waiting time Ta related to I / O refresh processing" to "0". When "Abm / Aby" is larger than "1", the third waiting time setting unit 363 sets "adjustment waiting time Ta related to I / O refresh processing" to "execution time of I / O refresh processing of own unit". Is multiplied by "Abm / Aby". "

第3待ち時間設定部363は、上述の方法により算出した「I/Oリフレッシュ処理についての同期チェック処理のための『待ち時間Tw』」を、判定部370へ通知する。 The third waiting time setting unit 363 notifies the determination unit 370 of the "waiting time Tw" for the synchronization check process for the I / O refresh process calculated by the above method.

判定部370は、「自ユニットが各処理の実行を完了した」時点から、待ち時間設定部360から通知された待ち時間Twが経過した後に、同期チェック処理を実行する。例えば、判定部370は、「自ユニットが各処理の実行を完了した」時点から待ち時間Twが経過した時点で、共通レジスタ200を参照し、自ユニットが実行を完了した或る処理について、二重化される相手方のCPUユニットの実行が完了しているかを確認する。 The determination unit 370 executes the synchronization check process after the waiting time Tw notified from the waiting time setting unit 360 has elapsed from the time when the own unit has completed the execution of each process. For example, the determination unit 370 refers to the common register 200 when the waiting time Tw has elapsed from the time when the own unit has completed the execution of each process, and duplicates the certain process for which the own unit has completed the execution. Check if the execution of the CPU unit of the other party is completed.

待ち時間Twとして「通常の待ち時間Two+調整待ち時間Ta」を通知された判定部370は、「自ユニットが各処理の実行を完了した」時点から調整待ち時間Taがするまで待機処理を実行する。そして、判定部370は、待機処理の実行完了後(つまり、「自ユニットが各処理の実行を完了した」時点から調整待ち時間Taが経過した後)に、同期チェック処理を実行する。すなわち、判定部370は、待機処理の実行完了後に、「通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理の実行を、相手方のCPUユニットが完了していることを確認できるか」を判定する。言い換えれば、判定部370は、待機処理の実行完了時点から通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理について、相手方のCPUユニットによる実行完了を確認できるかを判定する。 The determination unit 370 notified of "normal waiting time Two + adjustment waiting time Ta" as the waiting time Tw executes the waiting process from the time when "the own unit completes the execution of each process" until the adjustment waiting time Ta occurs. .. Then, the determination unit 370 executes the synchronization check process after the execution of the standby process is completed (that is, after the adjustment waiting time Ta has elapsed from the time when the own unit has completed the execution of each process). That is, after the execution of the standby process is completed, the determination unit 370 can confirm that the CPU unit of the other party has completed the execution of the process whose execution has been completed by the own unit by the time the normal waiting time Two elapses. Is it judged? In other words, the determination unit 370 determines whether the processing completed by the own unit can be confirmed to be completed by the CPU unit of the other party from the time when the execution of the standby processing is completed until the normal waiting time Two elapses.

待ち時間Twとして「通常の待ち時間Two」を通知された判定部370は、「自ユニットが各処理の実行を完了した」時点で直ぐに、同期チェック処理を実行する。すなわち、判定部370は、「通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理の実行を、相手方のCPUユニットが完了していることを確認できるか」を判定する。言い換えれば、判定部370は、自ユニットの実行完了時点から通常の待ち時間Twoが経過するまでに、自ユニットが実行完了した処理について、相手方のCPUユニットによる実行完了を確認できるかを判定する。 The determination unit 370 notified of the "normal waiting time Two" as the waiting time Tw immediately executes the synchronization check process when "the own unit completes the execution of each process". That is, the determination unit 370 determines "whether it is possible to confirm that the CPU unit of the other party has completed the execution of the process whose execution has been completed by the own unit by the time the normal waiting time Two elapses". In other words, the determination unit 370 determines whether the processing completed by the own unit can be confirmed by the CPU unit of the other party from the time when the execution of the own unit is completed until the normal waiting time Two elapses.

<「自己診断処理」に係る同期チェック処理>第1判定部371は、「自己診断処理」に係る同期チェック処理を実行する。すなわち、第1判定部371は、自ユニットの自己診断処理の実行完了時点から、第1待ち時間設定部361から通知された「自己診断処理のための『待ち時間Tw』」が経過するまでに、「相手方のCPUユニットが自己診断処理の実行を完了したか」を確認する。「自己診断処理のための『待ち時間Tw』」が経過するまでに、「相手方のCPUユニットが自己診断処理の実行を完了した」ことを確認できないと、第1判定部371は、相手方のCPUユニットに異常が発生したと判定する。 <Synchronous check process related to "self-diagnosis process"> The first determination unit 371 executes the synchronous check process related to "self-diagnosis process". That is, the first determination unit 371 reaches the time when the "waiting time Tw" for the self-diagnosis process notified from the first waiting time setting unit 361 elapses from the time when the execution of the self-diagnosis process of the own unit is completed. , Check "whether the other party's CPU unit has completed the execution of the self-diagnosis process". If it cannot be confirmed that "the other party's CPU unit has completed the execution of the self-diagnosis process" by the time "the" waiting time Tw "for the self-diagnosis process" elapses, the first determination unit 371 will perform the other party's CPU. Judge that an error has occurred in the unit.

<「命令実行処理」に係る同期チェック処理>第2判定部372は、「命令実行処理」に係る同期チェック処理を実行する。すなわち、第2判定部372は、自ユニットの命令実行処理の実行完了時点から、第2待ち時間設定部362から通知された「命令実行処理のための『待ち時間Tw』」が経過するまでに、「相手方のCPUユニットが命令実行処理の実行を完了したか」を確認する。「命令実行処理のための『待ち時間Tw』」が経過するまでに、「相手方のCPUユニットが命令実行処理の実行を完了した」ことを確認できないと、第2判定部372は、相手方のCPUユニットに異常が発生したと判定する。 <Synchronous check process related to "instruction execution process"> The second determination unit 372 executes the synchronous check process related to "instruction execution process". That is, the second determination unit 372 has elapsed from the time when the execution of the instruction execution process of the own unit is completed until the "waiting time Tw" for the instruction execution process notified from the second waiting time setting unit 362 elapses. , Check "whether the other party's CPU unit has completed the execution of the instruction execution process". If it cannot be confirmed that "the other party's CPU unit has completed the execution of the instruction execution process" by the time "the" waiting time Tw "for the instruction execution process" elapses, the second determination unit 372 determines that the other party's CPU has completed the execution. Judge that an error has occurred in the unit.

<「I/Oリフレッシュ処理」に係る同期チェック処理>第3判定部373は、「I/Oリフレッシュ処理」に係る同期チェック処理を実行する。すなわち、第3判定部373は、自ユニットのI/Oリフレッシュ処理の実行完了時点から、第3待ち時間設定部363から通知された「I/Oリフレッシュ処理のための『待ち時間Tw』」が経過するまでに、「相手方のCPUユニットがI/Oリフレッシュ処理の実行を完了したか」を確認する。「I/Oリフレッシュ処理のための『待ち時間Tw』」が経過するまでに、「相手方のCPUユニットが命令実行処理の実行を完了した」ことを確認できないと、第3判定部373は、相手方のCPUユニットに異常が発生したと判定する。 <Synchronous check process related to "I / O refresh process"> The third determination unit 373 executes the synchronous check process related to "I / O refresh process". That is, the third determination unit 373 receives the "waiting time Tw" for the I / O refresh process notified from the third waiting time setting unit 363 from the time when the execution of the I / O refresh process of the own unit is completed. By the time it has elapsed, it is confirmed whether the CPU unit of the other party has completed the execution of the I / O refresh process. If it cannot be confirmed that "the CPU unit of the other party has completed the execution of the instruction execution process" by the time "the" waiting time Tw "for the I / O refresh process" elapses, the third determination unit 373 determines that the other party has completed the execution. It is determined that an abnormality has occurred in the CPU unit of.

判定部370Aは、共通レジスタ200の第2レジスタ220を参照し、処理実行部120Aが実行を完了した或る処理について、「処理実行部120Bによる実行が完了した」旨の書込があるかを確認する。判定部370Aは、処理実行部120Aが実行を完了した或る処理について、第2レジスタ220に「処理実行部120Bによる実行が完了した」旨の書込がないと、第2CPUユニット300Bに異常が発生したと判定する。 The determination unit 370A refers to the second register 220 of the common register 200, and indicates whether or not there is a writing indicating that "execution by the process execution unit 120B has been completed" for a certain process for which the process execution unit 120A has completed execution. confirm. If the determination unit 370A does not write in the second register 220 that "execution by the process execution unit 120B has been completed" for a certain process for which the process execution unit 120A has completed execution, an error occurs in the second CPU unit 300B. Judge that it has occurred.

判定部370Bは、共通レジスタ200の第1レジスタ210を参照し、処理実行部120Bが実行を完了した或る処理について、「処理実行部120Aによる実行が完了した」旨の書込があるかを確認する。判定部370Bは、処理実行部120Bが実行を完了した或る処理について、第1レジスタ210に「処理実行部120Aによる実行が完了した」旨の書込がないと、第1CPUユニット300Aに異常が発生したと判定する。 The determination unit 370B refers to the first register 210 of the common register 200, and indicates whether or not there is a writing indicating that "execution by the process execution unit 120A has been completed" for a certain process for which the process execution unit 120B has completed execution. confirm. If the determination unit 370B does not write in the first register 210 that "execution by the process execution unit 120A has been completed" for a certain process for which the process execution unit 120B has completed execution, an error occurs in the first CPU unit 300A. Judge that it has occurred.

(記憶部の詳細)
記憶部330は、第1CPUユニット300Aと第2CPUユニット300Bとの各々が使用する各種データを格納する記憶装置である。なお、記憶部330は、第1CPUユニット300Aと第2CPUユニット300Bとの各々が実行する(1)制御プログラム、(2)OSプログラム、(3)第1CPUユニット300Aと第2CPUユニット300Bとの各々が有する各種機能を実行するためのアプリケーションプログラム、および、(4)該アプリケーションプログラムを実行するときに読み出す各種データを非一時的に記憶してもよい。上記の(1)~(4)のデータは、例えば、ROM(read only memory)、フラッシュメモリ、EPROM(Erasable Programmable ROM)、EEPROM(登録商標)(Electrically EPROM)、HDD(Hard Disc Drive)等の不揮発性記憶装置に記憶される。第1CPUユニット300Aと第2CPUユニット300Bとの各々は、図示しない一時記憶部を備えていてもよい。一時記憶部は、第1CPUユニット300Aと第2CPUユニット300Bとの各々が実行する各種処理の過程で、演算に使用するデータおよび演算結果等を一時的に記憶するいわゆるワーキングメモリであり、RAM(Random Access Memory)等の揮発性記憶装置で構成される。どのデータをどの記憶装置に記憶するのかについては、第1CPUユニット300Aと第2CPUユニット300Bとの各々の使用目的、利便性、コスト、または、物理的な制約等から適宜決定される。記憶部330はさらに、他機能力テーブル340および自機能力テーブル350を格納している。
(Details of memory)
The storage unit 330 is a storage device that stores various data used by each of the first CPU unit 300A and the second CPU unit 300B. In the storage unit 330, each of (1) a control program, (2) an OS program, and (3) a first CPU unit 300A and a second CPU unit 300B executed by each of the first CPU unit 300A and the second CPU unit 300B is executed. The application program for executing the various functions possessed by the application program and (4) various data to be read when the application program is executed may be stored non-temporarily. The data of (1) to (4) above may be, for example, ROM (read only memory), flash memory, EPROM (Erasable Programmable ROM), EEPROM (registered trademark) (Electrically EPROM), HDD (Hard Disc Drive), or the like. Stored in a non-volatile storage device. Each of the first CPU unit 300A and the second CPU unit 300B may include a temporary storage unit (not shown). The temporary storage unit is a so-called working memory that temporarily stores data used for calculation, calculation results, etc. in the process of various processes executed by each of the first CPU unit 300A and the second CPU unit 300B, and is a RAM (Random). It consists of volatile storage devices such as Access Memory). Which data is stored in which storage device is appropriately determined from the purpose of use, convenience, cost, physical restrictions, etc. of each of the first CPU unit 300A and the second CPU unit 300B. The storage unit 330 further stores the other functional power table 340 and the self-functional power table 350.

他機能力テーブル340には、二重化される相手方のCPUユニットの性能Aby(処理能力)を示す情報である他機性能情報が格納される。図3を用いて説明したように、能力取得部310は、二重化される相手方のCPUユニットの自機能力テーブル350を参照して取得した他機性能情報を、自ユニットの他機能力テーブル340に格納する。 In the other functional power table 340, the performance information of the other machine, which is the information indicating the performance Aby (processing capacity) of the CPU unit of the other party to be duplicated, is stored. As described with reference to FIG. 3, the capability acquisition unit 310 transfers the performance information of the other machine acquired by referring to the self-functional power table 350 of the other party's CPU unit to be duplicated in the other functional power table 340 of the own unit. Store.

第1他機能力テーブル341には、二重化される相手方のCPUユニットの第1自機能力テーブル351に格納されている「自己診断処理に係る、二重化される相手方のCPUユニットの性能Abyを示す性能情報」が、能力取得部310により格納される。 In the first other functional power table 341, "performance indicating the performance Aby of the CPU unit of the other party to be duplicated related to the self-diagnosis process" stored in the first self-functional power table 351 of the CPU unit of the other party to be duplicated. "Information" is stored by the ability acquisition unit 310.

第2他機能力テーブル342には、二重化される相手方のCPUユニットの第2自機能力テーブル352に格納されている「命令実行処理に係る、二重化される相手方のCPUユニットの性能Abyを示す性能情報」が、能力取得部310により格納される。 In the second other functional power table 342, "performance indicating the performance Aby of the CPU unit of the other party to be duplicated related to the instruction execution process" stored in the second self-functional power table 352 of the CPU unit of the other party to be duplicated. "Information" is stored by the ability acquisition unit 310.

第3他機能力テーブル343には、二重化される相手方のCPUユニットの第3自機能力テーブル353に格納されている「I/Oリフレッシュ処理に係る、二重化される相手方のCPUユニットの性能Abyを示す性能情報」が、能力取得部310により格納される。 In the third other functional power table 343, the performance Aby of the CPU unit of the other party to be duplicated, which is stored in the third self-functional power table 353 of the CPU unit of the other party to be duplicated, is displayed. "Performance information to be shown" is stored by the ability acquisition unit 310.

自機能力テーブル350には、自ユニットの性能Abm(処理能力)を示す情報である自機性能情報が格納され、例えば、「自ユニットが、基準CPUユニットと比較して、どの程度の性能(処理能力)を備えているのか」を示す自機性能情報が格納されている。自機性能情報は、例えば第1CPUユニット300Aと第2CPUユニット300Bとの各々の工場出荷時に、自機能力テーブル350に格納される。 The self-functional power table 350 stores self-machine performance information, which is information indicating the performance Abm (processing capacity) of the self-unit. For example, "how much performance the self-unit has as compared with the reference CPU unit (? Does it have processing capacity)? ”Is stored in the performance information of the own machine. The own machine performance information is stored in the self-functional power table 350 at the time of shipment from each of the first CPU unit 300A and the second CPU unit 300B, for example.

第1自機能力テーブル351には、「自己診断処理に係る、自ユニットの性能Abmを示す性能情報(特に、「自己診断処理に係る、基準CPUユニットの性能Abb」に対する、相対的な性能Abm)」が格納されている。 In the first self-functional power table 351, "performance information indicating the performance Abm of the own unit related to the self-diagnosis process (particularly, the performance Abm of the reference CPU unit related to the self-diagnosis process" is relative to the performance Abm. ) ”Is stored.

第2自機能力テーブル352には、「命令実行処理に係る、自ユニットの性能Abmを示す性能情報(特に、「命令実行処理に係る、基準CPUユニットの性能Abb」に対する、相対的な性能Abm)」が格納されている。 In the second self-functional power table 352, "performance information indicating the performance Abm of the own unit related to the instruction execution process (particularly, the performance Abm of the reference CPU unit related to the instruction execution process" is shown. ) ”Is stored.

第3自機能力テーブル353には、「I/Oリフレッシュ処理に係る、自ユニットの性能Abmを示す性能情報(特に、「I/Oリフレッシュ処理に係る、基準CPUユニットの性能Abb」に対する、相対的な性能Abm)」が格納されている。 In the third self-functional power table 353, "performance information indicating the performance Abm of the own unit related to the I / O refresh process (particularly, the performance Abb of the reference CPU unit related to the I / O refresh process" is relative to. Performance Abm) ”is stored.

(CPUユニットについての整理)
これまでに図4等を用いて構成を説明してきた第1CPUユニット300Aおよび第2CPUユニット300Bの各々について、その理解を容易にするため、以下のように整理しておく。すなわち、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、第1CPUユニット100Aおよび第2CPUユニット100Bの各々と同様に、PLC20(コントローラ)において二重化されるCPUユニットである。第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、待ち時間設定部360(設定部)と判定部370とを備えている。待ち時間設定部360は、自ユニットの性能Abm(処理能力)と、二重化される相手方のCPUユニットの性能Abyとの比を考慮して、待ち時間Twを設定する。判定部370は、自ユニットにおける処理の実行完了時点から、待ち時間設定部360によって設定された待ち時間Twを経過するまでに、相手方のCPUユニットの前記処理の実行完了を確認できないと、相手方のCPUユニットに異常が発生したと判定する。
(Arrangement of CPU units)
In order to facilitate understanding of each of the first CPU unit 300A and the second CPU unit 300B whose configurations have been described with reference to FIGS. 4 and the like, they are arranged as follows. That is, each of the first CPU unit 300A and the second CPU unit 300B is a CPU unit to be duplicated in the PLC 20 (controller) like each of the first CPU unit 100A and the second CPU unit 100B. Each of the first CPU unit 300A and the second CPU unit 300B includes a waiting time setting unit 360 (setting unit) and a determination unit 370. The waiting time setting unit 360 sets the waiting time Tw in consideration of the ratio between the performance Abm (processing capacity) of the own unit and the performance Aby of the CPU unit of the other party to be duplicated. If the determination unit 370 cannot confirm the completion of the execution of the processing of the other CPU unit from the time when the execution of the processing in the own unit is completed to the time when the waiting time Tw set by the waiting time setting unit 360 elapses, the other party's CPU unit It is determined that an abnormality has occurred in the CPU unit.

したがって、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、第1CPUユニット100Aおよび第2CPUユニット100Bの各々と同様に、自ユニットと相手方のCPUユニットとの性能Abの違いを考慮した、適切な待ち時間Twを設定できる。すなわち、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、二重化される相手方のCPUユニットと自ユニットとの性能Abの違いを考慮して、不要な待ち時間Twを設けずに、同期チェック処理を正確に行なうことができる。 Therefore, each of the first CPU unit 300A and the second CPU unit 300B, like each of the first CPU unit 100A and the second CPU unit 100B, appropriately waits in consideration of the difference in performance Ab between the own unit and the other CPU unit. Time Tw can be set. That is, each of the first CPU unit 300A and the second CPU unit 300B performs the synchronization check process without providing an unnecessary waiting time Tw in consideration of the difference in performance Ab between the CPU unit of the other party to be duplicated and the own unit. It can be done accurately.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々において、前記処理(同期チェック処理の対象となる処理)は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を含む。待ち時間設定部360(具体的には、第1待ち時間設定部361、第2待ち時間設定部362、および、第3待ち時間設定部363の各々)は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々について、待ち時間Twを設定する。判定部370(具体的には、第1判定部371、第2判定部372、および、第3判定部373の各々)は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々について、前記判定を、つまり、同期チェック処理を実行する。 In each of the first CPU unit 300A and the second CPU unit 300B, the process (process to be the target of the synchronization check process) includes a self-diagnosis process, an instruction execution process, and an I / O refresh process. 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) has self-diagnosis processing, instruction execution processing, and , Wait time Tw is set for each of the I / O refresh processes. The determination unit 370 (specifically, each of the first determination unit 371, the second determination unit 372, and the third determination unit 373) has a self-diagnosis process, an instruction execution process, and an I / O refresh process. That is, the synchronization check process is executed.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行完了のタイミングで、自ユニットと相手方のCPUユニットとの同期を判定することができる。 Each of the first CPU unit 300A and the second CPU unit 300B determines the synchronization between the own unit and the other CPU unit at the timing of completion of each execution of the self-diagnosis process, the instruction execution process, and the I / O refresh process. be able to.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理を、この順で繰り返し実行する前に、二重化処理を1回実行する。第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、二重化処理において、相手方のCPUユニットの性能Abyを、相手方のCPUユニットから取得する。 Each of the first CPU unit 300A and the second CPU unit 300B executes the duplication process once before repeatedly executing the self-diagnosis process, the instruction execution process, and the I / O refresh process in this order. Each of the first CPU unit 300A and the second CPU unit 300B acquires the performance Aby of the other CPU unit from the other CPU unit in the duplication process.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、前記各処理を繰り返し実行する前に取得しておいた相手方のCPUユニットの性能Abyを考慮して、前記各処理についての前記判定に用いる待ち時間Twを、設定できるとの効果を奏する。 Each of the first CPU unit 300A and the second CPU unit 300B takes into consideration the performance Aby of the other CPU unit acquired before repeatedly executing each of the processes, and waits for the determination of each process. It has the effect of being able to set Tw.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々において、待ち時間設定部360は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の待ち時間Twを、以下のように設定する。すなわち、待ち時間設定部360は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々の実行に係る、自ユニットの性能Abmと、相手方のCPUユニットの性能Abyとの比を考慮して、各処理の待ち時間Twを、設定する。具体的には、第1待ち時間設定部361は、自己診断処理に係る、自ユニットの性能Abmと、相手方のCPUユニットの性能Abyとの比を考慮して、自己診断処理についての同期チェック処理のための待ち時間Twを、設定する。第2待ち時間設定部362は、命令実行処理に係る、自ユニットの性能Abmと、相手方のCPUユニットの性能Abyとの比を考慮して、命令実行処理についての同期チェック処理のための待ち時間Twを、設定する。第3待ち時間設定部363は、I/Oリフレッシュ処理に係る、自ユニットの性能Abmと、相手方のCPUユニットの性能Abyとの比を考慮して、I/Oリフレッシュ処理についての同期チェック処理のための待ち時間Twを、設定する。 In each of the first CPU unit 300A and the second CPU unit 300B, the waiting time setting unit 360 sets each waiting time Tw of the self-diagnosis process, the instruction execution process, and the I / O refresh process as follows. That is, the waiting time setting unit 360 considers the ratio between the performance Abm of the own unit and the performance Aby of the CPU unit of the other party related to the execution of each of the self-diagnosis process, the instruction execution process, and the I / O refresh process. Then, the waiting time Tw of each process is set. Specifically, the first waiting time setting unit 361 considers the ratio between the performance Abm of the own unit and the performance Aby of the CPU unit of the other party related to the self-diagnosis process, and synchronizes the self-diagnosis process with the synchronization check process. The waiting time Tw for is set. The second waiting time setting unit 362 considers the ratio between the performance Abm of the own unit and the performance Aby of the CPU unit of the other party related to the instruction execution processing, and waits for the synchronization check processing for the instruction execution processing. Tw is set. The third waiting time setting unit 363 considers the ratio between the performance Abm of the own unit and the performance Aby of the CPU unit of the other party related to the I / O refresh process, and performs the synchronization check process for the I / O refresh process. The waiting time Tw for this is set.

第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々に係る、自ユニットと相手方のCPUユニットとの性能Abの違いを考慮して、各処理の待ち時間Twを設定する。 Each of the first CPU unit 300A and the second CPU unit 300B considers the difference in performance Ab between the own unit and the other CPU unit related to each of the self-diagnosis processing, the instruction execution processing, and the I / O refresh processing. , Set the waiting time Tw for each process.

したがって、第1CPUユニット100Aおよび第2CPUユニット100Bの各々は、前記各処理の待ち時間Twを、前記各処理に係る自ユニットおよび相手方のCPUユニットの各々の性能Abに応じて、設定できるとの効果を奏する。 Therefore, each of the first CPU unit 100A and the second CPU unit 100B can set the waiting time Tw of each process according to the performance Ab of the own unit and the other CPU unit related to each process. Play.

(動作)
図6は、第1CPUユニット300Aおよび第2CPUユニット300Bの各々が実行する処理の概要を説明する図である。図6に示す第1CPUユニット300Aおよび第2CPUユニット300Bの各々が実行する処理について、図2に示す第1CPUユニット100Aおよび第2CPUユニット100Bの各々が実行する処理との違いは、以下の点である。
(motion)
FIG. 6 is a diagram illustrating an outline of processing executed by each of the first CPU unit 300A and the second CPU unit 300B. The processing executed by each of the first CPU unit 300A and the second CPU unit 300B shown in FIG. 6 is different from the processing executed by each of the first CPU unit 100A and the second CPU unit 100B shown in FIG. 2 in the following points. ..

すなわち、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、繰り返し実行する自己診断処理、命令実行処理、および、I/Oリフレッシュ処理の各々について、自ユニットおよび相手方のCPUユニットの性能Abを把握する。そして、第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、各処理に係る自ユニットおよび相手方のCPUユニットの性能Abを用いて、各処理についての同期チェック処理の際の「待ち時間Tw」を設定する。第1CPUユニット300Aおよび第2CPUユニット300Bの各々は、自ユニットによる各処理の実行完了時点から、各処理についての「待ち時間Tw」が経過するまでに、「相手方のCPUユニットによる各処理の実行完了」があるかを判定する。 That is, each of the first CPU unit 300A and the second CPU unit 300B grasps the performance Ab of the own unit and the other CPU unit for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process that are repeatedly executed. .. Then, each of the first CPU unit 300A and the second CPU unit 300B sets the "waiting time Tw" at the time of the synchronization check processing for each processing by using the performance Ab of the own unit and the other CPU unit related to each processing. do. Each of the first CPU unit 300A and the second CPU unit 300B "completes the execution of each process by the other CPU unit" from the time when the execution of each process by the own unit is completed until the "waiting time Tw" for each process elapses. Is determined.

その他の点においては、「第1CPUユニット300Aおよび第2CPUユニット300Bの各々が実行する処理」は、「第1CPUユニット100Aおよび第2CPUユニット100Bの各々が実行する処理」と同様である。 In other respects, the "process executed by each of the first CPU unit 300A and the second CPU unit 300B" is the same as the "process executed by each of the first CPU unit 100A and the second CPU unit 100B".

すなわち、「第1CPUユニット300Aおよび第2CPUユニット300Bの各々が実行する処理」は、PLC20(コントローラ)において二重化されるCPUユニットの制御方法であって、設定ステップと、判定ステップとを含んでいる。設定ステップは、自ユニットの性能Abmと、二重化される相手方のCPUユニットの性能Abyとの比を考慮して、待ち時間Twを設定する。判定ステップは、自ユニットにおける処理の実行完了時点から、設定ステップにて設定された待ち時間Twを経過するまでに、相手方のCPUユニットにおける前記処理の実行完了を確認できないと、相手方のCPUユニットに異常が発生したと判定する。 That is, the "process executed by each of the first CPU unit 300A and the second CPU unit 300B" is a control method of the CPU unit duplicated in the PLC 20 (controller), and includes a setting step and a determination step. In the setting step, the waiting time Tw is set in consideration of the ratio between the performance Abm of the own unit and the performance Aby of the CPU unit of the other party to be duplicated. In the determination step, if it is not possible to confirm the completion of execution of the process in the CPU unit of the other party from the time when the execution of the process in the own unit is completed until the waiting time Tw set in the setting step elapses, the CPU unit of the other party is informed. Judge that an abnormality has occurred.

したがって、「第1CPUユニット300Aおよび第2CPUユニット300Bの各々が実行する処理」は、自ユニットと相手方のCPUユニットとで性能Abが一致しない場合であっても、自ユニットと相手方のCPUユニットとの性能Abの違いを考慮した、適切な待ち時間Twを設定できるとの効果を奏する。すなわち、「第1CPUユニット300Aおよび第2CPUユニット300Bの各々が実行する処理」は、二重化される相手方のCPUユニットと自ユニットとの性能Abの違いを考慮して、不要な待ち時間Twを設けずに、同期チェック処理を正確に行なうことができるとの効果を奏する。 Therefore, in the "process executed by each of the first CPU unit 300A and the second CPU unit 300B", even if the performance Ab does not match between the own unit and the other CPU unit, the own unit and the other CPU unit It has the effect of being able to set an appropriate waiting time Tw in consideration of the difference in performance Ab. That is, in the "process executed by each of the first CPU unit 300A and the second CPU unit 300B", an unnecessary waiting time Tw is not provided in consideration of the difference in performance Ab between the CPU unit of the other party to be duplicated and the own unit. In addition, it has the effect that the synchronization check process can be performed accurately.

§4.変形例
これまで、第1CPUユニット100Aと第2CPUユニット100Bとが(または、第1CPUユニット300Aと第2CPUユニット300Bとが)、共通レジスタ200を利用して、同期チェック処理を行なう例を説明してきた。しかしながら、共通レジスタ200を利用する方法は、同期チェック処理の実現方法の一例にすぎない。同期チェック処理は、例えば、第1CPUユニット100Aと第2CPUユニット100Bとが(または、第1CPUユニット300Aと第2CPUユニット300Bとが)、互いのシリアルポートで通信を行いながら、同期をチェックする方法で実現されてもよい。第1CPUユニット100Aと第2CPUユニット100Bとは(または、第1CPUユニット300Aと第2CPUユニット300Bとは)、互いのシリアルポートで通信を行ないながら、互いに、相手方のCPUユニットの処理の実行完了を確認してもよい。
§4. Modification Example Up to now, an example has been described in which the first CPU unit 100A and the second CPU unit 100B (or the first CPU unit 300A and the second CPU unit 300B) perform synchronization check processing using the common register 200. .. However, the method of using the common register 200 is only an example of a method of realizing the synchronization check process. The synchronization check process is, for example, a method in which the first CPU unit 100A and the second CPU unit 100B (or the first CPU unit 300A and the second CPU unit 300B) check synchronization while communicating with each other at their serial ports. It may be realized. The first CPU unit 100A and the second CPU unit 100B (or the first CPU unit 300A and the second CPU unit 300B) confirm that the processing of the other CPU unit has been executed while communicating with each other through their serial ports. You may.

また、これまで自己診断処理、命令実行処理、および、I/Oリフレッシュ処理がこの順に繰り返し実行され、これらの各処理の実行完了後に、これらの各処理に係る同期チェック処理が実行される例を説明してきた。しかしながら、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理に加えて、さらに別の処理が、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理と同様に繰り返し実行されてもよい。その場合、この別の処理についても、実行完了後に同期チェック処理が実行されることになる。 Further, an example in which the self-diagnosis process, the instruction execution process, and the I / O refresh process are repeatedly executed in this order, and the synchronization check process related to each of these processes is executed after the execution of each of these processes is completed. I've explained. However, in addition to the self-diagnosis process, the instruction execution process, and the I / O refresh process, even if another process is repeatedly executed in the same manner as the self-diagnosis process, the instruction execution process, and the I / O refresh process. good. In that case, the synchronization check process will be executed after the execution is completed for this other process as well.

例えば、自己診断処理、命令実行処理、および、I/Oリフレッシュ処理に加えて、I/Oリフレッシュ処理で信号の送受信が行われる通信ネットワークとは別の通信ネットワークへの、信号の送受信を行なう「その他の通信処理」が、繰り返し実行されてもよい。すなわち、自己診断処理、命令実行処理、I/Oリフレッシュ処理、および、その他の通信処理が、この順に繰り返し実行され、これらの各処理の実行完了後に、これらの各処理に係る同期チェック処理が実行されてもよい。 For example, in addition to the self-diagnosis process, the instruction execution process, and the I / O refresh process, the signal is transmitted / received to / from a communication network different from the communication network in which the signal is transmitted / received in the I / O refresh process. "Other communication processing" may be executed repeatedly. That is, the self-diagnosis process, the instruction execution process, the I / O refresh process, and other communication processes are repeatedly executed in this order, and after the execution of each of these processes is completed, the synchronization check process related to each of these processes is executed. May be done.

〔ソフトウェアによる実現例〕
第1CPUユニット100A、第2CPUユニット100B、第1CPUユニット300A、および、第2CPUユニット300Bの各々の制御ブロック(特に、能力取得部110、処理実行部120、待ち時間設定部160、判定部170、能力取得部310、待ち時間設定部360、および、判定部370)は、集積回路(ICチップ)等に形成された論理回路(ハードウェア)によって実現してもよいし、CPU(CenTral Processing Unit)を用いてソフトウェアによって実現してもよい。
[Example of implementation by software]
Control blocks of each of the first CPU unit 100A, the second CPU unit 100B, the first CPU unit 300A, and the second CPU unit 300B (in particular, the capacity acquisition unit 110, the processing execution unit 120, the waiting time setting unit 160, the determination unit 170, and the capacity). The acquisition unit 310, the waiting time setting unit 360, and the determination unit 370) may be realized by a logic circuit (hardware) formed in an integrated circuit (IC chip) or the like, or a CPU (CenTral Processing Unit) may be realized. It may be realized by software using it.

後者の場合、第1CPUユニット100A、第2CPUユニット100B、第1CPUユニット300A、および、第2CPUユニット300Bの各々は、各機能を実現するソフトウェアであるプログラムの命令を実行するCPU、上記プログラムおよび各種データがコンピュータ(またはCPU)で読み取り可能に記録されたROM(Read Only Memory)または記憶装置(これらを「記録媒体」と称する)、上記プログラムを展開するRAM(Random Access Memory)等を備えている。そして、コンピュータ(またはCPU)が上記プログラムを上記記録媒体から読み取って実行することにより、本発明の目的が達成される。上記記録媒体としては、「一時的でない有形の媒体」、例えば、テープ、ディスク、カード、半導体メモリ、プログラマブルな論理回路等を用いることができる。また、上記プログラムは、該プログラムを伝送可能な任意の伝送媒体(通信ネットワークや放送波等)を介して上記コンピュータに供給されてもよい。なお、本発明は、上記プログラムが電子的な伝送によって具現化された、搬送波に埋め込まれたデータ信号の形態でも実現され得る。 In the latter case, each of the first CPU unit 100A, the second CPU unit 100B, the first CPU unit 300A, and the second CPU unit 300B is a CPU that executes an instruction of a program that is software that realizes each function, the above program, and various data. Is equipped with a ROM (Read Only Memory) or a storage device (these are referred to as "recording media") readable by a computer (or CPU), a RAM (Random Access Memory) for expanding the above program, and the like. Then, the object of the present invention is achieved by the computer (or CPU) reading the program from the recording medium and executing the program. As the recording medium, a "non-temporary tangible medium", for example, a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, or the like can be used. Further, the program may be supplied to the computer via any transmission medium (communication network, broadcast wave, etc.) capable of transmitting the program. The present invention can also be realized in the form of a data signal embedded in a carrier wave, in which the above program is embodied by electronic transmission.

本発明は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope of the claims, and the embodiments obtained by appropriately combining the technical means disclosed in the different embodiments. Is also included in the technical scope of the present invention.

10 PLC
20 PLC
100A 第1CPUユニット(CPUユニット)
100B 第2CPUユニット(CPUユニット)
300A 第1CPUユニット(CPUユニット)
300B 第2CPUユニット(CPUユニット)
160 時間設定部(設定部)
360 時間設定部(設定部)
170 判定部
370 判定部
Ab 性能(処理能力)
Tw 待ち時間
10 PLC
20 PLC
100A 1st CPU unit (CPU unit)
100B 2nd CPU unit (CPU unit)
300A 1st CPU unit (CPU unit)
300B 2nd CPU unit (CPU unit)
160 hours setting unit (setting unit)
360 time setting unit (setting unit)
170 Judgment unit 370 Judgment unit Ab Performance (processing capacity)
Tw waiting time

Claims (6)

コントローラにおいて二重化されるCPUユニットであって、
自ユニットの処理能力と、二重化される相手方のCPUユニットの処理能力との比を考慮して、待ち時間を設定する設定部と、
自ユニットにおける処理の実行完了時点から、前記設定部によって設定された前記待ち時間を経過するまでに、前記相手方のCPUユニットにおける前記処理の実行完了を確認できないと、前記相手方のCPUユニットに異常が発生したと判定する判定部と、
を備え
前記処理は、自ユニットのハードウェアに異常がないかを診断する自己診断処理、前記相手方のCPUユニット以外の外部装置を制御する信号を生成する命令実行処理、および、前記相手方のCPUユニット以外の外部装置との間でデータを交換するI/Oリフレッシュ処理を含み、
前記設定部は、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々について、前記待ち時間を設定し、
前記判定部は、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々について、前記判定を実行するCPUユニット。
It is a CPU unit that is duplicated in the controller.
A setting unit that sets the waiting time in consideration of the ratio between the processing capacity of the own unit and the processing capacity of the CPU unit of the other party to be duplicated.
If it is not possible to confirm the completion of execution of the process in the CPU unit of the other party from the time when the execution of the process in the own unit is completed until the waiting time set by the setting unit elapses, an abnormality occurs in the CPU unit of the other party. Judgment unit that determines that it has occurred,
Equipped with
The processing includes self-diagnosis processing for diagnosing whether or not there is an abnormality in the hardware of the own unit, instruction execution processing for generating a signal for controlling an external device other than the CPU unit of the other party, and CPU unit of the other party. Includes I / O refresh processing to exchange data with external devices
The setting unit sets the waiting time for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process.
The determination unit is a CPU unit that executes the determination for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process .
前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理を、この順で繰り返し実行する前に、前記相手方のCPUユニットの処理能力を、前記相手方のCPUユニットから取得する二重化処理を、1回実行する
請求項に記載のCPUユニット。
Before the self-diagnosis process, the instruction execution process, and the I / O refresh process are repeatedly executed in this order, a duplication process of acquiring the processing capacity of the CPU unit of the other party from the CPU unit of the other party is performed. The CPU unit according to claim 1 , which is executed once.
前記設定部は、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々の前記待ち時間を、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々の実行に係る、自ユニットの処理能力と、前記相手方のCPUユニットの処理能力との比を考慮して設定する
請求項またはに記載のCPUユニット。
The setting unit sets the waiting time for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process to the self-diagnosis process, the instruction execution process, and the I / O refresh process. The CPU unit according to claim 1 or 2 , which is set in consideration of the ratio between the processing capacity of the own unit and the processing capacity of the other CPU unit related to each execution.
コントローラにおいて二重化されるCPUユニットの制御方法であって、
自ユニットの処理能力と、二重化される相手方のCPUユニットの処理能力との比を考慮して、待ち時間を設定する設定ステップと、
自ユニットにおける処理の実行完了時点から、前記設定ステップにて設定された前記待ち時間を経過するまでに、前記相手方のCPUユニットにおける前記処理の実行完了を確認できないと、前記相手方のCPUユニットに異常が発生したと判定する判定ステップと、
を含み、
前記処理は、自ユニットのハードウェアに異常がないかを診断する自己診断処理、前記相手方のCPUユニット以外の外部装置を制御する信号を生成する命令実行処理、および、前記相手方のCPUユニット以外の外部装置との間でデータを交換するI/Oリフレッシュ処理を含み、
前記設定ステップは、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々について、前記待ち時間を設定し、
前記判定ステップは、前記自己診断処理、前記命令実行処理、および、前記I/Oリフレッシュ処理の各々について、前記判定を実行する制御方法。
It is a control method of the CPU unit that is duplicated in the controller.
A setting step to set the waiting time in consideration of the ratio between the processing capacity of the own unit and the processing capacity of the CPU unit of the other party to be duplicated,
If it is not possible to confirm the completion of execution of the process in the CPU unit of the other party from the time when the execution of the process in the own unit is completed until the waiting time set in the setting step elapses, the CPU unit of the other party is abnormal. Judgment step to determine that has occurred, and
Including
The processing includes self-diagnosis processing for diagnosing whether or not there is an abnormality in the hardware of the own unit, instruction execution processing for generating a signal for controlling an external device other than the CPU unit of the other party, and CPU unit of the other party. Includes I / O refresh processing to exchange data with external devices
The setting step sets the waiting time for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process.
The determination step is a control method for executing the determination for each of the self-diagnosis process, the instruction execution process, and the I / O refresh process .
請求項1からのいずれか一項に記載のCPUユニットとしてコンピュータを機能させるための情報処理プログラムであって、前記各部としてコンピュータを機能させるための情報処理プログラム。 An information processing program for operating a computer as a CPU unit according to any one of claims 1 to 3 , and an information processing program for operating a computer as each part. 請求項に記載の情報処理プログラムを記録したコンピュータ読み取り可能な記録媒体。 A computer-readable recording medium on which the information processing program according to claim 5 is recorded.
JP2018179162A 2018-09-25 2018-09-25 CPU unit, CPU unit control method, information processing program, and recording medium Active JP7028124B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2018179162A JP7028124B2 (en) 2018-09-25 2018-09-25 CPU unit, CPU unit control method, information processing program, and recording medium
PCT/JP2019/036311 WO2020066737A1 (en) 2018-09-25 2019-09-17 Cpu unit, cpu unit control method, information processing program, and recording medium
CN201980051961.6A CN112534411A (en) 2018-09-25 2019-09-17 CPU unit, control method for CPU unit, information processing program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018179162A JP7028124B2 (en) 2018-09-25 2018-09-25 CPU unit, CPU unit control method, information processing program, and recording medium

Publications (2)

Publication Number Publication Date
JP2020052550A JP2020052550A (en) 2020-04-02
JP7028124B2 true JP7028124B2 (en) 2022-03-02

Family

ID=69950163

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018179162A Active JP7028124B2 (en) 2018-09-25 2018-09-25 CPU unit, CPU unit control method, information processing program, and recording medium

Country Status (3)

Country Link
JP (1) JP7028124B2 (en)
CN (1) CN112534411A (en)
WO (1) WO2020066737A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312332A (en) 2001-04-11 2002-10-25 Daiwa Securities Group Inc Distributed processing server, system and method, and program
JP2004062603A (en) 2002-07-30 2004-02-26 Dainippon Printing Co Ltd Parallel processing system, server, parallel processing method, program and recording medium
JP2006155239A (en) 2004-11-29 2006-06-15 Canon Inc Software system, and control method, control program and storage medium for software system
JP2012128695A (en) 2010-12-15 2012-07-05 Fuji Electric Co Ltd Input/output duplexing apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57164345A (en) * 1981-04-01 1982-10-08 Nec Corp Failure detecting system for composite microcomputer
JPS62159240A (en) * 1986-01-08 1987-07-15 Hitachi Ltd Control system for duplicated device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312332A (en) 2001-04-11 2002-10-25 Daiwa Securities Group Inc Distributed processing server, system and method, and program
JP2004062603A (en) 2002-07-30 2004-02-26 Dainippon Printing Co Ltd Parallel processing system, server, parallel processing method, program and recording medium
JP2006155239A (en) 2004-11-29 2006-06-15 Canon Inc Software system, and control method, control program and storage medium for software system
JP2012128695A (en) 2010-12-15 2012-07-05 Fuji Electric Co Ltd Input/output duplexing apparatus

Also Published As

Publication number Publication date
CN112534411A (en) 2021-03-19
WO2020066737A1 (en) 2020-04-02
JP2020052550A (en) 2020-04-02

Similar Documents

Publication Publication Date Title
JP4465329B2 (en) External state cache for computer processors
JP4454538B2 (en) Multi-system computer
JP2017146897A (en) Microcontroller and electronic control unit
JP7028124B2 (en) CPU unit, CPU unit control method, information processing program, and recording medium
CN109306875B (en) Steam turbine DEH dual-controller synchronous hot standby redundancy switching device and method
US9218029B2 (en) Method and system for resetting a SoC
JP7047728B2 (en) Controller and controller control method
JP7073285B2 (en) Operation verification program, operation synchronization method and abnormality detection device
JP4810488B2 (en) Duplex control apparatus and tracking method thereof
JP4273905B2 (en) Duplex controller system and method
JP6988863B2 (en) Protocol converters, data transmission methods, data transmission programs, and data transmission systems
JPH10129487A (en) Computer system for vehicle control
JPS62187901A (en) Method for controlling duplex controller
JP6739983B2 (en) Communication device, communication method, program, and communication system
JP2799104B2 (en) Redundant switching device for programmable controller
JP7211173B2 (en) COMMUNICATION CONTROL DEVICE, ELECTRONIC DEVICE, COMMUNICATION CONTROL METHOD, AND COMMUNICATION CONTROL PROGRAM
JP2575883B2 (en) Sequencer mechanism capable of mutual backup
CN113741248B (en) Edge calculation controller and control system
JP7325658B2 (en) Program execution device and communication method
JP2005092695A (en) Duplication controller, and method for determining equalization mode thereof
JP6835422B1 (en) Information processing device and information processing method
JP6977623B2 (en) Communications system
US5548716A (en) Recording medium dualizing system
JP2009205428A (en) Redundant information-processing system, method of normally switching host unit, and program therefor
JP3726043B2 (en) Clock information synchronization method, duplexing device and synchronization program in duplexing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211130

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211227

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220118

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220131

R150 Certificate of patent or registration of utility model

Ref document number: 7028124

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150