JP5034584B2 - Duplex controller system, its active / standby controller - Google Patents

Duplex controller system, its active / standby controller Download PDF

Info

Publication number
JP5034584B2
JP5034584B2 JP2007069053A JP2007069053A JP5034584B2 JP 5034584 B2 JP5034584 B2 JP 5034584B2 JP 2007069053 A JP2007069053 A JP 2007069053A JP 2007069053 A JP2007069053 A JP 2007069053A JP 5034584 B2 JP5034584 B2 JP 5034584B2
Authority
JP
Japan
Prior art keywords
serial number
stored
standby
storage means
variable
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
JP2007069053A
Other languages
Japanese (ja)
Other versions
JP2008234014A (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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2007069053A priority Critical patent/JP5034584B2/en
Publication of JP2008234014A publication Critical patent/JP2008234014A/en
Application granted granted Critical
Publication of JP5034584B2 publication Critical patent/JP5034584B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、複数の定周期プログラムエンドでの等値化が可能な2重化コントローラ(プログラマブルコントローラ)における、ユーザデータ等値化方式に関する。   The present invention relates to a user data equalization method in a duplex controller (programmable controller) capable of equalization at a plurality of fixed-cycle program ends.

プログラマブルコントローラ・システムでは、信頼性を向上させるために、CPUモジュール(プログラマブルコントローラ本体)を待機冗長の2重化構成にする場合がある。この様な2重化コントローラシステムは、例えば、2つのCPUモジュールを1組とし、一方を稼動系、他方を待機系とし、稼動系CPUモジュールを待機系CPUモジュールが監視して、稼動系CPUモジュールに障害等の切替え要因が生じたならば待機系CPUモジュールが稼動系に切り替る構成である。   In the programmable controller system, in order to improve reliability, the CPU module (programmable controller main body) may have a standby redundant dual configuration. Such a dual controller system has, for example, two CPU modules as one set, one as an active system and the other as a standby system. The standby CPU module monitors the active CPU module, and the active CPU module If a switching factor such as a failure occurs in the standby CPU module, the standby CPU module is switched to the active system.

図5、図6に、上記従来の2重化コントローラシステムの構成例を示す。
尚、この様な2重化コントローラシステムに関しては、例えば特許文献1,2等に開示されている。
FIG. 5 and FIG. 6 show configuration examples of the conventional dual controller system.
Such a duplex controller system is disclosed in, for example, Patent Documents 1 and 2.

図5に、上記2重化コントローラシステム全体の概略構成を示す。
図示の2重化コントローラシステムは、CPUモジュール101−1、CPUモジュール101−2、及び各制御対象機器とのデータ入出力を行う複数のI/Oユニット102より成るI/O群から構成されている。尚、ここでは、CPUモジュール101−1が稼動系、CPUモジュール101−2がその待機系となっている場合を例にして説明する。
FIG. 5 shows a schematic configuration of the entire duplex controller system.
The duplex controller system shown in the figure is composed of an I / O group including a CPU module 101-1, a CPU module 101-2, and a plurality of I / O units 102 for inputting / outputting data to / from each control target device. Yes. Here, a case where the CPU module 101-1 is an active system and the CPU module 101-2 is a standby system will be described as an example.

稼動系となっているCPUモジュール101−1は、その内部に格納されたプログラム(通常、定周期に実行されるプログラム;定周期プログラム)を実行することで、各I/Oユニット102に対して制御データを出力して(又は各I/Oユニットからセンサ計測値等を読み出して)、各制御対象機器を制御する。   The CPU module 101-1 that is an active system executes a program (usually a program that is executed at a fixed period; a fixed period program) stored in the CPU module 101-1 to each I / O unit 102. Control data is output (or a sensor measurement value or the like is read from each I / O unit) to control each control target device.

一方、待機系となっているCPUモジュール101−2は、稼動系のCPUモジュール101−1を監視しており、稼動系CPUモジュール101−1に故障等の何らかの切替え要因が生じると、稼動/待機切り替え処理を実行して、CPUモジュール101−2が稼動系となって、CPUモジュール101−1が行っていた処理を引き継ぐ。   On the other hand, the standby CPU module 101-2 monitors the active CPU module 101-1, and if any switching factor such as a failure occurs in the active CPU module 101-1, the active / standby CPU module 101-1 is activated. The switching process is executed, and the CPU module 101-2 becomes an active system, and the process performed by the CPU module 101-1 is taken over.

CPUモジュール101−1、CPUモジュール101−2及び各I/Oユニット102は、システムバス103によって接続されており、稼動系CPUモジュール101−1はシステムバス103を介して各I/Oユニット102に対して出力データ(制御データ)を送信し、また各I/Oユニット102からは、当該ユニット102に接続されている不図示の制御対象機器からの計測値等のデータを受信している。   The CPU module 101-1, the CPU module 101-2, and each I / O unit 102 are connected by a system bus 103. The active system CPU module 101-1 is connected to each I / O unit 102 via the system bus 103. Output data (control data) is transmitted to the I / O unit 102, and data such as measurement values from a control target device (not shown) connected to the unit 102 is received.

また2重化されているCPUモジュール101−1とCPUモジュール101−2との間には等値化バス104を備え、稼動系/待機系の切替えが生じたときに制御データ等のユーザデータの整合性を持たせる為、この等値化バス104を介して稼動系CPUモジュール101−1から待機系CPUモジュール101−2にユーザデータ(グローバル変数、ローカル変数等)を送信して等値化処理を行っている。   Also, an equalization bus 104 is provided between the duplicated CPU module 101-1 and CPU module 101-2 so that user data such as control data can be stored when the active / standby system is switched. In order to provide consistency, user data (global variables, local variables, etc.) is transmitted from the active CPU module 101-1 to the standby CPU module 101-2 via the equalization bus 104 to perform equalization processing. It is carried out.

図6に、図5に示す2重化コントローラシステムにおけるCPUモジュール101−1、CPUモジュール101−2の詳細な構成例を示す。
CPUモジュール101−1、101−2は、プログラマブルコントローラ本体である
が、ここでは等値化処理に係わる構成のみを示し、他の構成は省略して示す。
FIG. 6 shows a detailed configuration example of the CPU module 101-1 and the CPU module 101-2 in the duplex controller system shown in FIG.
The CPU modules 101-1 and 101-2 are programmable controller bodies, but only the configuration related to the equalization processing is shown here, and other configurations are omitted.

図6において、CPUモジュール101−1は、プログラムRAM111、データRAM112、等値化バス制御部113、受信バッファ用RAM114、及びマイクロプロセッサ115等を有する。   In FIG. 6, the CPU module 101-1 includes a program RAM 111, a data RAM 112, an equalization bus control unit 113, a reception buffer RAM 114, a microprocessor 115, and the like.

プログラムRAM111には、ユーザプログラム111aが格納される。ユーザプログラム111aとは、例えば上記定周期プログラムである。更に、等値化処理を実現させる為のアプリケーションプログラムも格納されている。   The program RAM 111 stores a user program 111a. The user program 111a is, for example, the above periodic program. Furthermore, an application program for realizing equalization processing is also stored.

データRAM112は、ユーザデータ領域112a、等値化データ転送情報112bを、格納する。
ユーザデータ領域112aには、特許文献2等で説明されているように、各定周期プログラム毎に対応する各ローカル変数と、グローバル変数とが混在して格納されている。
The data RAM 112 stores a user data area 112a and equalized data transfer information 112b.
In the user data area 112a, as described in Patent Document 2 and the like, local variables corresponding to each fixed cycle program and global variables are stored in a mixed manner.

等値化データ転送情報112bは、各ローカル変数とグローバル変数のユーザデータ領域112aにおける格納位置を示す情報(特許文献2におけるマッピング情報)である。
等値化バス制御部113は、主に等値化バス104を介して等値化を行う為のデータ転送処理専用の構成であり、マイクロプロセッサ115から等値化すべきデータ(ローカル変数、グローバル変数等)を渡されると、待機側の等値化バス制御部123と連動して、この等値化データを待機側の受信バッファ用RAM124に格納させる機能を有する。尚、等値化バス制御部113は、例えば特許文献2で説明されている“SGM(Sameness data Gather Memory control)”に相当する。
The equalized data transfer information 112b is information (mapping information in Patent Document 2) indicating the storage position of each local variable and global variable in the user data area 112a.
The equalization bus control unit 113 is a configuration dedicated to data transfer processing mainly for performing equalization via the equalization bus 104, and data to be equalized from the microprocessor 115 (local variables, global variables). Etc.) has a function of storing the equalized data in the standby-side reception buffer RAM 124 in conjunction with the standby-side equalization bus control unit 123. The equalization bus control unit 113 corresponds to “SGM (Sameness data Gather Memory control)” described in Patent Document 2, for example.

マイクロプロセッサ115は、CPUモジュール101−1全体を制御する中央処理装置(CPUチップ等)であり、例えば、各定周期プログラムを実行する毎に等値化処理を実行する。等値化処理は、稼動側の等値化処理と待機側の等値化処理から成り、ここでは稼動側の等値化処理の一部を実行する。すなわち、等値化データ(実行した定周期プログラムに対応するローカル変数とグローバル変数)を、ユーザデータ領域112aから収集して、これをプログラム番号等と共に等値化バス制御部113に渡す。等値化バス制御部113は、上記の通り、この等値化データをCPUモジュール101−2側に転送して格納させる。   The microprocessor 115 is a central processing unit (CPU chip or the like) that controls the entire CPU module 101-1, and executes, for example, an equalization process every time each periodic program is executed. The equalization process includes an equalization process on the operating side and an equalization process on the standby side. Here, a part of the equalization process on the operation side is executed. That is, the equalized data (local variables and global variables corresponding to the executed fixed-cycle program) is collected from the user data area 112a and passed to the equalized bus control unit 113 together with the program number and the like. As described above, the equalization bus control unit 113 transfers the equalized data to the CPU module 101-2 and stores it.

また、待機系のCPUモジュール101−2は、プログラムRAM121、データRAM122、等値化バス制御部123、受信バッファ用RAM124、及びマイクロプロセッサ125等を有する。この構成自体は、稼動系のCPUモジュール101−1と同じである。そして、上記待機側の等値化処理を行う。すなわち、上記の様に受信バッファ用RAM124に等値化データが格納された後は、マイクロプロセッサ125が等値化データ転送情報(マッピング情報)に従って、受信バッファ用RAM124に格納された等値化データをデータRAM122のユーザデータ領域122aへ分配・格納する。   The standby CPU module 101-2 includes a program RAM 121, a data RAM 122, an equalization bus control unit 123, a reception buffer RAM 124, a microprocessor 125, and the like. This configuration itself is the same as that of the active CPU module 101-1. Then, equalization processing on the standby side is performed. That is, after the equalized data is stored in the reception buffer RAM 124 as described above, the microprocessor 125 performs the equalized data stored in the reception buffer RAM 124 according to the equalized data transfer information (mapping information). Are distributed and stored in the user data area 122a of the data RAM 122.

図7に、従来の等値化処理に伴う等値化データの転送、格納の様子を示す。換言すれば、上記等値化バス104を介して転送する等値化データのデータ構成、受信バッファ用RAM124のデータ格納例、及びユーザデータ領域122aのデータ格納例を示す。   FIG. 7 shows how the equalized data is transferred and stored in the conventional equalization process. In other words, a data configuration of equalized data transferred via the equalization bus 104, a data storage example of the reception buffer RAM 124, and a data storage example of the user data area 122a are shown.

まず、図上左側に示す等値化データフレームは、ヘッダ部とデータ部とから成る。等値化データは、各定周期プログラム実行完了毎に送信され、ヘッダ部には実行された定周期プログラムの番号等が格納され、データ部には、実行された定周期プログラムに係わるローカル変数とグローバル変数が格納される。   First, the equalized data frame shown on the left side of the figure consists of a header part and a data part. The equalized data is transmitted at the completion of each periodic program execution, the number of the executed periodic program is stored in the header part, and the local part related to the executed periodic program is stored in the data part. Stores global variables.

受信バッファ用RAM124には、図示の通り、各定周期プログラム毎に等値化データの格納領域が設けられており、等値化バス制御部123は、上記実行された定周期プログラム番号に基づいて、上記データ部のデータを該当する格納領域に格納する。   As shown in the figure, the reception buffer RAM 124 is provided with a storage area for equalized data for each fixed cycle program. The equalized bus control unit 123 is based on the executed fixed cycle program number. The data of the data part is stored in the corresponding storage area.

ユーザデータ領域122aには、上記ユーザデータ領域112aと同様、グローバル変数と各ローカル変数が格納され、ユーザデータ領域112aと同じデータが格納されているようにする為に等値化処理が行われる。   Similar to the user data area 112a, global variables and local variables are stored in the user data area 122a, and equalization processing is performed so that the same data as the user data area 112a is stored.

ここで、上記の通りマイクロプロセッサ125が、受信バッファ用RAM124に格納された等値化データを、ユーザデータ領域122aの該当領域に格納するが、その際ユーザデータ領域122aにおいて、各ローカル変数は該当する定周期プログラムが実行されたときのみ更新されるのに対して、グローバル変数は全ての定周期プログラムで共有されるのでその都度更新(上書き)されることになる。この為、以下に図8、図9を参照して説明する問題が生じる場合がある。   Here, as described above, the microprocessor 125 stores the equalized data stored in the reception buffer RAM 124 in the corresponding area of the user data area 122a. In this case, each local variable corresponds to the user data area 122a. The global variable is updated only when the periodic program to be executed is executed, whereas the global variable is updated (overwritten) each time since it is shared by all the periodic programs. For this reason, the problem described below with reference to FIGS. 8 and 9 may occur.

図8、図9には、定周期プログラムが実行される場合のスケジュール例を示す。定周期プログラムは複数あるが、ここでは簡単の為、定周期プログラムA,Bの2つのみであるものとする。   8 and 9 show an example of a schedule when the fixed cycle program is executed. Although there are a plurality of fixed-cycle programs, it is assumed here that there are only two fixed-cycle programs A and B for simplicity.

図8に示す例では、定周期プログラムBの演算中に定周期プログラムAの起動要求が発生し、定周期プログラムBが中断され定周期プログラムAが実行される。そして、定周期プログラムAのプログラムエンドにて等値化データ収集・転送(上記稼動側の等値化処理)が実行・完了され、更に待機系は転送された等値化データの分配処理(上記待機側の等値化処理)を実行・完了している。その後、定周期プログラムBのプログラムエンドにて等値化データ収集・転送が実行・完了され、更に待機系は転送された等値化データの分配を実行・完了する。   In the example shown in FIG. 8, a start request for the fixed cycle program A is generated during the calculation of the fixed cycle program B, the fixed cycle program B is interrupted, and the fixed cycle program A is executed. Then, the equalized data collection / transfer (equalization process on the operating side) is executed / completed at the program end of the periodic program A, and the standby system distributes the equalized data (described above). The standby side equalization process) has been executed and completed. Thereafter, equalization data collection / transfer is executed / completed at the program end of the periodic program B, and the standby system executes / completes distribution of the transferred equalization data.

尚、上記等値化データ収集・転送の実行・完了により等値化データが待機側の受信バッファ用RAM124に格納された状態になり、この受信バッファ用RAM124に格納された等値化データが、上記分配処理により、データRAM122のユーザデータ領域122aに格納されることになる。その際、図7に示す通り、グローバル変数、ローカル変数は、各々、ユーザデータ領域122a内の所定の記憶領域に格納されることになる。   The equalized data is stored in the reception buffer RAM 124 on the standby side by the execution / completion of the equalized data collection / transfer, and the equalized data stored in the reception buffer RAM 124 is By the distribution process, the data is stored in the user data area 122a of the data RAM 122. At that time, as shown in FIG. 7, global variables and local variables are respectively stored in predetermined storage areas in the user data area 122a.

図8に示す例のように演算中に中断された場合には問題はないが、図9に示す例のように等値化処理中に中断された場合には問題が生じる場合がある。これは、特に、等値化データ収集後であって上記分配処理実行前に中断された場合に問題が生じる。   There is no problem if it is interrupted during computation as in the example shown in FIG. 8, but there may be a problem if it is interrupted during equalization processing as in the example shown in FIG. This causes a problem particularly when interrupted after collecting the equalized data and before executing the distribution process.

図9に、図8と比べて、定周期プログラム実行要求のタイミングが異なる場合に定周期プログラムA,Bが実行される場合のスケシュール例を示す。
この例では、定周期プログラムBのエンドにて等値化処理中に(上記の通り等値化データ収集後であって上記分配処理実行前に)定周期プログラムAの起動要求が発生し割込み、定周期プログラムBが中断され定周期プログラムAが実行される。そして、定周期プログラムAのエンドにて等値化データ収集・転送が実行・完了し、更に待機系は転送された等値化データの分配を実行・完了している。その後、中断していた定周期プログラムBの等値化処理を再開してこれが実行・完了され、更に待機系は転送された等値化データの分配を実行・完了する。
FIG. 9 shows an example of a scale when the periodic programs A and B are executed when the timing of the periodic program execution request is different from that in FIG.
In this example, during the equalization processing at the end of the fixed cycle program B (after collecting the equalized data and before executing the distribution processing as described above), a start request for the fixed cycle program A is generated and interrupted. The fixed cycle program B is interrupted and the fixed cycle program A is executed. The equalized data collection / transfer is executed / completed at the end of the periodic program A, and the standby system executes / completes the distribution of the transferred equalized data. Thereafter, the equalization processing of the interrupted periodic program B is resumed and executed and completed, and the standby system executes and completes the distribution of the transferred equalized data.

ここで、例えば、グローバル変数が、全ての定周期プログラムのトータルの実行回数を意味するものであったとする。そして、仮に、図8又は図9の処理実行前に全定周期プログラム合わせて1233回実行されていたものとする。この場合、当然、グローバル変数
=1233が記憶されていることになる。この場合、図8又は図9の処理によって定周期プログラムが2回実行されるのであるから、当然、図8又は図9の処理終了時点ではグローバル変数=1235になっており、待機系のユーザデータ領域122aに格納されているグローバル変数の値も1235になっていなければならない。
Here, for example, it is assumed that the global variable means the total number of executions of all the periodic programs. Then, it is assumed that the program has been executed 1233 times in total for all fixed-cycle programs before the execution of the processing of FIG. 8 or FIG. In this case, naturally, global variable = 1233 is stored. In this case, since the periodic program is executed twice by the process of FIG. 8 or FIG. 9, naturally, the global variable = 1235 at the end of the process of FIG. 8 or FIG. The value of the global variable stored in the area 122a must also be 1235.

例えば、演算処理の最後にグローバル変数の更新が行われるとした場合、図8の例では、まず、定周期プログラムBの演算実行されるが、グローバル変数の更新前に中断され、定周期プログラムAの演算実行の際に、グローバル変数=1233が読み出されて+1インクリメントされることで、グローバル変数=1234に変更される。   For example, when the global variable is updated at the end of the arithmetic processing, in the example of FIG. 8, the periodic program B is first calculated and executed, but is interrupted before the global variable is updated, and the periodic program A When the calculation is executed, the global variable = 1233 is read and incremented by +1, so that the global variable = 1234 is changed.

そして、等値化処理によって、待機系のユーザデータ領域122aに格納されているグローバル変数の値も1234になる。その後に中断していた定周期プログラムBの演算実行によりグローバル変数=1235に変更され、等値化処理によって、待機系のユーザデータ領域122aに格納されているグローバル変数の値も1235になる。従って、この場合には問題は生じない。   As a result of the equalization processing, the value of the global variable stored in the standby user data area 122a also becomes 1234. After that, the execution of the fixed-cycle program B, which was interrupted, is changed to global variable = 1235, and the value of the global variable stored in the standby user data area 122a becomes 1235 by the equalization processing. Therefore, no problem occurs in this case.

尚、これは、例えば演算処理の最初にグローバル変数の更新が行われるとした場合でも、同様に問題は生じない。すなわち、この場合には、まず、定周期プログラムBの演算実行によりグローバル変数=1234に変更され、その後に演算中断により等値化処理が行われることなく定周期プログラムAの演算実行によりグローバル変数=1235に変更されて、等値化処理により待機系のユーザデータ領域122aに格納されているグローバル変数の値も1235になる。その後、定周期プログラムBの処理が再開されて等値化処理を実行する際には、所定の記憶領域に記憶されているグローバル変数の値を読み出して待機系側に転送することになるが、グローバル変数=1235となっているので、結局、等値化処理により待機系のユーザデータ領域122aに格納されているグローバル変数が更新されても、その値は1235のままとなる。   Note that this does not cause a problem even if, for example, a global variable is updated at the beginning of the arithmetic processing. That is, in this case, first, the global variable = 1234 is changed by the execution of the periodic program B, and then the global variable = by the execution of the periodic program A without performing the equalization process by the interruption of the calculation. By changing to 1235, the value of the global variable stored in the standby user data area 122a by the equalization processing also becomes 1235. Thereafter, when the processing of the periodic program B is resumed and the equalization processing is executed, the value of the global variable stored in the predetermined storage area is read and transferred to the standby system side. Since global variable = 1235, the value remains 1235 even if the global variable stored in the standby user data area 122a is updated by the equalization process.

一方、図9に示すタイミングの処理が行われた場合、まず、定周期プログラムBの演算実行によりグローバル変数=1234に変更され、更に等値化処理実行により等値化データを収集して(ローカル変数、グローバル変数の値等をユーザデータ領域112a内の所定の記憶領域から読み出して)待機系側に転送することになるが、この等値化データを読み出して一時的に保持した後であって上記分配処理実行前(例えば等値化データを待機系側に転送する前、あるいは転送完了しているが分配処理は未だ実行されていないとき等)中断された場合に、問題が生じることになる。すなわち、この場合、定周期プログラムBがグローバル変数の値‘1234’を既に収集した状態で定周期プログラムAの処理に移行し、定周期プログラムAの演算及び等値化処理によって、待機系のユーザデータ領域122aに格納されているグローバル変数の値が‘1235’に更新される。その後、定周期プログラムBが再開されると、上記グローバル変数の値‘1234’を待機系側に転送する為、ユーザデータ領域122aに格納されているグローバル変数の値が1234に更新されてしまうという問題が生じる(古いデータが格納されてしまう)。   On the other hand, when the processing at the timing shown in FIG. 9 is performed, first, the global variable = 1234 is changed by execution of the periodic program B, and further, equalization data is collected by executing the equalization processing (local Variables, global variable values, etc. are read from a predetermined storage area in the user data area 112a) and transferred to the standby system side. After this equalized data is read and temporarily stored, A problem occurs when the distribution process is interrupted before execution (for example, before the equalized data is transferred to the standby side or when the transfer is completed but the distribution process is not yet executed). . That is, in this case, the fixed cycle program B shifts to the fixed cycle program A in a state where the value “1234” of the global variable has already been collected, and the user of the standby system performs the calculation and equalization processing of the fixed cycle program A. The value of the global variable stored in the data area 122a is updated to “1235”. After that, when the periodic program B is resumed, the value of the global variable '1234' is transferred to the standby system side, so that the value of the global variable stored in the user data area 122a is updated to 1234. Problems arise (old data is stored).

よって、この後に稼動系/待機系が切換った場合に、ユーザプログラムは最新ではないユーザデータにより演算することになりコントローラシステム動作に影響を与えてしまうという問題点がある。   Therefore, when the operating system / standby system is switched after this, the user program is calculated based on user data that is not up-to-date, which affects the operation of the controller system.

尚、上記説明では、分かり易くする為に、グローバル変数がトータルの実行回数を意味するものとして説明した為、待機側でグローバル変数の値を比較すれば、‘1234’ <‘1235’であるので、‘1235’の方が新しい値であることが分かるが、グローバル変数がこの様な意味であるとは限らないので、グローバル変数の値を比較しても、必ずしも新旧の判断が出来るものではない。
特開2003−296133号公報 特開2005−92520号公報
In the above description, for the sake of simplicity, the global variable has been described as meaning the total number of executions. Therefore, if the value of the global variable is compared on the standby side, “1234” <“1235”. , '1235' is a newer value, but global variables do not always have this meaning, so it is not always possible to make a new / old judgment by comparing global variable values. .
JP 2003-296133 A JP 2005-92520 A

上記従来の構成、すなわち稼動系CPUモジュールが複数の定周期プログラムを実行し、各定周期プログラムエンドにて等値化を行い、ユーザデータ等値化の実行中に上位レベル定周期プログラムの割込みが発生する可能性がある構成において、稼動系/待機系が切換った場合に各定周期プログラムエンドでの等値化データが最新であることを保証する必要がある。   The above-described conventional configuration, that is, the active system CPU module executes a plurality of fixed-cycle programs, performs equalization at each fixed-cycle program end, and interrupts of a higher-level fixed-cycle program occur during execution of user data equalization. In a configuration that may occur, it is necessary to ensure that the equalization data at each fixed-cycle program end is the latest when the active / standby system is switched.

本発明の課題は、稼動、待機のCPUモジュールより成り複数の定周期プログラムを実行する2重化コントローラシステムにおいて、定周期プログラムのデータ等値化処理の際に、等値化データのうち特にグローバル変数に関して、旧い値が待機側に格納されてしまうことを防止し、稼動系/待機系が切換った場合に等値化データが最新であることを保証できる2重化コントローラシステムを提供することである。   The problem of the present invention is that, in a duplex controller system that is composed of active and standby CPU modules and executes a plurality of fixed-cycle programs, the data equalization processing of the fixed-cycle programs is particularly global. To provide a duplex controller system that can prevent old values from being stored on the standby side and can guarantee that the equalized data is the latest when the active / standby system is switched. It is.

本発明の2重化コントローラシステムは、複数の定周期プログラムを実行する稼動系のコントローラと、待機系のコントローラを有する2重化コントローラシステムであって、前記稼動系のコントローラは、前記各定周期プログラムに対応する各ローカル変数と、全ての定周期プログラムが共有するグローバル変数を記憶する第1の変数記憶手段と、シリアル番号を記憶する第1のシリアル番号記憶手段と、前記各定周期プログラムの演算実行完了する毎に、前記第1のシリアル番号記憶手段に記憶されているシリアル番号を取得して、該シリアル番号を更新し、該更新したシリアル番号を前記第1のシリアル番号記憶手段に記憶すると共に等値化データフレームにセットし、該実行した定周期プログラムに対応する前記ローカル変数と前記グローバル変数を前記第1の変数記憶手段から収集して前記等値化データフレームに格納して、該等値化データフレームを前記待機系のコントローラに転送する稼動側等値化処理手段とを有し、前記待機系のコントローラは、前記各定周期プログラムに対応する各ローカル変数と、全ての定周期プログラムが共有するグローバル変数を記憶する第2の変数記憶手段と、シリアル番号を記憶する第2のシリアル番号記憶手段と、前記転送された等値化データフレーム内の前記シリアル番号と、前記第2のシリアル番号記憶手段に記憶されたシリアル番号とを比較することで、正常/異常を判定し、正常と判定された場合には、該等値化データフレーム内のシリアル番号を前記第2のシリアル番号記憶手段に記憶すると共に、該等値化データフレームに格納されている前記ローカル変数とグローバル変数を、前記第2の変数記憶手段に記憶する待機側等値化処理手段とを有する。   The duplex controller system of the present invention is a duplex controller system having an active controller that executes a plurality of fixed-cycle programs and a standby controller, and the active controller includes the fixed-cycle controllers. Each local variable corresponding to a program, first variable storage means for storing global variables shared by all fixed-cycle programs, first serial number storage means for storing serial numbers, and each of the fixed-cycle programs Each time the computation is completed, the serial number stored in the first serial number storage unit is acquired, the serial number is updated, and the updated serial number is stored in the first serial number storage unit And set in an equalized data frame, the local variable corresponding to the executed periodic program and the An operation side equalization processing means for collecting a global variable from the first variable storage means, storing it in the equalization data frame, and transferring the equalization data frame to the standby controller; The standby controller includes a second variable storage means for storing each local variable corresponding to each fixed-cycle program, a global variable shared by all the fixed-cycle programs, and a second number for storing a serial number. By comparing the serial number storage means of the serial number stored in the transferred equalized data frame with the serial number stored in the second serial number storage means. When it is determined as normal, the serial number in the equalized data frame is stored in the second serial number storage means and the equalized data frame is stored. The local and global variables stored in the arm, and a waiting-side equalization processing means for storing in said second variable storage means.

そして、例えば、前記待機側等値化処理手段は、異常と判定した場合には、前記第2のシリアル番号記憶手段に記憶しているシリアル番号の更新は行わず、前記等値化データフレームに格納されている前記ローカル変数は前記第2の変数記憶手段に記憶すると共に、該等値化データフレームに格納されている前記グローバル変数は、前記第2の変数記憶手段に記憶しないようにする。
For example, if the standby side equalization processing means determines that there is an abnormality, the serial number stored in the second serial number storage means is not updated, and the equalization data frame is not updated. together with the local variables stored is stored in the second variable storage means, said global variables stored in the equalization data frame, so as not stored in said second variable storage means.

前記稼動系のコントローラ側では、上記演算実行により上記第1の変数記憶手段のローカル変数、グローバル変数が更新され、その後の等値化処理においてこれらローカル変数、グローバル変数を収集するが、その際に、シリアル番号を更新して、該更新したシリアル番号を等値化データフレームにセットする。そして、該等値化データフレームを前記待機系のコントローラに転送するが、例えばその前に、割り込みにより中断されて他の定周期プログラムが実行された場合、その演算実行により上記第1の変数記憶手段のローカル変数、グローバル変数が更に更新され、その等値化処理が行われるが、シリアル番号も更
に更新されたうえで待機側に通知されて第2のシリアル番号記憶手段に記憶される。従ってその後に上記中断された等値化処理が再開されて上記等値化データフレームが待機側に転送されると、待機側ではシリアル番号によって異常である(グローバル変数が古い)か否かを判定できるので、異常である場合には前記第2の変数記憶手段のグローバル変数は更新しない。これによって上記課題を解決できる。
On the active system controller side, local variables and global variables in the first variable storage means are updated by the execution of the operation, and these local variables and global variables are collected in the subsequent equalization process. The serial number is updated, and the updated serial number is set in the equalized data frame. Then, the equalized data frame is transferred to the standby controller. If, for example, the interrupted program is interrupted and another fixed-cycle program is executed before that, the first variable storage is executed by executing the calculation. The local variables and global variables of the means are further updated and the equalization process is performed. The serial number is further updated and then notified to the standby side and stored in the second serial number storage means. Therefore, after the interrupted equalization process is restarted and the equalized data frame is transferred to the standby side, the standby side determines whether the serial number is abnormal (the global variable is old) or not. Therefore, if it is abnormal, the global variable in the second variable storage means is not updated. Thus, the above problem can be solved.

また、例えば、前記第1のシリアル番号記憶手段に記憶されているシリアル番号を更新する処理は、該シリアル番号をインクリメントする処理であり、前記待機側等値化処理手段は、前記等値化データフレーム内のシリアル番号が、前記第2のシリアル番号記憶手段に記憶されたシリアル番号よりも大きい場合に、正常と判定する。   In addition, for example, the process of updating the serial number stored in the first serial number storage unit is a process of incrementing the serial number, and the standby side equalization processing unit includes the equalization data When the serial number in the frame is larger than the serial number stored in the second serial number storage means, it is determined as normal.

本発明の2重化コントローラシステムによれば、稼動、待機のCPUモジュールより成り複数の定周期プログラムを実行する2重化コントローラシステムにおいて、定周期プログラムのデータ等値化処理の際に、等値化データのうち特にグローバル変数に関して、古い値が待機側に格納されてしまうことを防止し、稼動系/待機系が切換った場合に等値化データが最新であることを保証できる。   According to the duplexing controller system of the present invention, in the duplexing controller system that is composed of active and standby CPU modules and executes a plurality of periodic programs, an equal value is obtained during the data equalization processing of the periodic program. It is possible to prevent an old value from being stored on the standby side, particularly for global variables in the equalization data, and to ensure that the equalization data is the latest when the active / standby system is switched.

以下、図面を参照して、本発明の実施の形態について説明する。
図1に、本例の2重化コントローラシステムにおけるCPUモジュール1、CPUモジュール2の構成例を示す。尚、本例の2重化コントローラシステム全体構成は、上記図5に示すものと同様であってよい。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 shows a configuration example of the CPU module 1 and the CPU module 2 in the duplex controller system of this example. The overall configuration of the duplex controller system of this example may be the same as that shown in FIG.

CPUモジュール1、2は、プログラマブルコントローラ本体であるが、ここでは等値化処理に係わる構成のみを示し、他の構成は省略して示す。また、ここでは、CPUモジュール1が稼動系、CPUモジュール2が待機系であるものとする。   The CPU modules 1 and 2 are programmable controller bodies, but only the configuration related to the equalization processing is shown here, and the other configurations are omitted. Here, it is assumed that the CPU module 1 is an active system and the CPU module 2 is a standby system.

図1において、CPUモジュール1は、プログラムRAM11、データRAM12、等値化バス制御部13、受信バッファ用RAM14、マイクロプロセッサ15、及びシリアルNO.保持メモリ16等を有する。   In FIG. 1, a CPU module 1 includes a program RAM 11, a data RAM 12, an equalization bus control unit 13, a reception buffer RAM 14, a microprocessor 15, and a serial NO. A holding memory 16 or the like is included.

プログラムRAM11には、ユーザプログラム11aが格納される。ユーザプログラム11aとは、例えば上記各定周期プログラムである。尚、本例のシステムにおいては、プログラムRAM11には、更に、後述する図3(a)に示す処理等を含む稼動側等値化処理をマイクロプロセッサ15によって実現させるアプリケーションプログラムも格納されている。   The program RAM 11 stores a user program 11a. The user program 11a is, for example, each of the above periodic programs. In the system of this example, the program RAM 11 further stores an application program for realizing the operation side equalization processing including the processing shown in FIG.

データRAM12は、ユーザデータ領域12aを有し、等値化データ転送情報12bを記憶している。
ユーザデータ領域12aには、上記特許文献2等で説明されているように、各定周期プログラム毎に対応する各ローカル変数と、全ての定周期プログラムに共通のグローバル変数とが混在で格納されている。
The data RAM 12 has a user data area 12a and stores equalized data transfer information 12b.
In the user data area 12a, as described in Patent Document 2 and the like, local variables corresponding to each fixed cycle program and global variables common to all fixed cycle programs are stored in a mixed manner. Yes.

等値化データ転送情報12bは、上記特許文献2におけるマッピング情報に相当するものであり、上記各ローカル変数とグローバル変数のユーザデータ領域12aにおける格納位置を示す情報である。   The equalized data transfer information 12b corresponds to the mapping information in Patent Document 2, and is information indicating the storage positions of the local variables and global variables in the user data area 12a.

等値化バス制御部13は、主に等値化バス3を介して等値化を行う為のデータ転送処理専用の構成であり、マイクロプロセッサ15から等値化すべきデータ等(後述する等値化
データフレーム)が渡されると、待機側の等値化バス制御部23と連動して、この等値化データを待機側の受信バッファ用RAM24に格納させる機能を有する。尚、等値化バス制御部13は、例えば上記“SGM(Sameness data Gather Memory control)”に相当する。
The equalization bus control unit 13 is a configuration dedicated to data transfer processing mainly for performing equalization via the equalization bus 3, and data to be equalized from the microprocessor 15 (equivalent values described later). When the equalized data frame is transferred, the equalized data is stored in the standby-side reception buffer RAM 24 in conjunction with the equalization bus control unit 23 on the standby side. The equalization bus controller 13 corresponds to, for example, the above “SGM (Sameness data Gather Memory control)”.

マイクロプロセッサ15は、CPUモジュール1全体を制御する中央処理装置(CPUチップ等)であり、上記プログラムRAM11に格納されているユーザプログラム11aや上記アプリケーションプログラムを用いて、基本的には上記特許文献2等のような従来より行われている演算処理や稼動側等値化処理を実行するが、更に稼動側等値化処理の際に図3(a)に示す処理を実行する。その際に、シリアルNO.保持メモリ16に記憶されているシリアルNO.を用いる。詳しくは後述する。   The microprocessor 15 is a central processing unit (CPU chip or the like) that controls the entire CPU module 1, and basically uses the user program 11a and the application program stored in the program RAM 11 and basically uses the above-mentioned Patent Document 2. Conventionally performed arithmetic processing and operation side equalization processing, such as the above, are executed, but the processing shown in FIG. 3A is further executed during operation side equalization processing. At that time, serial NO. The serial number stored in the holding memory 16. Is used. Details will be described later.

また、待機系のCPUモジュール2は、プログラムRAM21、データRAM22、等値化バス制御部23、受信バッファ用RAM24、マイクロプロセッサ25、及びシリアルNO.保持メモリ26等を有する。この構成自体は、稼動系のCPUモジュール1と同じであるので、特に説明しないが、マイクロプロセッサ25は、プログラムRAM21に格納されているアプリケーションプログラムを用いて、基本的には上記特許文献2等のような従来より行われている待機側等値化処理を実行するが、更に待機側等値化処理の際に図3(b)に示す処理を実行する。その際に、シリアルNO.保持メモリ26に記憶されているシリアルNO.を用いる。詳しくは後述する。   The standby CPU module 2 includes a program RAM 21, a data RAM 22, an equalization bus control unit 23, a reception buffer RAM 24, a microprocessor 25, and a serial NO. A holding memory 26 and the like are included. Since this configuration itself is the same as that of the active CPU module 1, it will not be described in particular. However, the microprocessor 25 basically uses the application program stored in the program RAM 21 to The standby side equalization process that has been conventionally performed is executed, and the process shown in FIG. 3B is further executed during the standby side equalization process. At that time, serial NO. The serial number stored in the holding memory 26. Is used. Details will be described later.

図2に、等値化処理に伴う等値化データの転送、格納の様子を示す。尚、図2において上記図7と略同様のものについては説明を省略する。図2が図7と異なる点は、等値化データフレームのヘッダ部に送信シリアルNO.も格納され、この送信シリアルNO.が等値化データと共に待機側の受信バッファ用RAM24に格納され、マイクロプロセッサ25がこの送信シリアルNO.等を参照してユーザデータ領域12aへの等値化データ格納処理を行う点である。   FIG. 2 shows how the equalized data is transferred and stored in the equalization process. In FIG. 2, the description of the components that are substantially the same as those in FIG. 7 is omitted. 2 differs from FIG. 7 in that the transmission serial No. is added to the header portion of the equalized data frame. Is also stored, and this transmission serial number. Is stored in the reception buffer RAM 24 on the standby side together with the equalized data, and the microprocessor 25 transmits the transmission serial number. The equalized data storage processing in the user data area 12a is performed with reference to the above.

更に詳しくは、まず、図1に示す通り、CPUモジュール1内には、シリアルNO.保持メモリ16が新たに備えられる。また、図2に示す通り、等値化データフレームのヘッダ部内に送信シリアル番号フィールドを定義してある。また、受信バッファ用RAM24においても各定周期プログラム毎の等値化データ格納領域に送信シリアルNO.も格納されるように定義してある。   More specifically, first, as shown in FIG. A holding memory 16 is newly provided. Further, as shown in FIG. 2, a transmission serial number field is defined in the header portion of the equalized data frame. Also in the reception buffer RAM 24, the transmission serial No. is stored in the equalized data storage area for each fixed cycle program. Is also defined to be stored.

そして、まず、図3(a)に示すように、稼動系CPUモジュール1の等値化データ送信処理では、マイクロプロセッサ15は、シリアルNO.保持メモリ16に格納された送信シリアル番号を、ワーク変数であるTMP1に取得し(ステップS11)、TMP1の値を更新(例えばインクリメント(例えば+1等))して(ステップS12)等値化データフレームのヘッダ部内にセットすると共に(ステップS13)、更新したTMP1の値をシリアルNO.保持メモリ16に格納する(シリアルNO.保持メモリ16の送信シリアルNO.を更新する)(ステップS14)。尚、上記インクリメント処理は、上記+1に限らず、+2、+3等であってもよい。すなわち、所定値をプラスすればよい。あるいは、インクリメントに限らず、−1、−2、−3等のデクリメントであってもよい(但し、この場合には、後述するステップS23の処理は「TMP1<TMP2?」となる)。   First, as shown in FIG. 3A, in the equalized data transmission process of the active system CPU module 1, the microprocessor 15 performs serial NO. The transmission serial number stored in the holding memory 16 is acquired in the work variable TMP1 (step S11), and the value of TMP1 is updated (for example, incremented (for example, +1)) (step S12). (Step S13), and the updated value of TMP1 is set to the serial number. The data is stored in the holding memory 16 (the serial number and the transmission serial number in the holding memory 16 are updated) (step S14). The increment process is not limited to +1, but may be +2, +3, or the like. That is, a predetermined value may be added. Alternatively, it is not limited to increment, but may be decrement such as -1, -2, -3, etc. (However, in this case, the processing in step S23 described later becomes "TMP1 <TMP2?").

また、図示しないが、等値化データフレームのヘッダ部には等値化実行定周期プログラム番号もセットされるし、等値化データ(実行した定周期プログラムに対応するローカル変数、及びグローバル変数等)を、等値化データ転送情報12b(マッピング情報)を参照してユーザデータ領域12aから取り出して、等値化データフレームのデータ部にセットする処理も行われる。そして、等値化データフレームを待機系のCPUモジュール側へ
転送する。尚、上記等値化実行定周期プログラム番号とは、この等値化処理に係わる定周期プログラムの定周期プログラム番号である。
Although not shown, the equalization execution fixed cycle program number is also set in the header portion of the equalization data frame, and the equalization data (local variable and global variable corresponding to the executed fixed cycle program, etc.) ) Is extracted from the user data area 12a with reference to the equalized data transfer information 12b (mapping information) and set in the data portion of the equalized data frame. Then, the equalized data frame is transferred to the standby CPU module side. The equalization execution fixed cycle program number is a fixed cycle program number of a fixed cycle program related to the equalization processing.

この転送処理は、上記の通り等値化バス3を介して、等値化バス制御部13と等値化バス制御部23とが連動して、等値化データフレームを待機側の受信バッファ用RAM24に格納するものである。ここで、本例では、受信バッファ用RAM24には各定周期プログラム毎の格納領域が設けられており、この転送処理の際には、図2に示す通り、等値化データフレームの上記等値化実行定周期プログラム番号に基づいて、等値化データフレームを該当する格納領域に格納する(振り分ける)。例えば、定周期プログラムAに係わる等値化処理であれば、等値化実行定周期プログラム番号=Aとなっているので、この等値化データフレームは受信バッファ用RAM24内の定周期プログラムA用の格納領域に格納する。   In this transfer process, the equalization bus control unit 13 and the equalization bus control unit 23 are linked via the equalization bus 3 as described above, and the equalized data frame is transferred to the standby side reception buffer. The data is stored in the RAM 24. Here, in this example, the reception buffer RAM 24 is provided with a storage area for each fixed-cycle program, and at the time of this transfer processing, as shown in FIG. The equalized data frame is stored (assigned) in the corresponding storage area based on the equalization execution fixed cycle program number. For example, in the case of the equalization processing related to the fixed cycle program A, since the equalized execution fixed cycle program number = A, this equalized data frame is for the fixed cycle program A in the reception buffer RAM 24. Store in the storage area.

一方、待機系CPUモジュール2では、上記の通り等値化データフレームを受信バッファ用RAM24に格納する処理が完了すると、マイクロプロセッサ25は、まず、受信バッファ用RAM24に格納された送信シリアルNO.を、ワーク変数であるTMP1に取得し(ステップS21)、更にシリアルNO.保持メモリ26に格納されているシリアルNO.を、ワーク変数であるTMP2に取得する(ステップS22)。   On the other hand, in the standby CPU module 2, when the process of storing the equalized data frame in the reception buffer RAM 24 is completed as described above, the microprocessor 25 first transmits the transmission serial number stored in the reception buffer RAM 24. Is acquired in the work variable TMP1 (step S21), and the serial No. The serial number stored in the holding memory 26. Is acquired in TMP2 which is a work variable (step S22).

そして、TMP1の値とTMP2の値とを比較して、もしTMP1>TMP2である場合は(ステップS23,YES)、最新の等値化データであると判断し(つまり正常であると判定し)、TMP1の値をシリアルNO.保持メモリ26にセットすると共に(ステップS24)、等値化データ分配処理(受信バッファ用RAM24に格納された等値化データを、ユーザデータ領域22a内の該当領域へ格納する処理)を実行する(ステップS25)。この等値化データ分配処理自体は、上記特許文献2と同様に、等値化データ転送情報22b(マッピング情報)を参照して、ローカル変数、グローバル変数をそれぞれ、ユーザデータ領域22a内の該当領域へ格納する。   Then, the value of TMP1 is compared with the value of TMP2. If TMP1> TMP2 is satisfied (step S23, YES), it is determined that it is the latest equalized data (that is, determined to be normal). , The value of TMP1 is changed to serial NO. While being set in the holding memory 26 (step S24), an equalized data distribution process (a process for storing the equalized data stored in the reception buffer RAM 24 in the corresponding area in the user data area 22a) is executed (step S24). Step S25). This equalized data distribution processing itself is performed in the same way as in the above-mentioned Patent Document 2, referring to the equalized data transfer information 22b (mapping information), and each of the local variable and the global variable in the corresponding area in the user data area 22a. To store.

一方、TMP1>TMP2ではない場合は(ステップS23,NO)、最新でない等値化データであると判断し(つまり、異常と判定し)、上記シリアルNO.保持メモリ26の更新や等値化データ分配処理を実行せずに(但し、図には示していないが、分配処理を行わないのはグローバル変数のみであり、ローカル変数等は分配処理を行う)、本処理を終了する。   On the other hand, when TMP1> TMP2 is not satisfied (step S23, NO), it is determined that the data is not the latest equalized data (that is, determined to be abnormal), and the serial NO. The update of the holding memory 26 and the equalized data distribution process are not executed (however, although not shown in the figure, only the global variables do not perform the distribution process, and the local variables and the like perform the distribution process). This process is terminated.

図4に、図9に示すスケジュール例で定周期プログラムが実行された場合のシリアルNO.とグローバル変数の更新状態を示す。
図9で説明した通り、稼動系CPUモジュール側では、まず、定周期プログラムBが実行されて演算処理によってグローバル変数=1234となり、演算処理完了後に等値化処理が起動され、まず、シリアルNO.保持メモリ16に格納されているシリアルNO.=“n”を読み出して、上記ステップS12〜S14の処理により“n+1”を等値化データフレームにセットすると共にシリアルNO.メモリ16に格納(上書き)する。また、従来と同様に等値化データ収集等も行って、等値化データフレームの転送処理を行う。そして、少なくともグローバル変数=1234を収集・保持した後であって上記待機側の等値化処理が実行される前に、割り込みにより上位レベルである定周期プログラムAが起動されたとする。
FIG. 4 shows the serial No. when the fixed cycle program is executed in the schedule example shown in FIG. And global variable update status.
As described with reference to FIG. 9, on the active CPU module side, first, the periodic program B is executed and global variable = 1234 is obtained by the arithmetic processing, and the equalization processing is started after the arithmetic processing is completed. The serial number stored in the holding memory 16. = “N” is read out, and “n + 1” is set in the equalized data frame by the processing in steps S12 to S14, and the serial number. Store (overwrite) in the memory 16. Also, the equalized data collection is performed as in the conventional case, and the equalized data frame transfer process is performed. Assume that the periodic program A, which is a higher level, is started by an interrupt after at least the global variable = 1234 is collected and held and before the equalization process on the standby side is executed.

この場合、定周期プログラムAの演算処理によりグローバル変数=1235となり、演算処理完了後に等値化処理が起動され、まず、シリアルNO.保持メモリ16に格納されている“n+1”を読み出して、上記ステップS12〜S14の処理により“n+2”を等値化データフレームにセットすると共にシリアルNO.メモリ16に格納する。また、
従来と同様に等値化データ収集(グローバル変数=1235等を取得)を行い、収集データを等値化データフレームにセットして(保持して)待機側に転送し、更に待機側の等値化処理が実行・完了されることで、最新のグローバル変数の値(=1235)がユーザデータ領域22aにおけるグローバル変数格納領域に格納された状態となる。
In this case, the global variable = 1235 is obtained by the arithmetic processing of the periodic program A, and the equalization processing is started after the arithmetic processing is completed. “N + 1” stored in the holding memory 16 is read, and “n + 2” is set in the equalized data frame by the processing of steps S12 to S14, and the serial NO. Store in the memory 16. Also,
Equivalent data collection (acquisition of global variable = 1235, etc.) is performed as before, the collected data is set in the equalized data frame (retained), transferred to the standby side, and the standby side equivalent By executing and completing the process, the latest global variable value (= 1235) is stored in the global variable storage area in the user data area 22a.

すなわち、この場合の待機側の等値化処理、すなわち定周期プログラムAの等値化データの分配処理では、図3(b)の処理によって、RAM24に格納されたシリアルNO.=“n+2”とシリアルNO.保持メモリ26に格納されている“n”との比較チェックの結果、ステップS23の判定はYESとなるので、上記ステップS24、S25の処理が実行されることになる。つまり、ユーザデータ領域22aのグローバル変数の更新(当然、ローカル変数も更新)、シリアルNO.保持メモリ26のシリアルNO.の更新が行われる。従って、ユーザデータ領域22aのグローバル変数=1235、シリアルNO.保持メモリ26のシリアルNO.=“n+2”となる。   In other words, in the equalization process on the standby side in this case, that is, the distribution process of the equalized data of the fixed cycle program A, the serial No. stored in the RAM 24 is processed by the process of FIG. = "N + 2" and serial No. As a result of the comparison check with “n” stored in the holding memory 26, the determination in step S23 is YES, so that the processing in steps S24 and S25 is executed. That is, updating the global variable in the user data area 22a (of course, updating the local variable), serial NO. The serial number of the holding memory 26. Is updated. Therefore, the global variable = 1235 of the user data area 22a, the serial No. The serial number of the holding memory 26. = "N + 2".

その後、定周期プログラムBの等値化処理が再開され、待機側の等値化処理を実行する際には、RAM24における定周期プログラムBの等値化データ格納領域には、送信シリアルNO.=“n+1”、グローバル変数=1234等が格納されていることになる。   Thereafter, the equalization processing of the fixed cycle program B is resumed, and when the equalization processing on the standby side is executed, the transmission serial No. is stored in the equalized data storage area of the fixed cycle program B in the RAM 24. = “N + 1”, global variable = 1234, and the like are stored.

従って、この場合の待機側の等値化処理(定周期プログラムBの等値化データの分配処理)では、RAM24に格納されたシリアルNO.=“n+1”とシリアルNO.保持メモリ26のシリアルNO.=“n+2”とが比較チェックされることになるので、ステップS23の判定はNOとなり、上記ステップS24、S25の処理は実行されない(但し、上記の通り、ユーザデータ領域22aのローカル変数は更新される)。従って、ユーザデータ領域22aのグローバル変数=1235、シリアルNO.保持メモリ26のシリアルNO.=“n+2”のままとなり、待機系CPUモジュール側に格納されるグローバル変数は、最新のデータとなるので(つまり、稼動と待機とで同じ値となる)、その後に稼動系/待機系が切換った場合にも問題は生じないことになる。尚、シリアルNO.保持メモリ16、26に格納されるシリアルNO.も両方とも“n+2”となる(稼動、待機で同じ値となる)。   Therefore, in the equalization processing on the standby side in this case (distribution processing of the equalized data of the fixed cycle program B), the serial No. stored in the RAM 24 is stored. = "N + 1" and serial No. The serial number of the holding memory 26. = “N + 2” is compared and checked, so the determination in step S23 is NO, and the processing in steps S24 and S25 is not executed (however, as described above, the local variable in the user data area 22a is updated). ) Therefore, the global variable = 1235 of the user data area 22a, the serial No. The serial number of the holding memory 26. = “N + 2” remains, and the global variable stored on the standby CPU module side is the latest data (that is, the same value for operation and standby). If this happens, there will be no problem. Serial No. The serial numbers stored in the holding memories 16 and 26. Are both “n + 2” (the same value is obtained during operation and standby).

このように、稼動系CPUモジュールから送信される各等値化フレーム内にシリアル番号を格納し、待機系CPUモジュールにてシリアル番号のチェックを行い、異常が無い場合のみ(最新の等値化データならば)グローバル変数の分配処理も行うことにより、稼動系/待機系が切換った場合に、最新のユーザデータによりプログラムが実行されることを保証できる。   In this way, the serial number is stored in each equalization frame transmitted from the active system CPU module, the serial number is checked by the standby CPU module, and only when there is no abnormality (the latest equalization data If the global variable is distributed, it can be guaranteed that the program is executed with the latest user data when the active / standby system is switched.

以上説明したように、本例の2重化コントローラシステムによれば、複数の定周期プログラムを実行可能とし、各定周期プログラムエンドにて等値化をおこなう場合に、ユーザデータ等値化の実行中に上位レベル定周期プログラムの割込みが発生する場合においても、稼動系/待機系が切換った場合に、最新のユーザデータによりプログラムを実行することができる。   As described above, according to the duplex controller system of this example, it is possible to execute a plurality of fixed-cycle programs, and perform equalization of user data when equalization is performed at each fixed-cycle program end. Even when an interrupt of the upper level fixed cycle program occurs, the program can be executed with the latest user data when the active system / standby system is switched.

本例の2重化コントローラシステムにおけるCPUモジュールの構成例である。It is a structural example of a CPU module in the duplex controller system of this example. 等値化処理に伴う等値化データの転送、格納の様子を示す図である。It is a figure which shows the mode of transfer of an equalization data accompanying an equalization process, and a storage. (a)は等値化データ送信処理、(b)は等値化データ受信処理を示すフローチャート図である。(A) is an equalization data transmission process, (b) is a flowchart figure which shows an equalization data reception process. 図9に示すスケジュール例で定周期プログラムが実行された場合のグローバル変数等の更新状態を示す図である。It is a figure which shows the update state of a global variable etc. when a fixed cycle program is performed by the example of a schedule shown in FIG. 2重化コントローラシステム全体の概略構成を示す図である。It is a figure which shows schematic structure of the whole duplex controller system. 図5に示す2重化コントローラシステムにおける各CPUモジュールの構成例である。It is a structural example of each CPU module in the duplex controller system shown in FIG. 従来の等値化処理に伴う等値化データの転送、格納の様子を示す図である。It is a figure which shows the mode of transfer of the equalization data accompanying the conventional equalization process, and a storage. 定周期プログラムが実行される場合のスケジュール例(その1)である。It is a schedule example (the 1) in case a periodic program is performed. 定周期プログラムが実行される場合のスケジュール例(その2)である。It is a schedule example (the 2) in case a periodic program is performed.

符号の説明Explanation of symbols

1 CPUモジュール(稼動系)
2 CPUモジュール(待機系)
11 プログラムRAM
11a ユーザプログラム
12 データRAM
12a ユーザデータ領域
12b 等値化データ転送情報
13 等値化バス制御部
14 受信バッファ用RAM
15 マイクロプロセッサ
16 シリアルNO.保持メモリ
21 プログラムRAM
21a ユーザプログラム
22 データRAM
22a ユーザデータ領域
22b 等値化データ転送情報
23 等値化バス制御部
24 受信バッファ用RAM
25 マイクロプロセッサ
26 シリアルNO.保持メモリ
1 CPU module (working system)
2 CPU module (standby system)
11 Program RAM
11a User program 12 Data RAM
12a User data area 12b Equalized data transfer information 13 Equalized bus control unit 14 Receive buffer RAM
15 Microprocessor 16 Serial No. Retention memory 21 Program RAM
21a User program 22 Data RAM
22a User data area 22b Equalized data transfer information 23 Equalized bus control unit 24 Receive buffer RAM
25 Microprocessor 26 Serial No. Holding memory

Claims (2)

複数の定周期プログラムを実行する稼動系のコントローラと、待機系のコントローラを有する2重化コントローラシステムであって、
前記稼動系のコントローラは、
前記各定周期プログラムに対応する各ローカル変数と、全ての定周期プログラムが共有するグローバル変数を記憶する第1の変数記憶手段と、
シリアル番号を記憶する第1のシリアル番号記憶手段と、
前記各定周期プログラムの演算実行完了する毎に、前記第1のシリアル番号記憶手段に記憶されているシリアル番号を取得して、該シリアル番号を更新し、該更新したシリアル番号を前記第1のシリアル番号記憶手段に記憶すると共に等値化データフレームにセットし、該実行した定周期プログラムに対応する前記ローカル変数と前記グローバル変数を前記第1の変数記憶手段から収集して前記等値化データフレームに格納して、該等値化データフレームを前記待機系のコントローラに転送する稼動側等値化処理手段とを有し、
前記待機系のコントローラは、
前記各定周期プログラムに対応する各ローカル変数と、全ての定周期プログラムが共有するグローバル変数を記憶する第2の変数記憶手段と、
シリアル番号を記憶する第2のシリアル番号記憶手段と、
前記転送された等値化データフレーム内の前記シリアル番号と、前記第2のシリアル番号記憶手段に記憶されたシリアル番号とを比較することで、正常/異常を判定し、正常と判定された場合には、該等値化データフレーム内のシリアル番号を前記第2のシリアル番号記憶手段に記憶すると共に、該等値化データフレームに格納されている前記ローカル変数とグローバル変数を、前記第2の変数記憶手段に記憶する待機側等値化処理手段とを有し、
前記待機側等値化処理手段は、異常と判定した場合には、前記第2のシリアル番号記憶手段に記憶しているシリアル番号の更新は行わず、前記等値化データフレームに格納されている前記ローカル変数は前記第2の変数記憶手段に記憶すると共に、該等値化データフレームに格納されている前記グローバル変数は前記第2の変数記憶手段に記憶せず、
前記第1のシリアル番号記憶手段に記憶されているシリアル番号を更新する処理は、該シリアル番号をインクリメントする処理であり、
前記待機側等値化処理手段は、前記等値化データフレーム内のシリアル番号が、前記第2のシリアル番号記憶手段に記憶されたシリアル番号よりも大きい場合に、正常と判定することを特徴とする2重化コントローラシステム。
A duplex controller system having an active controller for executing a plurality of fixed-cycle programs and a standby controller,
The active controller is:
First variable storage means for storing each local variable corresponding to each periodic program and a global variable shared by all the periodic programs;
First serial number storage means for storing a serial number;
Each time the execution of each periodic program is completed, the serial number stored in the first serial number storage means is acquired, the serial number is updated, and the updated serial number is updated to the first serial number. The equalized data frame is stored in the serial number storage means and set in an equalized data frame, and the local variable and the global variable corresponding to the executed periodic program are collected from the first variable storage means. An operation side equalization processing means for storing the frame in a frame and transferring the equalized data frame to the standby controller;
The standby controller is:
Second variable storage means for storing each local variable corresponding to each periodic program and a global variable shared by all the periodic programs;
Second serial number storage means for storing a serial number;
When normal / abnormal is determined by comparing the serial number in the transferred equalized data frame with the serial number stored in the second serial number storage means, and when normal Storing the serial number in the equalized data frame in the second serial number storage means, and the local variable and global variable stored in the equalized data frame as the second serial number. Standby side equalization processing means for storing in the variable storage means,
When the standby side equalization processing means determines that there is an abnormality, the serial number stored in the second serial number storage means is not updated, but is stored in the equalization data frame. The local variable is stored in the second variable storage unit, and the global variable stored in the equalized data frame is not stored in the second variable storage unit,
The process of updating the serial number stored in the first serial number storage means is a process of incrementing the serial number,
The standby-side equalization processing unit determines that the serial number in the equalization data frame is normal when the serial number in the equalization data frame is greater than the serial number stored in the second serial number storage unit. Duplex controller system.
複数の定周期プログラムを実行する稼動系のコントローラと、待機系のコントローラを有する2重化コントローラシステムにおける前記待機系のコントローラであって、
前記各定周期プログラムに対応する各ローカル変数と全ての定周期プログラムが共有するグローバル変数を記憶する第2の変数記憶手段と、
シリアル番号を記憶する第2のシリアル番号記憶手段と、
前記稼動系のコントローラから転送された等値化データフレーム内のシリアル番号と、前記第2のシリアル番号記憶手段に記憶されたシリアル番号とを比較することで、正常/異常を判定し、正常と判定された場合には、該等値化データフレーム内のシリアル番号を前記第2のシリアル番号記憶手段に記憶すると共に、該等値化データフレームに格納されているローカル変数とグローバル変数を、前記第2の変数記憶手段に記憶する待機側等値化処理手段とを有し、
前記待機側等値化処理手段は、異常と判定した場合には、前記第2のシリアル番号記憶手段に記憶しているシリアル番号の更新は行わず、少なくとも等値化データフレームに格納されている前記グローバル変数は、前記第2の変数記憶手段に記憶せず、
前記待機側等値化処理手段は、前記等値化データフレーム内のシリアル番号が、前記第2のシリアル番号記憶手段に記憶されたシリアル番号よりも大きい場合に、正常と判定することを特徴とする待機系コントローラ。
A standby controller in a duplex controller system having an active controller for executing a plurality of periodic programs and a standby controller,
Second variable storage means for storing each local variable corresponding to each periodic program and a global variable shared by all the periodic programs;
Second serial number storage means for storing a serial number;
By comparing the serial number in the equalized data frame transferred from the operating system controller with the serial number stored in the second serial number storage means, it is determined whether it is normal or abnormal. If determined, the serial number in the equalized data frame is stored in the second serial number storage means, and the local and global variables stored in the equalized data frame are Standby side equalization processing means for storing in the second variable storage means,
If the standby side equalization processing means determines that there is an abnormality, the serial number stored in the second serial number storage means is not updated, but is stored at least in the equalization data frame. The global variable is not stored in the second variable storage means,
The standby-side equalization processing unit determines that the serial number in the equalization data frame is normal when the serial number in the equalization data frame is greater than the serial number stored in the second serial number storage unit. Standby system controller.
JP2007069053A 2007-03-16 2007-03-16 Duplex controller system, its active / standby controller Active JP5034584B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007069053A JP5034584B2 (en) 2007-03-16 2007-03-16 Duplex controller system, its active / standby controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007069053A JP5034584B2 (en) 2007-03-16 2007-03-16 Duplex controller system, its active / standby controller

Publications (2)

Publication Number Publication Date
JP2008234014A JP2008234014A (en) 2008-10-02
JP5034584B2 true JP5034584B2 (en) 2012-09-26

Family

ID=39906758

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007069053A Active JP5034584B2 (en) 2007-03-16 2007-03-16 Duplex controller system, its active / standby controller

Country Status (1)

Country Link
JP (1) JP5034584B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5965160B2 (en) * 2012-02-28 2016-08-03 日本電信電話株式会社 Data synchronization system, operation computer, and standby computer
JP6354535B2 (en) * 2014-11-17 2018-07-11 富士電機株式会社 Redundant control system and control device thereof
JP7358819B2 (en) * 2019-01-30 2023-10-11 富士電機株式会社 IO module duplication control device and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07234848A (en) * 1993-12-28 1995-09-05 Fuji Facom Corp Duplex system in computer system
JP4154853B2 (en) * 2000-11-13 2008-09-24 富士電機機器制御株式会社 A redundant programmable controller and an equalization method for equalizing control data.
JP2005092520A (en) * 2003-09-17 2005-04-07 Fuji Electric Systems Co Ltd Duplication controller system and equalization method thereof

Also Published As

Publication number Publication date
JP2008234014A (en) 2008-10-02

Similar Documents

Publication Publication Date Title
JP6496562B2 (en) Semiconductor device, diagnostic test method and diagnostic test circuit
JP2007011426A (en) Processor
JP3481737B2 (en) Dump collection device and dump collection method
JP2009054083A (en) Processor, data transfer unit, and multi-core processor system
JP5034584B2 (en) Duplex controller system, its active / standby controller
JP4941954B2 (en) Data error detection device and data error detection method
JP2003296133A (en) Controller
JP5034979B2 (en) START-UP DEVICE, START-UP METHOD, AND START-UP PROGRAM
JP2006235765A (en) Duplex controller system, and its controller
JPH09330106A (en) Control system with backup function
JP4281602B2 (en) Duplex controller system, its controller and program
JP2008262426A (en) Duplex controller system and controller
JP2009032100A (en) Duplex plc
EP2849005B1 (en) Standby dual redundant system
JP2011113240A (en) Duplex processing apparatus
JP4232589B2 (en) Duplex controller and its equalization mode decision method
JP7007223B2 (en) Control device and abnormality detection method
JP2005092520A (en) Duplication controller system and equalization method thereof
JP6726136B2 (en) Data access device and access error notification method
US20130055017A1 (en) Device and method for restoring information in a main storage unit
JP2007172096A (en) Information processor and start control method
JP5233869B2 (en) Processing system and method for executing program executed by processing apparatus
JP4273905B2 (en) Duplex controller system and method
JPH0895614A (en) Controller
JP2000293376A (en) Circuit and method for switching boot program

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20080919

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20080919

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20080919

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090914

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110413

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110419

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20110422

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110616

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111122

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120112

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: 20120605

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120618

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150713

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5034584

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250