JP2000207275A - Processor - Google Patents

Processor

Info

Publication number
JP2000207275A
JP2000207275A JP11002973A JP297399A JP2000207275A JP 2000207275 A JP2000207275 A JP 2000207275A JP 11002973 A JP11002973 A JP 11002973A JP 297399 A JP297399 A JP 297399A JP 2000207275 A JP2000207275 A JP 2000207275A
Authority
JP
Japan
Prior art keywords
data
data area
flag
cpu
cpu module
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.)
Withdrawn
Application number
JP11002973A
Other languages
Japanese (ja)
Inventor
Hirobumi Yamada
博文 山田
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric 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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP11002973A priority Critical patent/JP2000207275A/en
Publication of JP2000207275A publication Critical patent/JP2000207275A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To obtain a processor which ensures the concurrence of data by allowing another CPU module to read data out of a common data area, when an in-output flag is off and allowing the CPU module to write data to the common data area, when the in-input flag is off. SOLUTION: When the in-input flags of a flag part 13 are all off, a CPU 11 reads desired data to be shared out of a data area 121 and writes them to the common data area 122. When an in-output flag of the flag part 13 is off, a CPU 21 reads the data out of the common data area 122 and writes them to a data area 221. Thus, when the in-output flag of the flag part of a CPU module 1 is off, a CPU module 2 reads data out of the common data area 122, and when the in-input flags of the flag part 13 are all off, a CPU module 1 writes data to the common data area 122. The concurrency of data can therefore be guaranteed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、少なくとも2つの
CPUモジュール間で、データの共有を行う処理装置に
関し、特に、データの同時性を保証する処理装置に関す
るものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a processing device for sharing data between at least two CPU modules, and more particularly to a processing device for guaranteeing data synchronization.

【0002】[0002]

【従来の技術】例えば、プログラマブルコントローラに
おいて、2つのCPUモジュール間でデータを共有する
場合、一方のCPUモジュールが、共有したいデータを
自CPUモジュール内のデータ領域から自CPUモジュ
ール内の共有データ領域に書き込む。そして、他方のC
PUモジュールが、一方のCPUモジュール内の共有デ
ータ領域から共有したいデータを読み込み、自CPUモ
ジュール内のデータ領域に書き込むことにより、データ
の共有を行っていた。
2. Description of the Related Art For example, when data is shared between two CPU modules in a programmable controller, one CPU module transfers data to be shared from a data area in the own CPU module to a shared data area in the own CPU module. Write. And the other C
A PU module has shared data by reading data to be shared from a shared data area in one CPU module and writing the data to a data area in its own CPU module.

【0003】このような装置を図3に示し、以下に説明
する。図において、CPUモジュール1は、バス(図示
せず)に接続され、CPU11とメモリ(記憶部)12
とを有する。CPU11は、メモリ12に接続し、演算
処理を行う。メモリ12は、データ領域121と共有デ
ータ領域122とを有する。データ領域121は、通常
のデータ、例えば、共有したいデータの他に、単独のC
PUを動作させるためや、動作状態を記録しておくため
のローカルなデータを格納する。共有データ領域122
は、共有するデータを格納する。
[0003] Such an apparatus is shown in FIG. 3 and is described below. In the figure, a CPU module 1 is connected to a bus (not shown), and has a CPU 11 and a memory (storage unit) 12.
And The CPU 11 is connected to the memory 12 and performs arithmetic processing. The memory 12 has a data area 121 and a shared data area 122. The data area 121 stores normal data, for example, data to be shared, and a single C
Stores local data for operating the PU and for recording the operation state. Shared data area 122
Stores data to be shared.

【0004】CPUモジュール2は、バスに接続され、
CPU21とメモリ(記憶部)22とを有する。CPU
21は、メモリ22に接続し、演算処理を行う。メモリ
22は、データ領域221と共有データ領域222とを
有する。データ領域221は、通常のデータを格納す
る。共有データ領域222は、共有するデータを格納す
る。
The CPU module 2 is connected to a bus,
It has a CPU 21 and a memory (storage unit) 22. CPU
21 is connected to the memory 22 and performs arithmetic processing. The memory 22 has a data area 221 and a shared data area 222. The data area 221 stores normal data. The shared data area 222 stores data to be shared.

【0005】このような装置の動作を以下に説明する。
図4は図3に示す装置の動作を示したフローチャートで
ある。(a)はCPUモジュール1の動作を示し、
(b)はCPUモジュール2の動作を示す。
The operation of such a device will be described below.
FIG. 4 is a flowchart showing the operation of the apparatus shown in FIG. (A) shows the operation of the CPU module 1,
(B) shows the operation of the CPU module 2.

【0006】まず始めにCPUモジュール1の動作を説
明する。CPU11は、バスを介して、共有データ領域
222からデータを読み込み、データ領域121に書き
込む。そして、CPU11は、データ領域121に読み
書きを行い、プログラムの実行処理を行う。処理後、共
有したいデータを、CPU11は、データ領域121か
ら読み出して、共有データ領域122に書き込む。この
ような動作を繰返す。
First, the operation of the CPU module 1 will be described. The CPU 11 reads data from the shared data area 222 via the bus and writes the data to the data area 121. Then, the CPU 11 reads and writes data from and to the data area 121 and executes a program execution process. After the processing, the CPU 11 reads data to be shared from the data area 121 and writes the data to the shared data area 122. Such an operation is repeated.

【0007】次にCPUモジュール2の動作を説明す
る。CPU21は、バスを介して、共有データ領域12
2からデータを読み込み、データ領域221に書き込
む。そして、CPU21は、データ領域221に読み書
きを行い、プログラムの実行処理を行う。処理後、共有
したいデータを、CPU21は、データ領域221から
読み出して、共有データ領域222に書き込む。このよ
うな動作を繰返す。
Next, the operation of the CPU module 2 will be described. The CPU 21 controls the shared data area 12 via the bus.
2 is read and written to the data area 221. Then, the CPU 21 reads and writes the data area 221 to execute the program. After the processing, the CPU 21 reads data to be shared from the data area 221 and writes the data to the shared data area 222. Such an operation is repeated.

【0008】[0008]

【発明が解決しようとする課題】このような装置では、
一方のCPUモジュールが共有データを読み込んでいる
時に、他方のCPUモジュールが共有データを書き込ん
でしまう場合があり、データの同時性が保証されないと
いう問題点があった。
In such a device,
While one CPU module is reading the shared data, the other CPU module may write the shared data, and there is a problem that the data synchronization is not guaranteed.

【0009】そこで、本発明の目的は、データの同時性
を保証する処理装置を実現することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to realize a processing device which guarantees data synchronization.

【0010】[0010]

【課題を解決するための手段】本発明は、CPUモジュ
ール内に、他のCPUモジュールと共有するデータの共
有データ領域を設け、少なくとも2つのCPUモジュー
ル間で、他のCPUモジュールの共有データ領域のデー
タ読み込みにより、データの共有を行う処理装置におい
て、前記CPUモジュール内に、前記共有データ領域の
データの書き込み状態を示す出力中フラグと、共有デー
タ領域のデータの読み込み状態を示す入力中フラグとか
らなるフラグ部を有し、出力中フラグがオフのときに、
前記他のCPUモジュールが前記共有データ領域のデー
タの読み込みを行い、入力中フラグがオフのときに、前
記CPUモジュールが共有データ領域に書き込みを行う
ことを特徴とするものである。
According to the present invention, a shared data area for data shared with another CPU module is provided in a CPU module, and a shared data area of another CPU module is provided between at least two CPU modules. In a processing device that performs data sharing by reading data, an output flag indicating a data write state of the shared data area and an input flag indicating a data read state of the shared data area are stored in the CPU module. When the output flag is off,
The another CPU module reads data in the shared data area, and writes the data in the shared data area when the input flag is off.

【0011】このような本発明では、フラグ部の出力中
フラグがオフのときに、他のCPUモジュールが共有デ
ータ領域のデータの読み込みを行う。そして、フラグ部
の入力中フラグがオフのときに、CPUモジュールが共
有データ領域に書き込みを行う。
In the present invention, when the output flag of the flag section is off, another CPU module reads data in the shared data area. Then, when the input flag in the flag section is off, the CPU module writes in the shared data area.

【0012】[0012]

【発明の実施の形態】以下図面を用いて本発明を説明す
る。図1は本発明の一実施例を示した構成図である。な
お、ここでは、n個のCPUモジュールの内、2つのC
PUモジュールだけを図示する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings. FIG. 1 is a configuration diagram showing one embodiment of the present invention. Here, of the n CPU modules, two C modules are used.
Only the PU module is shown.

【0013】図において、CPUモジュール1は、バス
(図示せず)に接続され、CPU11とメモリ(記憶
部)12とフラグ部13とを有する。CPU11は、メ
モリ12とフラグ部13とに接続し、演算処理を行う。
メモリ12は、データ領域121と共有データ領域12
2とを有する。データ領域121は、通常のデータを格
納する。共有データ領域122は、共有するデータを格
納する。フラグ部13は、共有データ領域122のデー
タの書き込み状態を示す出力中フラグと、共有データ領
域122のデータの読み込み状態を示す入力中フラグと
からなる。入力中フラグは、CPUモジュール1〜CP
Uモジュールnに対応して、CPU1入力中フラグ〜C
PUn入力中フラグからなっているが、CPU1入力中
フラグは他のCPUモジュールではないので、なくても
よい。
In FIG. 1, a CPU module 1 is connected to a bus (not shown), and has a CPU 11, a memory (storage unit) 12, and a flag unit 13. The CPU 11 is connected to the memory 12 and the flag unit 13 and performs arithmetic processing.
The memory 12 has a data area 121 and a shared data area 12.
And 2. The data area 121 stores normal data. The shared data area 122 stores shared data. The flag unit 13 includes an output flag indicating the data write state of the shared data area 122 and an input flag indicating the data read state of the shared data area 122. The input flag is set between CPU modules 1 to CP.
CPU1 input flag ~ C corresponding to U module n
Although the input flag is composed of the PUn input flag, the CPU1 input flag is not required for other CPU modules.

【0014】CPUモジュール2は、バスに接続され、
CPU21とメモリ(記憶部)22とフラグ部23とを
有する。CPU21は、メモリ22とフラグ部23とに
接続し、演算処理を行う。メモリ22は、データ領域2
21と共有データ領域222とを有する。データ領域2
21は、通常のデータを格納する。共有データ領域22
2は、共有するデータを格納する。フラグ部23は、共
有データ領域222のデータの書き込み状態を示す出力
中フラグと、共有データ領域222のデータの読み込み
状態を示す入力中フラグとからなる。入力中フラグは、
CPUモジュール1〜CPUモジュールnに対応して、
CPU1入力中フラグ〜CPUn入力中フラグからなっ
ているが、CPU2入力中フラグは他のCPUモジュー
ルではないので、なくてもよい。
The CPU module 2 is connected to a bus,
It has a CPU 21, a memory (storage unit) 22, and a flag unit 23. The CPU 21 is connected to the memory 22 and the flag unit 23 and performs arithmetic processing. The memory 22 stores the data area 2
21 and a shared data area 222. Data area 2
Reference numeral 21 stores ordinary data. Shared data area 22
2 stores shared data. The flag unit 23 includes an output flag indicating a data write state of the shared data area 222 and an input flag indicating a data read state of the shared data area 222. The input flag is
Corresponding to CPU module 1 to CPU module n,
The flag is composed of the CPU1 input flag to the CPUn input flag. However, the CPU2 input flag is not another CPU module, and thus may not be provided.

【0015】このような装置の動作を以下で説明する。
図2は図1に示す装置の動作を示したフローチャートで
ある。(a)はCPUモジュール1の共有データ領域1
22への書き込み動作(出力処理)を示し、(b)はC
PUモジュール2の共有データ領域122からの読み込
み動作(入力処理)を示す。
The operation of such a device will be described below.
FIG. 2 is a flowchart showing the operation of the apparatus shown in FIG. (A) is the shared data area 1 of the CPU module 1
22 shows a write operation (output processing) to C.22, and FIG.
The operation of reading from the shared data area 122 of the PU module 2 (input processing) is shown.

【0016】CPU11は、共有データ領域122への
書き込み前に、フラグ部13の出力中フラグをオンにす
る。フラグ部13の全入力中フラグの内、1つでもオン
ならば、CPU11は、フラグ部13の出力中フラグを
オフとして処理を終了する。フラグ部13の全入力中フ
ラグがすべてオフならば、CPU11は、データ領域1
21から共有したいデータを読み出し、共有データ領域
122に書き込む。書き込みが終了したら、CPU11
は、フラグ部13の出力中フラグをオフとして処理を終
了する。
The CPU 11 turns on the output flag of the flag unit 13 before writing to the shared data area 122. If at least one of the all input flags of the flag unit 13 is on, the CPU 11 turns off the output flag of the flag unit 13 and ends the process. If all of the inputting flags of the flag unit 13 are all off, the CPU 11
Data to be shared is read from the storage device 21 and written to the shared data area 122. When the writing is completed, the CPU 11
Turns off the output flag of the flag unit 13 and ends the process.

【0017】CPU21は、共有データ領域122から
の読み込み前に、バスを介して、フラグ部13のCPU
モジュール2に対応するCPU2入力中フラグをオンに
する。フラグ部13の出力中フラグがオンならば、CP
U21は、バスを介して、フラグ部13のCPUモジュ
ール2に対応するCPU2入力フラグをオフとして処理
を終了する。フラグ部12の出力中フラグがオフなら
ば、CPU21は、バスを介して、共有データ領域12
2のデータを読み込んで、データ領域221に書き込
む。書き込みが終了したら、CPU21は、バスを介し
て、フラグ部13の出力中フラグをオフとして処理を終
了する。
Before reading data from the shared data area 122, the CPU 21
The CPU 2 input flag corresponding to the module 2 is turned on. If the output flag of the flag unit 13 is on,
U21 turns off the CPU2 input flag corresponding to the CPU module 2 of the flag unit 13 via the bus, and ends the process. If the output flag of the flag unit 12 is off, the CPU 21 sends the shared data area 12 via the bus.
2 is read and written to the data area 221. When the writing is completed, the CPU 21 turns off the output flag of the flag unit 13 via the bus and ends the process.

【0018】このように、CPUモジュール1のフラグ
部13の出力中フラグがオフのときに、CPUモジュー
ル2が共有データ領域122のデータの読み込みを行
い、フラグ部13の全入力中フラグがオフのときに、C
PUモジュール1が共有データ領域122に書き込みを
行うので、データの同時性が保証できる。
As described above, when the output flag of the flag section 13 of the CPU module 1 is off, the CPU module 2 reads the data of the shared data area 122, and all the input flags of the flag section 13 are off. Sometimes C
Since the PU module 1 writes data in the shared data area 122, data simultaneity can be guaranteed.

【0019】なお、本発明はこれに限定されるものでは
なく、以下のようなものでもよい。フラグ部13,23
は、CPUモジュールごとに入力中フラグを設けた構成
を示したが、1つの入力中フラグでどれか1つのCPU
モジュールが読み出し状態ならば、オンとする構成にし
てもよい。但し、入力中フラグをオフにする時に、他の
CPUモジュールが入力中でないか、チェックする必要
がある。
The present invention is not limited to this, but may be as follows. Flags 13, 23
Shows a configuration in which an input flag is provided for each CPU module, but one input flag indicates any one CPU.
If the module is in the reading state, it may be turned on. However, when turning off the input flag, it is necessary to check whether another CPU module is inputting.

【0020】また、メモリ12,22にそれぞれデータ
領域121,221と共有データ領域122,222と
を設ける構成を示したが、データ領域121,221と
共有データ領域122,222とが別々のメモリに格納
される構成でもよい。そして、フラグ部13,23を、
メモリ12,22に設ける構成でもよい。
Although the data areas 121 and 221 and the shared data areas 122 and 222 are provided in the memories 12 and 22, respectively, the data areas 121 and 221 and the shared data areas 122 and 222 are provided in separate memories. The stored configuration may be used. Then, the flag units 13 and 23 are
The structure provided in the memories 12 and 22 may be sufficient.

【0021】[0021]

【発明の効果】本発明によれば、以下のような効果があ
る。出力中フラグがオフのときに、他のCPUモジュー
ルが共有データ領域のデータの読み込みを行い、入力中
フラグがオフのときに、CPUモジュールが共有データ
領域に書き込みを行うので、データの同時性が保証でき
る。
According to the present invention, the following effects can be obtained. When the output flag is off, another CPU module reads data in the shared data area, and when the input flag is off, the CPU module writes data in the shared data area. Can be guaranteed.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例を示した構成図である。FIG. 1 is a configuration diagram showing one embodiment of the present invention.

【図2】図1に示す装置の動作を示したフローチャート
である。
FIG. 2 is a flowchart showing the operation of the device shown in FIG.

【図3】従来の処理装置の動作を示した構成図である。FIG. 3 is a configuration diagram showing an operation of a conventional processing apparatus.

【図4】図3に示す装置の動作を示したフローチャート
である。
4 is a flowchart showing the operation of the device shown in FIG.

【符号の説明】[Explanation of symbols]

1,2 CPUモジュール 122,222 共有データ領域 13,23 フラグ部 1, 2 CPU module 122, 222 Shared data area 13, 23 Flag section

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 CPUモジュール内に、他のCPUモジ
ュールと共有するデータの共有データ領域を設け、少な
くとも2つのCPUモジュール間で、他のCPUモジュ
ールの共有データ領域のデータ読み込みにより、データ
の共有を行う処理装置において、 前記CPUモジュール内に、前記共有データ領域のデー
タの書き込み状態を示す出力中フラグと、共有データ領
域のデータの読み込み状態を示す入力中フラグとからな
るフラグ部を有し、 出力中フラグがオフのときに、前記他のCPUモジュー
ルが前記共有データ領域のデータの読み込みを行い、入
力中フラグがオフのときに、前記CPUモジュールが共
有データ領域に書き込みを行うことを特徴とする処理装
置。
A shared data area for data shared with another CPU module is provided in a CPU module, and data is shared between at least two CPU modules by reading data in a shared data area of the other CPU module. In the processing device, the CPU module has a flag unit including an output flag indicating a data write state of the shared data area and an input flag indicating a data read state of the shared data area. When the medium flag is off, the other CPU module reads data in the shared data area, and when the input flag is off, the CPU module writes in the shared data area. Processing equipment.
【請求項2】 入力中フラグをCPUモジュールごとに
設けたことを特徴とする請求項1記載の処理装置。
2. The processing device according to claim 1, wherein an input flag is provided for each CPU module.
JP11002973A 1999-01-08 1999-01-08 Processor Withdrawn JP2000207275A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11002973A JP2000207275A (en) 1999-01-08 1999-01-08 Processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11002973A JP2000207275A (en) 1999-01-08 1999-01-08 Processor

Publications (1)

Publication Number Publication Date
JP2000207275A true JP2000207275A (en) 2000-07-28

Family

ID=11544325

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11002973A Withdrawn JP2000207275A (en) 1999-01-08 1999-01-08 Processor

Country Status (1)

Country Link
JP (1) JP2000207275A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312310A (en) * 2001-04-17 2002-10-25 Sony Corp Information communication method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312310A (en) * 2001-04-17 2002-10-25 Sony Corp Information communication method

Similar Documents

Publication Publication Date Title
JP2835184B2 (en) Information processing apparatus, device control method, and IC card
US4835684A (en) Microcomputer capable of transferring data from one location to another within a memory without an intermediary data bus
JPH0472255B2 (en)
JP3514651B2 (en) Reboot control device
JP2000207275A (en) Processor
JPH0844622A (en) Information processor
JPH01261758A (en) Computer system
JP2962431B2 (en) Programmable controller
JPH04177452A (en) Information processor
JPH0589041A (en) Data processor
JP2751878B2 (en) Multiprocessor device
JP2001290790A (en) Disk controller
JP2884620B2 (en) Digital image processing device
JP2919357B2 (en) CPU interface circuit
JPH08335193A (en) Information processor
JP2002259209A (en) Arithmetic processing system
KR20000005448U (en) Processor redundancy system
JPS61169923A (en) Data processing system
JPH01121965A (en) Microprocessor
JPS62239242A (en) Debugging device
JPH0312749A (en) Hardware initial diagnostic control system for multiprocessor system
JPS62102353A (en) Down line loading system for program
JPS644220B2 (en)
JPS6354656A (en) Multi-processor system
JPH03252854A (en) One bus control system by two processors

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040921

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040927

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20041125