JPH11242506A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH11242506A
JPH11242506A JP10042084A JP4208498A JPH11242506A JP H11242506 A JPH11242506 A JP H11242506A JP 10042084 A JP10042084 A JP 10042084A JP 4208498 A JP4208498 A JP 4208498A JP H11242506 A JPH11242506 A JP H11242506A
Authority
JP
Japan
Prior art keywords
master
bus
data transmission
priority
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.)
Withdrawn
Application number
JP10042084A
Other languages
Japanese (ja)
Inventor
Katsuhiko Ichimura
勝彦 市村
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
Omron Tateisi Electronics Co
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, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP10042084A priority Critical patent/JPH11242506A/en
Publication of JPH11242506A publication Critical patent/JPH11242506A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Bus Control (AREA)
  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce retransmission time by adjustment of data transmission priority in a bus connection system and to shorten data transmission time. SOLUTION: The programmable controller records the priority, the bus occupation time and the tolerable waiting time of its own master and the priority and the data transmission processing remaining time of a master operating as a master at present in the registers of the respective masters. At the time of transmitting data based on them, it is decided whether a processing is to be executed after the termination of the data transmission of the present master is waited for or the processing is to be executed after the data transmission of the present master is stopped.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、プログラマブル
コントローラに関し、特に、バス結合方式における複数
のマスタのバス使用権の制御に関するものである。
[0001] 1. Field of the Invention [0002] The present invention relates to a programmable controller, and more particularly to control of a bus use right of a plurality of masters in a bus connection system.

【0002】[0002]

【従来の技術】バス結合方式を用いたプログラマブルコ
ントローラにおける複数のマスタのバス使用権の制御に
は、例えば、データ伝送処理中のマスタAと伝送処理要
求をするマスタBとの間で、マスタA、B間のどちらを
先に処理すべきかを原則として決める「優先度」に応じ
て、より優先度の高いマスタAがデータ伝送処理中であ
れば、図10(a)に示すように、マスタAがバス使用
権をそのまま保持してデータ伝送処理を継続し、新規に
要求したマスタBはそのデータ伝送処理が終了する迄待
ってバス使用権を獲得する、逆に、優先度の低いマスタ
Aがデータ伝送処理中であれば、図10(b)に示すよ
うに、マスタAがこのデータ伝送処理を中止してバス使
用権を解放し、新規に要求したマスタBが、バス使用権
を獲得してデータ伝送処理を行ない、マスタBのデータ
伝送処理が終了後にマスタAが再びデータ伝送処理を行
なう、というように各マスタの優先度のみで判断してバ
ス使用権の制御を行なっていた。
2. Description of the Related Art In a programmable controller using a bus connection method, control of a bus use right of a plurality of masters is performed, for example, by a master A during data transmission processing and a master B requesting transmission processing. , B according to the "priority" which determines in principle which should be processed first, if the higher priority master A is performing data transmission processing, as shown in FIG. A keeps the right to use the bus and continues the data transmission process, and the newly requested master B waits until the data transmission process is completed to acquire the right to use the bus. Is in the data transmission process, as shown in FIG. 10B, the master A stops the data transmission process and releases the right to use the bus, and the newly requested master B acquires the right to use the bus. Data Performs transmission processing, the master A data transmission processing after the completion of the master B was performed control of the bus use right determines only the priority of each master and so, again performing data transmission processing.

【0003】[0003]

【発明が解決しようとする課題】従って、ひとつのマス
タAがバスによりデータ伝送処理中に、より優先度の高
いマスタBからバス使用権のリクェストが出ると、デー
タ伝送処理中のマスタAは、たとえ、データ伝送処理終
了間際であっても、データ伝送処理が中止され、優先度
の高いマスタBのデータ伝送処理が終わってから、再び
最初からデータ伝送処理をやり直すことになり、図10
(b)に示すように、処理時間のむだLが生じた。
Therefore, when one master A requests a bus use right from the master B having a higher priority while the master A is performing data transmission processing by the bus, the master A during the data transmission processing becomes: For example, even immediately before the end of the data transmission process, the data transmission process is stopped, and after the data transmission process of the master B having a higher priority is completed, the data transmission process is restarted from the beginning.
As shown in (b), the processing time wasted L.

【0004】また、もし、データ伝送処理中のマスタに
故障が生じて、データ伝送処理終了の信号が出せなくな
った場合は、バス使用権の解放が困難になるという課題
もあった。
[0004] In addition, if a failure occurs in the master during data transmission processing and a signal indicating the end of the data transmission processing cannot be output, it is also difficult to release the right to use the bus.

【0005】この発明は、上述の課題を解決し、データ
の再送による処理時間のむだを減らし、マスタの故障に
対するプログラマブルコントローラの信頼性を高めたプ
ログラマブルコントローラを提供するものである。
An object of the present invention is to provide a programmable controller which solves the above-mentioned problems, reduces processing time due to retransmission of data, and increases the reliability of the programmable controller against a master failure.

【0006】[0006]

【課題を解決するための手段】上述の目的を達成するた
めに、請求項1の発明は、バス結合された複数のマスタ
のバス使用権をバスコントローラが制御するプログラマ
ブルコントローラにおいて、各マスタの優先度、バス占
有時間、許容待ち時間のうち、少なくとも二種の情報
と、現在マスタとして作動している現マスタの優先度、
データ伝送処理残り時間の情報とを基に、現在マスタと
して作動していない次マスタのデータ伝送処理が可能に
なったとき、上記現マスタのデータ伝送処理を継続する
か、上記現マスタのデータ伝送処理を中止して、次マス
タのデータ伝送処理に切り換えるかを判断することを特
徴とする。
SUMMARY OF THE INVENTION In order to achieve the above-mentioned object, a first aspect of the present invention is a programmable controller in which a bus controller controls a bus use right of a plurality of bus-coupled masters. , Bus occupation time, allowable waiting time, at least two types of information, the priority of the current master currently operating as the master,
Based on the information on the remaining time of the data transmission processing, when the data transmission processing of the next master not currently operating as the master becomes possible, the data transmission processing of the current master is continued, or the data transmission of the current master is performed. It is characterized in that it is determined whether to stop the processing and switch to the data transmission processing of the next master.

【0007】請求項2の発明は、請求項1記載の発明に
おいて、現マスタの優先度およびデータ伝送処理残り時
間と、次マスタの優先度および許容待ち時間とをそれぞ
れ比較して上記の判断を行なうことを特徴とする。
According to a second aspect of the present invention, in the first aspect of the invention, the above-mentioned determination is made by comparing the priority of the current master and the remaining time of the data transmission processing with the priority and the allowable waiting time of the next master, respectively. It is characterized by performing.

【0008】請求項3の発明は、請求項2記載の発明に
おいて、次マスタの優先度が現マスタの優先度より高
く、かつ、次マスタの許容待ち時間が現マスタのデータ
伝送処理残り時間よりも小さいときに、現マスタのデー
タ伝送処理を中止して、次マスタのデータ伝送処理に切
り換えることを特徴とする。
According to a third aspect of the present invention, in the second aspect, the priority of the next master is higher than the priority of the current master, and the allowable waiting time of the next master is longer than the remaining time of data transmission processing of the current master. When the value is also smaller, the data transmission processing of the current master is stopped and the processing is switched to the data transmission processing of the next master.

【0009】請求項4の発明は、請求項1記載の発明に
おいて、現マスタのデータ伝送処理残り時間経過情報が
送られてこなくなり、上記データ伝送処理残り時間が減
少しなくなったとき、バス使用権を次マスタに移すこと
を特徴とする。
According to a fourth aspect of the present invention, in the first aspect of the present invention, when the information on the elapsed time of the remaining data transmission processing of the current master is not sent and the remaining time of the data transmission processing does not decrease, the right to use the bus is stopped. Is transferred to the next master.

【0010】請求項5の発明は、バス結合された複数の
マスタのバス使用権をバスコントローラが制御するプロ
グラマブルコントローラにおいて、各マスタのレジスタ
に、該マスタの優先度、バス占有時間、許容待ち時間の
うち、少なくとも二種の情報と、現在マスタとして作動
している現マスタの優先度、データ伝送処理残り時間の
情報を記録し、上記の複数の情報を基に、マスタがバス
使用権リクェスト信号をバスコントローラに送るととも
に、マスタがバスコントローラからバス使用権グラント
信号を受けて現マスタとなったとき、他のマスタに現マ
スタの優先度、バス占有時間を送ることを特徴とする。
According to a fifth aspect of the present invention, in a programmable controller in which a bus controller controls a bus use right of a plurality of bus-coupled masters, a register of each master stores a priority, a bus occupation time, and an allowable waiting time of the master. Of the information, at least two types of information, the priority of the current master currently operating as the master, and information on the remaining time of the data transmission process are recorded. Based on the plurality of pieces of information, the master transmits a bus use right request signal. Is transmitted to the bus controller, and when the master becomes the current master upon receiving a bus use right grant signal from the bus controller, the priority of the current master and the bus occupation time are sent to other masters.

【0011】請求項6の発明は、バス結合された複数の
マスタのバス使用権をバスコントローラが制御するプロ
グラマブルコントローラにおいて、複数のマスタからバ
ス使用権リクェスト信号を受けるバスコントローラが、
上記バス使用権リクェスト信号を発した複数のマスタの
許容待ち時間の小さい順に、上記バス使用権リクェスト
信号を発した複数のマスタに対してバス使用権取得順位
を決めることを特徴とする。
According to a sixth aspect of the present invention, in a programmable controller in which a bus controller controls a bus use right of a plurality of bus-coupled masters, the bus controller receiving a bus use right request signal from the plurality of masters comprises:
The bus use right acquisition order is determined for the plurality of masters that have issued the bus use right request signal in descending order of the allowable waiting time of the plurality of masters that have issued the bus use right request signal.

【0012】請求項7の発明は、請求項5記載の発明に
おいて、上記バス使用権取得順位が、更に、上記バス使
用権リクェスト信号を発した複数のマスタの優先度の高
い順に決められることを特徴とする。
According to a seventh aspect of the present invention, in the fifth aspect of the invention, the bus use right acquisition order is further determined in the descending order of the priority of a plurality of masters that have issued the bus use right request signal. Features.

【0013】請求項8の発明は、請求項5記載の発明に
おいて、上記バス使用権取得順位が、更に、上記バス使
用権リクェスト信号を発した複数のマスタのバス占有時
間の小さい順に決められることを特徴とする。
According to an eighth aspect of the present invention, in the fifth aspect of the present invention, the bus use right acquisition order is further determined in ascending order of the bus occupation time of the plurality of masters that issued the bus use right request signal. It is characterized by.

【0014】この発明における「優先度」とは、マスタ
の伝送処理を行なう際のマスタ間の原則的な優先順を意
味する。「バス占有時間」とは、マスタがデータ伝送処
理するのにバスを占有する時間であって、データ伝送処
理の正味所要時間にほぼ相当する。
The "priority" in the present invention means a priority order in principle between masters when performing transmission processing of masters. The “bus occupation time” is the time during which the master occupies the bus for data transmission processing, and substantially corresponds to the net required time for data transmission processing.

【0015】「許容待ち時間」とは、マスタがデータ伝
送処理を保留して待つことのできる時間である。実際の
許容待ち時間は、そのデータ伝送処理が終わっていない
と次の処理に支障を来たす状態になる時刻からそのデー
タ伝送処理のためのバス占有時間だけ逆上った時刻と、
現在の時刻との差となる。従って、待っている間の時間
経過に伴い、実際の許容待ち時間は減少する。そこでレ
ジスタ内に「許容待ち時間」を記録する場合は、次の2
通りの処理のどちらかを行なう。すなわち、データ伝送
処理を行なえる状態になったとき、レジスタ内の「許容
待ち時間」として、この減少していく実際の許容待ち時
間を用いて、現マスタのデータ伝送処理残り時間と比較
するなどし、実際にデータ伝送処理の実行に移ったら、
次回のデータ伝送処理に備えて、初期値に戻すようにす
るか、または、レジスタ内の「許容待ち時間」は初期値
のまま保持して、作業領域にコピーした許容待ち時間を
待っている間に減少させ、この値を用いて現マスタのデ
ータ伝送処理残り時間と比較するなどするようにする。
The "permissible wait time" is a time during which the master can suspend data transmission processing and wait. The actual allowable waiting time is the time when the data transmission processing is not finished and the time when the next processing is hindered is reversed by the bus occupation time for the data transmission processing,
This is the difference from the current time. Therefore, the actual allowable waiting time decreases as the time elapses while waiting. Therefore, when recording the “allowable waiting time” in the register, the following 2
Perform one of the following processes. That is, when it becomes possible to perform data transmission processing, the actual permissible waiting time, which is decreasing, is used as the "permissible waiting time" in the register and compared with the remaining data transmission processing time of the current master. Then, when actually moving to the data transmission process,
Either return to the initial value for the next data transmission process, or keep the "Allowable wait time" in the register at the initial value and wait for the allowable wait time copied to the work area , And using this value to compare with the data transfer processing remaining time of the current master.

【0016】「次マスタ」とは、現マスタの次にデータ
伝送処理を行なうことになったマスタを意味する。
The "next master" means a master that is to perform data transmission processing next to the current master.

【0017】[0017]

【発明の実施の形態】この発明の実施の形態を、以下、
図面を参照して説明する。
Embodiments of the present invention will be described below.
This will be described with reference to the drawings.

【0018】図1は、この発明の一実施の形態における
各マスタのバス使用権取得条件を説明する説明図であ
る。図1においては、現在データ伝送処理中のマスタA
と伝送準備ができて伝送しようとするマスタBのふたつ
のマスタA、Bを例示している。
FIG. 1 is an explanatory diagram for explaining a bus use right acquisition condition of each master according to an embodiment of the present invention. In FIG. 1, master A is currently performing data transmission processing.
And two masters A and B which are ready to transmit and want to transmit.

【0019】図1の例では、マスタAの優先度Paが、
マスタBの優先度Pbより高いか、等しい場合は、現在
データ伝送処理中のマスタAのデータ伝送処理残り時間
Taとこれから伝送しようとするマスタBの許容待ち時
間WTbとの大小関係に関わりなく、バス使用権を変更
せずに、マスタAのデータ伝送処理を継続し、マスタB
のデータ伝送処理は、マスタAのデータ伝送処理が終了
した後に、バス使用権を譲り受けて、実行する。この点
は、従来のプログラマブルコントローラにおけるバス使
用権制御と同様である。
In the example of FIG. 1, the priority Pa of the master A is
If the priority is higher than or equal to the priority Pb of the master B, regardless of the magnitude relation between the remaining data transmission processing time Ta of the master A currently performing data transmission processing and the allowable waiting time WTb of the master B to be transmitted from now on, Without changing the bus use right, the master A continues the data transmission
After the data transmission process of the master A is completed, the data transfer process is executed by transferring the right to use the bus. This is the same as the bus use right control in the conventional programmable controller.

【0020】マスタAの優先度Paが、マスタBの優先
度Pbより低い場合は、マスタAのデータ伝送処理残り
時間TaとマスタBの許容待ち時間WTbとの関係が、
Ta≦WTbのときは、相対的に残り時間の少ないマス
タAのデータ伝送処理を継続し、Ta>WTbのときの
み、バス使用権をマスタAからマスタBに移して、マス
タAのデータ伝送処理を中止し、マスタBのデータ伝送
処理を割り込ませる。
When the priority Pa of the master A is lower than the priority Pb of the master B, the relationship between the data transmission processing remaining time Ta of the master A and the allowable waiting time WTb of the master B is
When Ta ≦ WTb, the data transmission processing of the master A having a relatively small remaining time is continued, and only when Ta> WTb, the bus use right is transferred from the master A to the master B, and the data transmission processing of the master A is performed. Is stopped, and the data transmission process of the master B is interrupted.

【0021】図2の(a)および(b)は、それぞれ図
1の実施の形態によるバス使用権制御状態例を示すタイ
ミングチャートで、図2(a)は、マスタAの優先度P
aが、マスタBの優先度Pbより低く、マスタBが伝送
できる状態になったときのマスタAのデータ伝送処理残
り時間Taが、そのときのマスタBの許容待ち時間WT
bよりも小さい場合の、バス使用権制御の状態を示して
いる。すなわち、この場合は、マスタAのデータ伝送処
理残り時間Taが比較的少なくなっていて、マスタBは
待てる状態であるから、マスタAの残りのデータ伝送処
理を継続し、その処理が終了すると、直ちにマスタBの
データ伝送処理を行なう。これに対して、従来のバス使
用権制御では、図2(c)に示すように、優先度の高い
マスタBが伝送できる状態になると、直ちにマスタAの
データ伝送処理を中止して、マスタBのデータ伝送処理
を行ない、マスタBのデータ伝送処理が終了した後に、
再びマスタAのデータ伝送処理を最初から行なう。図2
(a)と図2(c)とを比べると明らかなように、この
発明の図2(a)の場合は、再送を行なう従来の図2
(c)の場合よりもTsだけ処理時間が節減できる。
FIGS. 2 (a) and 2 (b) are timing charts each showing an example of a bus use right control state according to the embodiment of FIG. 1. FIG. 2 (a) shows the priority P of the master A.
a is lower than the priority Pb of the master B and the remaining data transmission processing time Ta of the master A when the master B is ready for transmission is the allowable waiting time WT of the master B at that time.
It shows the state of the bus use right control when it is smaller than b. That is, in this case, since the remaining data transmission time Ta of the master A is relatively small and the master B is in a state of waiting, the remaining data transmission processing of the master A is continued, and when the processing is completed, Immediately, the master B performs data transmission processing. On the other hand, in the conventional bus right control, as shown in FIG. 2C, as soon as the master B having the higher priority can transmit, the data transmission process of the master A is stopped and the master B is stopped. After the data transmission processing of the master B is completed,
The data transmission process of the master A is performed again from the beginning. FIG.
As is clear from comparison between FIG. 2A and FIG. 2C, in the case of FIG. 2A of the present invention, the conventional FIG.
The processing time can be saved by Ts as compared with the case (c).

【0022】図2(b)は、図2(a)の場合と同様、
マスタAの優先度Paが、マスタBの優先度Pbより低
く、マスタAのデータ伝送処理残り時間Taが、そのと
きのマスタBの許容待ち時間WTbよりも大きく、マス
タBが待てない場合のデータ伝送処理順を示す。この場
合は、従来と同様、マスタAのデータ伝送処理を中止し
てマスタBのデータ伝送処理を終わらせ、その後にマス
タAのデータ伝送処理を再び始めから行なう。データ再
送のむだはあるが、中止までの時間は少ないから、比較
的むだ時間が少なくて済む。
FIG. 2B is similar to FIG. 2A.
The data when the priority Pa of the master A is lower than the priority Pb of the master B, the data transmission processing remaining time Ta of the master A is longer than the allowable waiting time WTb of the master B at that time, and the master B cannot wait. Indicates the order of transmission processing. In this case, as in the conventional case, the data transmission process of the master A is stopped, the data transmission process of the master B is terminated, and then the data transmission process of the master A is performed again from the beginning. Although there is a waste of data retransmission, the time until cancellation is short, so that relatively little waste time is required.

【0023】図3は、この発明の一実施の形態を示すブ
ロック図である。
FIG. 3 is a block diagram showing an embodiment of the present invention.

【0024】図3において、バス1には、複数のマスタ
A、B、‥‥とバスコントローラ2、更に、図示は省略
するが、メモリ、I/O等の複数のスレーブが結合され
て、バス結合方式のプログラマブルコントローラが形成
されている。
In FIG. 3, a bus 1 is connected to a plurality of masters A, B,... And a bus controller 2, and a plurality of slaves such as memories and I / Os (not shown). A coupling type programmable controller is formed.

【0025】上記バス1は、バスコントローラ2と各マ
スタA、B、‥‥とを結ぶバス使用権要求信号線Bus re
q1、Bus req2、‥‥、バス使用権許可信号線Bus grant
1、Bus grant2‥‥と、バスコントローラ2、複数のマ
スタA、B、‥‥および複数のスレーブの各装置に共通
に接続されるアドレス線Ad、データ線Data等、通常使用
されている線の他に、これらの装置に共通に接続される
データ伝送処理残り時間書き込み信号線CsSetCount、優
先度書き込み信号線CsSetPriority からなっている。図
4は、バス1の以上に説明した信号線等の内容を示して
いる。
The bus 1 includes a bus use right request signal line Bus re, which connects the bus controller 2 and each of the masters A, B,.
q1, Bus req2, ‥‥, Bus use right grant signal line Bus grant
1, Bus grant 2} and commonly used lines such as an address line Ad and a data line Data commonly connected to each device of the bus controller 2, a plurality of masters A, B,. In addition, it comprises a data transmission processing remaining time write signal line CsSetCount and a priority write signal line CsSetPriority commonly connected to these devices. FIG. 4 shows the contents of the signal lines and the like of the bus 1 described above.

【0026】バスコントローラ2は、バス使用権要求信
号線Bus req1、Bus req2、‥‥のバス使用権リクェスト
信号に応じて、バス使用権許可信号線Bus grant1、Bus
grant2‥‥にバス使用権グラント信号を出力する。バス
使用権は、この実施の形態では、一つのマスタにのみ与
えることができるもので、未だバス使用権グラント信号
を出力していないが、バス使用権リクェスト信号を受け
て待機するものができることがある。これらの待機中の
マスタのデータ伝送処理順位を決めるために、バスコン
トローラ2には、待機テーブル2Tを備えている。図5
は、この待機テーブル2Tの内容を例示している。
The bus controller 2 responds to the bus use right request signal of the bus use right request signal lines Bus req1, Bus req2, ‥‥ by using the bus use right grant signal lines Bus grant1, Bus grant.
A bus use right grant signal is output to grant2 ‥‥. In this embodiment, the bus use right can be given to only one master, and the bus use right grant signal has not been output yet, but the one that can receive the bus use right request signal and stand by can be provided. is there. The bus controller 2 is provided with a standby table 2T in order to determine the data transmission processing order of these standby masters. FIG.
Illustrates the contents of the standby table 2T.

【0027】また、各マスタA、B、‥‥には、レジス
タRa、Rb、‥‥があって、これらのレジスタRa、
Rb、‥‥は、各々そのマスタの優先度Pa、Pb、‥
‥を記録する優先度レジスタSetPriorityMine 、そのマ
スタのバス占有時間T0a、T0b、‥‥を記録する占有時
間レジスタSetCountMine、そのマスタの許容待ち時間W
Ta 、WTb 、‥‥を記録する許容待ち時間レジスタSe
tWaitCountと、現在マスタとして作動しているマスタの
優先度Pa(またはPb、‥‥)を記録する現在マスタ
優先度レジスタSetPriority 、現在マスタとして作動し
ている現マスタのデータ伝送処理残り時間Ta 、Tb 、
‥‥を記録する残り時間レジスタSetCountからなってい
る。
Each master A, B,... Has a register Ra, Rb,.
Rb and ‥‥ are the priorities Pa, Pb and ‥ of the master, respectively.
Priority, a priority register SetPriorityMine for recording マ ス タ, a bus occupancy time T0a, T0b of the master, an occupancy time register SetCountMine for recording ‥‥, an allowable waiting time W of the master
Allowable waiting time register Se for recording Ta, WTb, ‥‥
A current master priority register SetPriority for recording tWaitCount and the priority Pa (or Pb, ‥‥) of the master currently operating as the master, and remaining data transmission processing times Ta and Tb of the current master currently operating as the master. ,
It consists of the remaining time register SetCount for recording ‥‥.

【0028】図6は、以上に説明したレジスタRa、R
b、‥‥の内容を示している。すなわち、優先度レジス
タSetPriorityMine 、占有時間レジスタSetCountMineお
よび許容待ち時間レジスタSetWaitCountの内容は、各マ
スタ毎に異なる。現在マスタ優先度レジスタSetPriorit
y と残り時間レジスタSetCountとは、後に説明するよう
に、全てのマスタが常に共通の値を保持する。
FIG. 6 shows the registers Ra and R described above.
The contents of b and ‥‥ are shown. That is, the contents of the priority register SetPriorityMine, the occupation time register SetCountMine, and the allowable waiting time register SetWaitCount are different for each master. Current master priority register SetPriorit
As described later, y and the remaining time register SetCount always hold a common value for all masters.

【0029】そして、各マスタA、B、‥‥は、その内
部の処理を終わってデータ伝送処理が可能になると、そ
のマスタのレジスタRa、Rb‥‥に記録されている優
先度レジスタSetPriorityMine 、占有時間レジスタSetC
ountMine、許容待ち時間レジスタSetWaitCount、現在マ
スタ優先度レジスタSetPriority および残り時間レジス
タSetCountの値を基に、バス使用権を要求するのが適当
であると判断したとき、マスタがバス使用権リクェスト
信号をバス使用権要求信号線Bus req を介してバスコン
トローラ2に送り、バスコントローラ2は、他のマスタ
の状況、例えば、既に他のマスタがバス使用権リクェス
ト信号を発してバス使用権グラント信号を待っている等
の状況と併せてこれを判断して、支障がなければ、バス
使用権グラント信号を、バス使用権許可信号線Bus gran
t を介して、バス使用権リクェスト信号を発したマスタ
に送る。
When each of the masters A, B,... Has completed its internal processing and is ready for data transmission, the priority registers SetPriorityMine recorded in the registers Ra, Rb # of the masters A, B,. Time register SetC
When the master determines that it is appropriate to request the bus use right based on the values of ountMine, the allowable wait time register SetWaitCount, the current master priority register SetPriority and the remaining time register SetCount, the master sends the bus use right request signal to the bus. The request is sent to the bus controller 2 via the bus request signal line Bus req, and the bus controller 2 waits for the status of another master, for example, when another master has already issued a bus use right request signal and waited for a bus use right grant signal. If there is no problem, the bus use right grant signal is sent to the bus use permission signal line Bus gran
via t to the master that issued the bus right request signal.

【0030】バス使用権グラント信号を受けたマスタ
は、直ちに、他のマスタに、優先度レジスタSetPriorit
yMine に記録した自己のマスタの優先度と、占有時間レ
ジスタSetCountMineに記録した自己のマスタのデータ伝
送処理時間を送って、作動中となるマスタの優先度、デ
ータ伝送処理時間を通知する。作動中のマスタの優先度
は、他の全てのマスタの「現在マスタ優先度レジスタSe
tPriority 」に書き込まれ、データ伝送処理時間は、他
の全てのマスタの「残り時間レジスタSetCount」に書き
込まれて、データ伝送処理残り時間として使用される。
作動中の現マスタの優先度はその変更がないが、データ
伝送処理残り時間は、データ伝送処理の進行とともに減
少する。そこで、データ伝送処理の進行につれて、作動
中のマスタは、適時、そのデータ伝送処理残り時間を他
の全てのマスタに通知して、その「残り時間レジスタSe
tCount」に上書きさせる。
The master that has received the bus use right grant signal immediately notifies the other masters of the priority register SetPriorit.
The priority of its own master recorded in yMine and the data transmission processing time of its own master recorded in the occupation time register SetCountMine are sent to notify the priority of the active master and the data transmission processing time. The priority of the active master is stored in the “Current Master Priority Register Se” of all other masters.
tPriority ", and the data transmission processing time is written into the" remaining time register SetCount "of all other masters, and is used as the data transmission processing remaining time.
Although the priority of the active current master does not change, the remaining time of the data transmission process decreases as the data transmission process progresses. Therefore, as the data transmission process progresses, the operating master notifies the other masters of the remaining time of the data transmission process timely in a timely manner.
tCount ”.

【0031】次に、図3で説明したバス結合方式のプロ
グラマブルコントローラが、図1に示したバス使用権制
御アルゴリズムに従って、データ伝送処理を行なう際の
処理フローを図7および図8を参照して説明する。図7
は、マスタA、B、‥‥の処理フローを示すフローチャ
ート、図8は、バスコントローラ2の処理フローを示す
フローチャートで、マスタA、B、‥‥とバスコントロ
ーラ2は互いの処理結果に応じて処理が進められる。
Next, the processing flow when the programmable controller of the bus connection system described in FIG. 3 performs the data transmission processing in accordance with the bus use right control algorithm shown in FIG. 1 will be described with reference to FIGS. 7 and 8. explain. FIG.
Is a flowchart showing the processing flow of the masters A, B, and 、. FIG. 8 is a flowchart showing the processing flow of the bus controller 2, and the masters A, B, and ‥‥ and the bus controller 2 respond to each other's processing results. Processing proceeds.

【0032】先ず、各マスタA、B、‥‥のうちの、例
えば、マスタNでは、図7のフローに従って、レジスタ
Rnに関する処理が進められる。ステップ701では、
マスタ内での処理が終了して、その結果のデ−タをバス
を使用して伝送できる状態か否かを調べる。デ−タを伝
送できる状態になる(yes)と、ステップ702に進
み、当該マスタのレジスタRnの優先度レジスタSetPri
orityMine に記録されている自らの優先度Pn、許容待
ち時間レジスタSetWaitCountに記録されている許容待ち
時間WTn 、および、許容エラー回数WECnを作業領
域にコピーする。上記許容エラー回数WECnは、作動
中の現マスタに故障が発生して、データ伝送処理残り時
間が減少しなくなったとき、次マスタにバス使用権を移
すために使用する定数で、マスタ毎に異なる値を設定し
ておくこともできる。
First, among the masters A, B,..., For example, the master N proceeds with the processing related to the register Rn according to the flow of FIG. In step 701,
After the processing in the master is completed, it is checked whether or not the resulting data can be transmitted using the bus. When data can be transmitted (yes), the process proceeds to step 702, where the priority register SetPri of the register Rn of the master is set.
The own priority Pn recorded in orityMine, the allowable wait time WTn recorded in the allowable wait time register SetWaitCount, and the allowable error count WECn are copied to the work area. The allowable error count WECn is a constant used for transferring the bus use right to the next master when a failure occurs in the active current master and the remaining time of the data transmission processing does not decrease, and differs for each master. You can also set a value.

【0033】次のステップ703では、エラーカウンタ
ECを0にクリアする。このエラーカウンタECは、デ
ータ伝送処理残り時間が減少しなくなったときに加算す
るカウンタである。
In the next step 703, the error counter EC is cleared to zero. The error counter EC is a counter that is added when the remaining time of the data transmission processing does not decrease.

【0034】ステップ704では、作業領域のデータ伝
送処理残り時間Tm を前回残り時間TOm にコピーす
る。
At step 704, the data transmission processing remaining time Tm of the work area is copied to the previous remaining time TOm.

【0035】次いで、ステップ705で、残り時間レジ
スタSetCountに記録されているデータ伝送処理残り時間
Tm を作業領域に上書き各コピーする。この作業領域の
データ伝送処理残り時間Tm は、後に説明するように、
データ伝送処理の進行に伴い刻々と減少するものであ
る。
Next, in step 705, the data transmission processing remaining time Tm recorded in the remaining time register SetCount is overwritten on the work area and copied. The data transmission processing remaining time Tm of the work area is, as described later,
It decreases every moment as the data transmission process progresses.

【0036】次のステップ706では、このデータ伝送
処理残り時間Tm が0であるか否かが調べられる。0で
あれば(yes)、現在データ伝送処理が行なわれてお
らず、バスが空き状態であることを示すのだから、その
マスタNからバス使用権リクェスト信号Bus req n をバ
スコントローラ2に送るステップ715へ直接進む。逆
に、0でなければ(no)、現在データ伝送処理が行な
われているのだから、自らのデータ伝送処理を保留し
て、現在のデータ伝送処理を継続するのか、現在のデー
タ伝送処理を中止して、自らのデータ伝送処理を優先し
て割り込むかを決定するステップ707以降のプロセス
に入る。
In the next step 706, it is checked whether or not the data transmission processing remaining time Tm is zero. If it is 0 (yes), it indicates that the data transmission process is not currently being performed and the bus is in an idle state, so that the master N sends a bus use right request signal Bus req n to the bus controller 2. Proceed directly to 715. Conversely, if it is not 0 (no), since the data transmission process is currently being performed, the data transmission process is suspended, and the current data transmission process is continued or the current data transmission process is stopped. Then, the process proceeds to step 707 and subsequent steps for determining whether to interrupt the data transmission process by itself.

【0037】ステップ707では、残り時間Tm と前回
残り時間TOm とを比較し、一致しなければ(no)、
現マスタのデータ伝送処理が前回よりも正常に進行して
いるのであるから、ステップ708に移って、エラーカ
ウンタECを0にクリアし、ステップ711に進む。
In step 707, the remaining time Tm is compared with the previous remaining time TOm, and if they do not match (no),
Since the data transmission process of the current master is proceeding more normally than the previous time, the process proceeds to step 708, where the error counter EC is cleared to 0, and the process proceeds to step 711.

【0038】ステップ707で、Tm =TOm と一致し
た場合(yes)は、ステップ709に移って、エラー
カウンタECを1だけカウントアップし、次のステップ
710で、このエラーカウンタECの値と許容エラー回
数WECnとを比較する。
If it is determined in step 707 that Tm = TOm (yes), the process proceeds to step 709, where the error counter EC is incremented by one. In the next step 710, the value of the error counter EC and the allowable error are set. The number of times WECn is compared.

【0039】ステップ710において、EC>WECn
となれば(yes)、残り時間Tmが減少しないサイク
ルが許容回数を越えたのであるから、現マスタMの処理
を打ち切ることとして、マスタNからバス使用権リクェ
スト信号Bus req n をバスコントローラ2に送るステッ
プ715へ進む。ステップ710で、未だEC>WEC
nとなっていなければ(no)、ステップ711に進
む。なお、後に説明するステップ712を経て、ステッ
プ704〜707の繰り返しサイクルに入り、Tm ≠T
Om となった場合には、現マスタMの処理が続行された
ことになり、上述のステップ708でエラーカウンタE
Cを0にするのである。
In step 710, EC> WECn
If (yes), since the number of cycles in which the remaining time Tm does not decrease exceeds the allowable number, the processing of the current master M is terminated, and the master N sends the bus use right request signal Bus req n to the bus controller 2. Proceed to step 715 for sending. In step 710, EC> WEC is still
If n is not reached (no), the process proceeds to step 711. In addition, after step 712 to be described later, a repetition cycle of steps 704 to 707 is entered, and Tm ≠ T
If it becomes Om, it means that the processing of the current master M has been continued, and the error counter E
C is set to 0.

【0040】ステップ711では、現在伝送処理中の優
先度Pmを現在マスタ優先度レジスタSetPriority から
作業領域にコピーする。次のステップ712で、この現
在データ伝送処理中の優先度Pmと、先にコピーした自
らの優先度Pnとを比較し、Pm<Pn(yes)であ
れば、更に次のステップ713に進む。Pm≧Pn(n
o)であれば、ステップ704に戻って、前回読み取っ
た残り時間Tm を前回残り時間TOm にコピーし、その
先のステップに進む。そして、ステップ706またはス
テップ710の条件を満たすと、ステップ715に進
む。
In step 711, the priority Pm currently being transmitted is copied from the current master priority register SetPriority to the work area. In the next step 712, the priority Pm during the current data transmission process is compared with the own priority Pn copied earlier, and if Pm <Pn (yes), the process proceeds to the next step 713. Pm ≧ Pn (n
If o), the process returns to step 704 to copy the previously read remaining time Tm to the last remaining time TOm, and proceeds to the subsequent step. When the condition of step 706 or step 710 is satisfied, the process proceeds to step 715.

【0041】ステップ713では、現在データ伝送処理
中のデータ伝送処理残り時間Tm を再び残り時間レジス
タSetCountから作業領域にコピーする。そして、次のス
テップ714で、残り時間Tm と先にコピーした自らの
許容待ち時間WTn を比較する。Tm >WTn であれば
(yes)、自らのデータ伝送処理が待てない状態であ
るのだから、バス使用権リクェスト信号Bus req を発す
るために、ステップ715に移る。Tm ≦WTn であれ
ば(no)、待てる状態であるから、ステップ716を
経て、ステップ713に戻る。ステップ716では、作
業領域にコピーされた許容待ち時間WTn を経過時間だ
け補正する。すなわち、前回ステップ713に至った時
刻と今回ステップ713に至る時刻との差を許容待ち時
間WTnから減じて、許容待ち時間WTn の値を減ら
す。
In step 713, the data transmission processing remaining time Tm currently being processed for data transmission is copied from the remaining time register SetCount to the work area again. Then, in the next step 714, the remaining time Tm is compared with its own allowable waiting time WTn copied earlier. If Tm> WTn (yes), the process goes to step 715 in order to issue a bus request request signal Bus req, since the data transmission process cannot wait. If Tm ≦ WTn (no), the process returns to step 713 via step 716 because it is ready to wait. In step 716, the allowable waiting time WTn copied to the work area is corrected by the elapsed time. That is, the difference between the time when the previous step 713 is reached and the time when the current step 713 is reached is subtracted from the allowable waiting time WTn, and the value of the allowable waiting time WTn is reduced.

【0042】もし、現マスタに故障が発生して、残り時
間Tm の時間経過情報が送られてこなくなり、残り時間
Tm が減少しなくなった場合は、Pm≧Pnならば、ス
テップ710で、また、Pm<Pnで、やがてTm >W
Tn となって、ステップ714で、いずれも、ステップ
715に進み、現マスタの故障に係わらず、バス使用権
を現マスタから次マスタに移プログラマブルコントロー
ラの処理は先に進められる。
If the current master fails and the elapsed time information of the remaining time Tm is not sent and the remaining time Tm does not decrease, if Pm ≧ Pn, then at step 710, Pm <Pn, then Tm> W
In step 714, the process proceeds to step 715, and the bus use right is transferred from the current master to the next master, regardless of the failure of the current master, and the processing of the programmable controller is advanced.

【0043】ステップ715に達した場合は、そのマス
タNのレジスタ情報から判断する限り、バス使用権リク
ェスト信号Bus req n を発してよい状況である。そこ
で、ステップ715以降は、バスコントローラ2の制御
に応じて処理を進めることになる。
When the processing reaches step 715, the bus use right request signal Bus req n may be issued as long as it is determined from the register information of the master N. Therefore, the processing after step 715 proceeds according to the control of the bus controller 2.

【0044】先ず、ステップ715で、バスコントロー
ラ2に対してバス使用権リクェスト信号Bus req n を発
する。バスコントローラ2においては、後に図8で詳細
に説明するように、全マスタから送られてくるバス使用
権リクェスト信号Bus req nと、それまでに待機させて
いるバス使用権リクェスト、現在進行中のデータ伝送処
理を勘案して、マスタに対してBus grant n 信号を発す
るから、次のステップ717でこのBus grant n 信号を
読み取る。ステップ718で、Bus grant n 信号があれ
ば(yes)、ステップ719以降のデータ伝送処理を
開始する。Busgrant n 信号が来ていなければ(n
o)、ステップ717に戻り、Bus grant n信号の読み
取りを繰り返して、Bus grant n 信号を待つ。
First, at step 715, a bus use right request signal Bus req n is issued to the bus controller 2. In the bus controller 2, as will be described later in detail with reference to FIG. 8, a bus request request signal Bus req n sent from all masters, a bus request In consideration of data transmission processing, a Bus grant n signal is issued to the master, so that the next step 717 reads this Bus grant n signal. If there is a Bus grant n signal in step 718 (yes), the data transmission process starting from step 719 is started. If no Busgrant n signal is present (n
o), returning to step 717 to repeatedly read the Bus grant n signal and wait for the Bus grant n signal.

【0045】Bus grant n 信号データを受けて伝送処理
を開始するに当たり、ステップ719では、自らの優先
度Pnを全てのマスタのレジスタRa、Rb‥‥に送
り、その現在マスタ優先度レジスタSetPriority に書き
込ませる。
Upon starting the transmission process in response to the Bus grant n signal data, in step 719, its own priority Pn is sent to the registers Ra, Rb # of all masters, and is written to the current master priority register SetPriority. Let

【0046】続いて、ステップ720で、自らのバス占
有時間T0nを全てのマスタのレジスタRa、Rb‥‥に
送り、残り時間Tnとして、その残り時間レジスタSetC
ountに書き込ませる。これらの優先度Pn、残り時間T
nは、各マスタが、その内部処理を終わってデータ伝送
が可能になったとき、上述のステップ702からステッ
プ715へのプロセスにおいて使用されるものである。
なお、残り時間Tnは、以下の説明から理解されるよう
に、データ伝送処理の進行に伴い書き換えられ、減少し
ていく。
Subsequently, at step 720, the own bus occupation time T0n is sent to all the master registers Ra, Rb #, and the remaining time Tn is set as the remaining time Tn.
Make ount write. These priorities Pn and remaining time T
n is used in the above-described process from step 702 to step 715 when each master has completed its internal processing and is ready for data transmission.
As will be understood from the following description, the remaining time Tn is rewritten and decreases with the progress of the data transmission process.

【0047】ステップ720の次は、ステップ721に
進む。このステップ721では、データ伝送処理が終了
したか否か(終了は残り時間Tn=0)を判断され、終
了していれば(yes)、図7のフローを完了する。初
回このステップ721を通過する時は、通常、データ伝
送処理は終了していない(no)から、次のステップ7
22に進み、データ伝送処理を適宜の単位量行なう。
After step 720, the process proceeds to step 721. In this step 721, it is determined whether or not the data transmission processing has ended (the end is the remaining time Tn = 0). If the processing has ended (yes), the flow of FIG. 7 is completed. When the process goes through this step 721 for the first time, the data transmission process is usually not completed (no), so the next step 7
Proceeding to 22, the data transmission process is performed in an appropriate unit amount.

【0048】データ伝送処理中に、他のマスタがより緊
急なデータ伝送を必要とし、バスコントローラ2が、バ
ス使用権をその緊急のマスタに引き渡そうとすることが
ある。従って、ステップ722では、全部のデータ伝送
を一気に済ますことなく、ステップ723に移って、再
びBus grant n 信号を読み、次のステップ724で、自
らに対するBus grant n 信号が維持されているか否かを
調べる。維持されていれば(yes)、ステップ720
に戻って、残り時間を全マスタのレジスタRの残り時間
レジスタSetCountに書き込ませ、ステップ721で、残
り時間が0でなければ、ステップ722でデータ伝送処
理を続行する。
During the data transmission process, another master may require a more urgent data transmission, and the bus controller 2 may attempt to transfer the right to use the bus to the urgent master. Accordingly, in step 722, the process proceeds to step 723 without reading all the data transmission at once, and again reads the Bus grant n signal. In the next step 724, it is determined whether or not the Bus grant n signal for itself is maintained. Find out. If yes (yes), step 720
Then, the remaining time is written to the remaining time register SetCount of the registers R of all masters. If the remaining time is not 0 in step 721, the data transmission process is continued in step 722.

【0049】ステップ724で、もし、Bus grant n 信
号がクリアされていれば(no)、データ伝送処理を中
止して、通常、他のマスタにバス使用権を引き渡すので
あるから、マスタNは未処理として、ステップ725に
おいて、そのマスタNの優先度Pn、バス占有時間T0
n、許容待ち時間WTn を、それぞれ、優先度レジスタS
etPriorityMine 、占有時間レジスタSetCountMine、許
容待ち時間レジスタSetWaitCountから読み出し、バスコ
ントローラ2に送って、後に説明する待機テーブル2T
に追記させ、その後、図7のフローを完了する。
In step 724, if the Bus grant n signal has been cleared (no), the data transmission process is stopped and the right to use the bus is usually handed over to another master. As processing, in step 725, the priority Pn of the master N and the bus occupation time T0
n and the allowable waiting time WTn in the priority register S, respectively.
etPriorityMine, occupancy time register SetCountMine, allowable wait time register SetWaitCount, read out and send to bus controller 2, wait table 2T described later
, And then the flow of FIG. 7 is completed.

【0050】なお、図7のフローチャートのステップ7
16における時間経過に伴う許容待ち時間の減算は、作
業領域で行っているが、許容待ち時間レジスタSetWaitC
ountの値を直接減算し、ステップ715以降で初期値に
戻すようにしてもよい。
Step 7 in the flowchart of FIG.
The subtraction of the allowable waiting time with the passage of time in 16 is performed in the work area, but the allowable waiting time register SetWaitC
The value of “unt” may be directly subtracted and returned to the initial value after step 715.

【0051】また、ステップ715に至るまでのアルゴ
リズムは、他にも変形が可能であり、例えば、バス占有
時間、許容待ち時間、現マスタの優先度、データ伝送処
理残り時間の情報を使用する、あるいは、優先度、バス
占有時間、現マスタの優先度、データ伝送処理残り時間
の情報を使用する、等が可能である。
The algorithm up to step 715 can be modified in other ways, for example, using information on the bus occupation time, the allowable waiting time, the priority of the current master, and the remaining time of the data transmission process. Alternatively, it is possible to use information on the priority, the bus occupation time, the priority of the current master, and the remaining time of the data transmission process.

【0052】次に、以上のマスタの処理フローに対応す
るバスコントローラ2の処理フローを、図8を参照して
説明する。
Next, a processing flow of the bus controller 2 corresponding to the above processing flow of the master will be described with reference to FIG.

【0053】バスコントローラ2では、所定のサイクル
で、ステップ801からフローを開始する。ステップ8
01では、全部のマスタのバス使用権リクェスト信号線
を順次調べて、次のステップ802で、バス使用権リク
ェスト信号Bus req 1 、Busreq 2、‥‥があるか否かを
判断する。全くなければ(no)、このフローを完了す
るが、ひとつでもあれば(yes)、ステップ803に
移って、バス使用権リクェスト信号Bus req を発した全
てのマスタのレジスタRから、優先度レジスタSetPrior
ityMine に記録されている優先度P、占有時間レジスタ
SetCountMineに記録されているバス占有時間T0 、許容
待ち時間レジスタSetWaitCountに記録されている許容待
ち時間WTを読み出し、マスタ毎に、待機テーブル2T
に追記していく。なお、許容できる待ち時間は、待機し
ている間に時間経過とともに減少するわけであるから、
この待機テーブル2Tの許容待ち時間WTも、時間経過
とともに減算していくことが好ましい。
The bus controller 2 starts the flow from step 801 in a predetermined cycle. Step 8
In step 01, the bus use right request signal lines of all masters are checked sequentially, and in the next step 802, it is determined whether or not there are bus use right request signals Bus req 1, Busreq 2,. If no (no), this flow is completed, but if there is at least one (yes), the process moves to step 803, and the priority register SetPrior is set from the registers R of all masters that have issued the bus request signal Bus req.
Priority P, occupation time register recorded in ityMine
The bus occupation time T0 recorded in SetCountMine and the allowable wait time WT recorded in the allowable wait time register SetWaitCount are read, and the standby table 2T is set for each master.
Will be added to. Note that the acceptable waiting time decreases with time while waiting,
It is preferable that the allowable waiting time WT of the waiting table 2T is also subtracted as time elapses.

【0054】次に、ステップ804で、上記待機テーブ
ル2T上で優先度P、バス占有時間T0n、許容待ち時間
WTからデータ伝送処理順を決定する。例えば、待機テ
ーブル2Tのマスタを、上許容待ち時間WTが小のもの
から順に、次に、優先度Pを高いものから順に、最後
に、バス占有時間T0 が小のものから順にソートして、
ソート結果の上から順のデータ伝送処理順とする。な
お、この順位付は、種々変形が可能で、容待ち時間WT
の小さい順でけで順位付けして、同一の容待ち時間WT
のものがあれば、バス使用権リクェスト信号Bus req の
検知順に処理してもよく、更に、その中から優先度Pの
高い順に順位付けし、あるいは、更に、バス占有時間T
0 の小さい順に順位付けしてもよい。
Next, in step 804, the order of data transmission processing is determined on the standby table 2T from the priority P, the bus occupation time T0n, and the allowable wait time WT. For example, the masters in the standby table 2T are sorted in ascending order of waiting time WT, in descending order of priority P, and finally in order of decreasing bus occupation time T0.
The data transmission processing order is from the top of the sorting result. Note that this ranking can be variously modified, and the waiting time WT
The same waiting time WT
If there is any, the request may be processed in the detection order of the bus use right request signal Bus req, and the bus request signal may be processed in the order of higher priority P, or the bus occupation time T
You may rank them in ascending order of 0.

【0055】次に、ステップ805で、全部のマスタの
バス使用権グラント信号線を順次調べて、次のステップ
806で、バス使用権グラント信号Bus grant1、Bus gr
ant2、‥‥があるか否かを判断する。いずれのバス使用
権グラント信号線にもバス使用権グラント信号がなけれ
ば(no)、ステップ807に移って、待機テーブル2
Tの中の最優先のマスタn1のバス使用権グラント信号
線に、バス使用権グラント信号Bus grant n1を出力し、
同時に、待機テーブル2Tのマスタn1を削除して、図
8のフローを完了する。
Next, at step 805, the bus use right grant signal lines of all masters are sequentially examined, and at the next step 806, the bus use right grant signals Bus grant1, Bus gr
It is determined whether there is ant2, ‥‥. If there is no bus use right grant signal on any of the bus use right grant signal lines (no), the process proceeds to step 807 and the standby table 2
A bus use right grant signal Bus grant n1 is output to the bus use right grant signal line of the highest priority master n1 in T,
At the same time, the master n1 in the standby table 2T is deleted, and the flow of FIG. 8 is completed.

【0056】ステップ806において、もし、いずれか
のバス使用権グラント信号Bus grant m があれば(ye
s)、このマスタMのバス使用権を解除して、マスタn
1にバス使用権を許可しなければならないのであるか
ら、ステップ808に移って、マスタMのバス使用権グ
ラント信号Bus grant m をクリアし、また、全部のマス
タのレジスタRの現在マスタ優先度レジスタSetPriorit
y をクリアし、残り時間レジスタSetCountを0にする。
その後、ステップ807に移る。
In step 806, if there is any bus use right grant signal Bus grant m (yes)
s), release the right to use the bus of this master M, and
Since the bus use right has to be granted to the master 1, the process goes to step 808 to clear the bus grant right signal Bus grant m of the master M, and to execute the current master priority register of the registers R of all masters. SetPriorit
Clear y and set the remaining time register SetCount to 0.
After that, it moves to step 807.

【0057】上記のステップ807におけるバス使用権
グラント信号Bus grant n1出力は、上述の図7のステッ
プ717において、マスタn1側で検知され、そのマス
タn1はデータ伝送処理を開始する。
The output of the bus use right grant signal Bus grant n1 in step 807 is detected by the master n1 in step 717 in FIG. 7 described above, and the master n1 starts data transmission processing.

【0058】上記のステップ808における現在バス使
用権グラント信号Bus grant m のクリアは、上述の図7
のステップ723において、現マスタM側で検知され、
そのマスタMはデータ伝送処理を中止する。
The clearing of the current bus use right grant signal Bus grant m in the above step 808 is performed in the manner shown in FIG.
In step 723, the current master M detects
The master M stops the data transmission process.

【0059】以上の図7および図8のフローに従い、プ
ログラマブルコントローラのバス使用権が制御されて、
再送のむだが少なく、優先順位にしたがって、効率よく
各マスタのデータ伝送処理が進められる。図7および図
8のフローチャートから明らかなように、このように制
御されると、図2により説明したマスタ数が2の場合に
限らず、マスタ数が3以上ある場合も、同様の作用効果
を発揮する。
According to the flow of FIGS. 7 and 8, the right to use the bus of the programmable controller is controlled.
The data transmission process of each master is efficiently advanced in accordance with the priority order with little retransmission. As is clear from the flowcharts of FIGS. 7 and 8, when the control is performed in this manner, the same operation and effect can be obtained not only when the number of masters described with reference to FIG. Demonstrate.

【0060】上述の実施の形態では、バスコントローラ
2に待機テーブル2Tを用い、バス使用権要求中のデー
タをここに蓄積しているが、この待機テーブル2Tを用
いずに、バス使用権要求中はバス使用権要求信号Bus re
q を消去せずに維持して、ステップ802で、これらの
バス使用権要求信号Bus req を全て読み出し、読み出し
た全バス使用権要求信号Bus req の中からステップ80
4で、最優先のマスタを選択するようにしてもよい。
In the above-described embodiment, the bus controller 2 uses the standby table 2T to store the data for which the bus use right is requested. Is the bus request signal Bus re
In step 802, all of these bus use right request signals Bus req are read out, and in step 802, all the bus use right request signals Bus req are read out.
In step 4, the highest-priority master may be selected.

【0061】図9は、図2と異なる場合の処理状態、す
なわち、マスタAがデータ伝送処理中に、マスタAより
も優先度の高いマスタBと、このマスタBよりも更に優
先度の高いマスタCとが順次データ伝送できる状態にな
った場合の処理状態の例を示す。
FIG. 9 shows a processing state different from that of FIG. 2, that is, a master B having a higher priority than the master A and a master B having a higher priority than the master B during the data transmission processing. 7 shows an example of a processing state in a case where C and C can sequentially transmit data.

【0062】図9(a)は、この発明の実施の形態にお
ける処理状態を、図9(b)は、従来の処理状態を示し
ている。マスタBが伝送可能となった時点で、マスタA
のデータ伝送処理は未だ1/3程度しか終わっていない
けれども、マスタAのデータ伝送処理残り時間Ta<マ
スタBの許容待ち時間WTbであり、図9(a)におい
ては、マスタAのデータ伝送処理を継続して、マスタB
はその間待機している。これに対し、従来の図9(b)
では、マスタAのデータ伝送処理を中止し、マスタBの
データ伝送処理を行なう。
FIG. 9A shows a processing state in the embodiment of the present invention, and FIG. 9B shows a conventional processing state. When master B becomes available for transmission, master A
9A, the remaining time Ta of the data transmission processing of the master A is smaller than the allowable waiting time WTb of the master B, and in FIG. 9A, the data transmission processing of the master A is performed. And master B
Is waiting in the meantime. In contrast, FIG.
Then, the data transmission process of the master A is stopped, and the data transmission process of the master B is performed.

【0063】図9(a)において、マスタAのデータ伝
送処理が終了するとき、次のマスタCがデータ伝送でき
る状態になり、優先度がマスタBよりも高いマスタCの
データ伝送処理がマスタBのデータ伝送処理よりも先に
行なわれる。これに対し、従来の図9(b)では、マス
タBのデータ伝送処理を中止し、マスタCのデータ伝送
処理を行なう。
In FIG. 9A, when the data transmission process of the master A is completed, the next master C is ready for data transmission, and the data transmission process of the master C having a higher priority than the master B is performed by the master B. Is performed prior to the data transmission processing. On the other hand, in FIG. 9B, the data transmission process of the master B is stopped and the data transmission process of the master C is performed.

【0064】図9(a)において、マスタCのデータ伝
送処理が終了したとき、ようやくマスタBのデータ伝送
処理が行なわれる。所要時間は、マスタAの処理時間+
マスタCの処理時間+マスタBの処理時間となり、この
場合は、再送のむだが全くない。これに対し、従来の図
9(b)では、マスタCのデータ伝送処理が終了する
と、次に優先度の高いマスタBの再送処理が行なわれ、
その後に、マスタAの再送処理が行なわれる。
In FIG. 9A, when the data transmission process of the master C is completed, the data transmission process of the master B is finally performed. The required time is the processing time of master A +
The processing time of the master C is equal to the processing time of the master B. In this case, there is no need for retransmission. On the other hand, in FIG. 9B, when the data transmission process of the master C is completed, the retransmission process of the master B having the next highest priority is performed.
Thereafter, retransmission processing of master A is performed.

【0065】図9から明らかなように、この発明による
場合は、従来よりもTsだけ処理時間が節減される。
As is apparent from FIG. 9, in the case of the present invention, the processing time is reduced by Ts as compared with the conventional case.

【0066】なお、上述の実施の形態では、各マスタの
レジスタに、そのマスタの優先度Pa、Pb、‥‥、そ
のマスタのバス占有時間T0a、T0b、‥‥、そのマスタ
の許容待ち時間WTa 、WTb 、‥‥、現在マスタとし
て作動しているマスタの優先度Pa(またはPb、‥
‥)、現在マスタとして作動しているマスタのデータ伝
送処理残り時間Ta 、Tb 、‥‥を記録して、これを基
にバス使用権の移動を判断しているが、この発明は、こ
れに限定されず、例えば、バスコントローラにこれらの
データを記録し、データ伝送処理が可能となったマスタ
は、直ちにバス使用権リクェスト信号を発して、このバ
ス使用権リクェスト信号とバスコントローラの上記デー
タを基に、同様のアルゴリズムでバス使用権の制御をす
るようにしてもよい。
In the above-described embodiment, the priority of the master Pa, Pb,..., The bus occupation time T0a, T0b,. , WTb, ‥‥, the priority Pa (or Pb, ‥) of the master currently operating as the master.
Ii), the remaining data transmission processing time Ta, Tb, の of the master currently operating as the master is recorded, and the transfer of the bus use right is determined based on this. For example, the master that records these data in the bus controller and can perform the data transmission process immediately issues a bus use right request signal, and transmits the bus use right request signal and the data of the bus controller. Based on this, the right to use the bus may be controlled by a similar algorithm.

【0067】[0067]

【発明の効果】以上の説明から理解されるように、この
発明によれば、各マスタの優先度、バス占有時間、許容
待ち時間のうち、少なくとも二種の情報と、現在マスタ
として作動している現マスタの優先度、データ伝送処理
残り時間の情報とを基に、現在マスタとして作動してい
ない次マスタのデータ伝送処理が可能になったとき、上
記現マスタのデータ伝送処理を継続するか、上記現マス
タのデータ伝送処理を中止して、次マスタのデータ伝送
処理に切り換えるかを判断するようにしたから、優先度
のみによるバス使用権調整の場合に発生する無益な処理
中止、重複再送の時間を減少させ、プログラマブルコン
トローラの処理効率を向上することができる。
As will be understood from the above description, according to the present invention, at least two types of information among the priority of each master, the bus occupation time, and the permissible waiting time, and the current operation of the master. Based on the priority of the current master and the information on the remaining time of the data transmission processing, when the data transmission processing of the next master not currently operating as the master becomes possible, whether to continue the data transmission processing of the current master Since the data transmission processing of the current master is stopped and it is determined whether to switch to the data transmission processing of the next master, useless processing stoppage and duplicate retransmission that occur in the case of bus right adjustment only based on the priority are performed. And the processing efficiency of the programmable controller can be improved.

【0068】また、各マスタのレジスタに、該マスタの
優先度、バス占有時間、許容待ち時間のうち、少なくと
も二種の情報と、現在マスタとして作動している現マス
タの優先度、データ伝送処理残り時間の情報を記録し、
これらを基に、マスタがバス使用権リクェスト信号をバ
スコントローラに送るとともに、マスタがバスコントロ
ーラからバス使用権グラント信号を受けたとき、他のマ
スタに自己のマスタの優先度、データ伝送処理時間を送
るようにすれば、マスタ自体でバス使用権要求の適否が
判断され、処理が複雑になりがちなバスコントローラの
負担が軽減され、プログラマブルコントローラの処理効
率を一層向上する。
In the register of each master, at least two kinds of information of the priority of the master, the bus occupation time, and the allowable waiting time, the priority of the current master currently operating as the master, and the data transmission processing. Record the remaining time information,
Based on these, the master sends a bus use right request signal to the bus controller, and when the master receives the bus use right grant signal from the bus controller, the other masters give their master priority and data transmission processing time. With this configuration, the master itself determines whether or not the bus use right request is appropriate, so that the burden on the bus controller, which tends to be complicated, is reduced, and the processing efficiency of the programmable controller is further improved.

【0069】また、一部のマスタが故障してそのバス使
用権を確保したままその処理を中止した場合、処理中止
により発生する現マスタのデータ伝送処理残り時間経過
情報の送付中断を、上記データ伝送処理残り時間が減少
しなくなることにより判断して、バス使用権を次マスタ
に移すようにすれば、バス使用権の制御を続けることが
でき、プログラマブルコントローラの信頼性が向上す
る。
In the case where some masters fail and stop the processing while securing the right to use the bus, the interruption of the transmission of the current master data transmission processing remaining time elapse information caused by the stop of the processing is described in the above data. If it is determined that the remaining time of the transmission processing will not decrease and the right to use the bus is transferred to the next master, the control of the right to use the bus can be continued, and the reliability of the programmable controller is improved.

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

【図1】この発明の一実施の形態における各マスタのバ
ス使用権取得条件を説明する説明図。
FIG. 1 is an explanatory diagram illustrating a bus use right acquisition condition of each master according to an embodiment of the present invention.

【図2】(a)および(b)は、それぞれ図1の実施の
形態によるバス使用権制御状態例を示すタイミングチャ
ート、(c)は、従来の比較例を示すタイミングチャー
ト。
2 (a) and 2 (b) are timing charts each showing an example of a bus use right control state according to the embodiment of FIG. 1, and FIG. 2 (c) is a timing chart showing a conventional comparative example.

【図3】この発明の一実施の形態を示すブロック図。FIG. 3 is a block diagram showing one embodiment of the present invention.

【図4】図3におけるバス上の信号の内容を説明する説
明図。
FIG. 4 is an explanatory diagram for explaining the contents of signals on a bus in FIG. 3;

【図5】図3における待機テーブルの内容を説明する説
明図。
FIG. 5 is an explanatory diagram illustrating the contents of a standby table in FIG. 3;

【図6】図3におけるレジスタの内容を説明する説明
図。
FIG. 6 is an explanatory diagram illustrating the contents of a register in FIG. 3;

【図7】図3のマスタが、図1の実施の形態の処理を行
なう際の処理フローを示すフローチャート。
FIG. 7 is a flowchart showing a processing flow when the master of FIG. 3 performs the processing of the embodiment of FIG. 1;

【図8】図3のバスコントローラが、図1の実施の形態
の処理を行なう際の処理フローを示すフローチャート。
FIG. 8 is a flowchart showing a processing flow when the bus controller of FIG. 3 performs the processing of the embodiment of FIG. 1;

【図9】(a)は、図1の実施の形態によるバス使用権
制御状態例を示すタイミングチャート、(b)は、従来
の比較例を示すタイミングチャート。
9A is a timing chart showing an example of a bus use right control state according to the embodiment of FIG. 1, and FIG. 9B is a timing chart showing a conventional comparative example.

【図10】(a)および(b)は、従来のバス使用権制
御による複数のマスタの処理状況を示すタイミングチャ
ート。
FIGS. 10A and 10B are timing charts showing processing states of a plurality of masters by the conventional bus use right control.

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

1 バス 2 バスコントローラ 2T 待機テ−ブル A、B、‥‥N マスタ Pa、Pb、‥‥Pn 優先度 Ra、Rb、‥‥Rn レジスタ T0a、T0b、‥‥T0n バス占有時間 Ta、Tb、‥‥Tn データ伝送処理残り時間 WTa、WTb、‥‥WTn 許容待ち時間 1 Bus 2 Bus controller 2T Standby table A, B, $ N Master Pa, Pb, $ Pn Priority Ra, Rb, $ Rn register T0a, T0b, $ T0n Bus occupation time Ta, Tb, $ ‥ Tn data transmission processing remaining time WTa, WTb, ‥‥ WTn allowable waiting time

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 バス結合された複数のマスタのバス使用
権をバスコントローラが制御するプログラマブルコント
ローラにおいて、 各マスタの優先度、バス占有時間、許容待ち時間のう
ち、少なくとも二種の情報と、現在マスタとして作動し
ている現マスタの優先度、データ伝送処理残り時間の情
報とを基に、現在マスタとして作動していない次マスタ
のデータ伝送処理が可能になったとき、上記現マスタの
データ伝送処理を継続するか、上記現マスタのデータ伝
送処理を中止して、次マスタのデータ伝送処理に切り換
えるかを判断することを特徴とするプログラマブルコン
トローラ。
1. A programmable controller in which a bus controller controls a bus use right of a plurality of bus-coupled masters, wherein at least two kinds of information of a priority, a bus occupation time, and an allowable waiting time of each master, Based on the priority of the current master operating as the master and the information on the remaining time of the data transmission processing, when the data transmission processing of the next master not currently operating as the master becomes possible, the data transmission of the current master becomes possible. A programmable controller for determining whether to continue the process or to stop the data transfer process of the current master and switch to the data transfer process of the next master.
【請求項2】 現マスタの優先度およびデータ伝送処理
残り時間と、次マスタの優先度および許容待ち時間とを
それぞれ比較して上記の判断を行なうことを特徴とする
請求項1記載のプログラマブルコントローラ。
2. The programmable controller according to claim 1, wherein the determination is made by comparing the priority of the current master and the remaining time of the data transmission processing with the priority and the allowable waiting time of the next master, respectively. .
【請求項3】 次マスタの優先度が現マスタの優先度よ
り高く、かつ、次マスタの許容待ち時間が現マスタのデ
ータ伝送処理残り時間よりも小さいときに、現マスタの
データ伝送処理を中止して、次マスタのデータ伝送処理
に切り換えることを特徴とする請求項2記載のプログラ
マブルコントローラ。
3. When the priority of the next master is higher than the priority of the current master and the allowable waiting time of the next master is shorter than the remaining time of the data transmission processing of the current master, the data transmission processing of the current master is stopped. 3. The programmable controller according to claim 2, wherein the control is switched to a data transmission process of a next master.
【請求項4】 現マスタのデータ伝送処理残り時間経過
情報が送られてこなくなり、上記データ伝送処理残り時
間が減少しなくなったとき、バス使用権を次マスタに移
すことを特徴とする請求項1記載のプログラマブルコン
トローラ。
4. The bus mastership is transferred to the next master when the data transmission processing remaining time information of the current master is no longer sent and the data transmission processing remaining time does not decrease. The programmable controller as described.
【請求項5】 バス結合された複数のマスタのバス使用
権をバスコントローラが制御するプログラマブルコント
ローラにおいて、 各マスタのレジスタに、該マスタの優先度、バス占有時
間、許容待ち時間のうち、少なくとも二種の情報と、現
在マスタとして作動している現マスタの優先度、データ
伝送処理残り時間の情報を記録し、 上記の複数の情報を基に、マスタがバス使用権リクェス
ト信号をバスコントローラに送るとともに、 マスタがバスコントローラからバス使用権グラント信号
を受けて現マスタとなったとき、他のマスタに現マスタ
の優先度、バス占有時間を送ることを特徴とするプログ
ラマブルコントローラ。
5. A programmable controller in which a bus controller controls a bus use right of a plurality of bus-coupled masters, wherein at least two of the master's priority, bus occupation time, and allowable waiting time are stored in a register of each master. Type information, priority of the current master currently operating as the master, and information on the remaining time of the data transmission process are recorded. Based on the plurality of information, the master sends a bus use right request signal to the bus controller. A programmable controller, wherein when the master receives the bus use right grant signal from the bus controller and becomes the current master, the priority of the current master and the bus occupation time are sent to other masters.
【請求項6】 バス結合された複数のマスタのバス使用
権をバスコントローラが制御するプログラマブルコント
ローラにおいて、 複数のマスタからバス使用権リクェスト信号を受けるバ
スコントローラが、上記バス使用権リクェスト信号を発
した複数のマスタの許容待ち時間の小さい順に、上記バ
ス使用権リクェスト信号を発した複数のマスタに対して
バス使用権取得順位を決めることを特徴とするプログラ
マブルコントローラ。
6. A programmable controller in which a bus controller controls a bus use right of a plurality of bus-coupled masters, wherein the bus controller receiving a bus use right request signal from the plurality of masters issues the bus use right request signal. A programmable controller characterized in that a bus use right acquisition order is determined for a plurality of masters that have issued the bus use right request signal in ascending order of allowable wait time of the plurality of masters.
【請求項7】 上記バス使用権取得順位が、更に、上記
バス使用権リクェスト信号を発した複数のマスタの優先
度の高い順に決められることを特徴とする請求項5記載
のプログラマブルコントローラ。
7. The programmable controller according to claim 5, wherein the bus use right acquisition order is further determined in descending order of priority of a plurality of masters that have issued the bus use right request signal.
【請求項8】 上記バス使用権取得順位が、更に、上記
バス使用権リクェスト信号を発した複数のマスタのバス
占有時間の小さい順に決められることを特徴とする請求
項5記載のプログラマブルコントローラ。
8. The programmable controller according to claim 5, wherein said bus use right acquisition order is further determined in ascending order of bus occupation time of a plurality of masters which issued said bus use right request signal.
JP10042084A 1998-02-24 1998-02-24 Programmable controller Withdrawn JPH11242506A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10042084A JPH11242506A (en) 1998-02-24 1998-02-24 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10042084A JPH11242506A (en) 1998-02-24 1998-02-24 Programmable controller

Publications (1)

Publication Number Publication Date
JPH11242506A true JPH11242506A (en) 1999-09-07

Family

ID=12626181

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10042084A Withdrawn JPH11242506A (en) 1998-02-24 1998-02-24 Programmable controller

Country Status (1)

Country Link
JP (1) JPH11242506A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001236120A (en) * 2000-02-22 2001-08-31 Hitachi Ltd Masterless control system
JP2006209707A (en) * 2005-01-31 2006-08-10 Omron Corp Communication control method and controller
JP2007122483A (en) * 2005-10-28 2007-05-17 Canon Inc Bus master unit, bus arbitrator and its control method
JP2010003039A (en) * 2008-06-19 2010-01-07 Koyo Electronics Ind Co Ltd Cpu operation clock-synchronized plc bus system
JP2015095767A (en) * 2013-11-12 2015-05-18 株式会社デンソー Communication apparatus
JP2017208743A (en) * 2016-05-20 2017-11-24 三菱電機株式会社 Relay device and frame transfer method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001236120A (en) * 2000-02-22 2001-08-31 Hitachi Ltd Masterless control system
JP2006209707A (en) * 2005-01-31 2006-08-10 Omron Corp Communication control method and controller
JP2007122483A (en) * 2005-10-28 2007-05-17 Canon Inc Bus master unit, bus arbitrator and its control method
JP2010003039A (en) * 2008-06-19 2010-01-07 Koyo Electronics Ind Co Ltd Cpu operation clock-synchronized plc bus system
JP2015095767A (en) * 2013-11-12 2015-05-18 株式会社デンソー Communication apparatus
JP2017208743A (en) * 2016-05-20 2017-11-24 三菱電機株式会社 Relay device and frame transfer method

Similar Documents

Publication Publication Date Title
US6282598B1 (en) PCI bus system wherein target latency information are transmitted along with a retry request
KR100644596B1 (en) Bus system and bus arbitration method thereof
US7069305B2 (en) Computer system and a data transfer method thereof using remote direct memory access
JPH07210500A (en) Data transfer controller
JP2002304369A (en) Bus system
JPH11242506A (en) Programmable controller
JPH06337843A (en) Data transfer control method
JP2734246B2 (en) Pipeline bus
US8090915B2 (en) Packet transmission control apparatus and method
JP2865131B2 (en) Data transfer method
JP3797049B2 (en) Communication device between control nodes
JP2800764B2 (en) Data transfer control method
JPH0728748A (en) Bus control mechanism and computer system
JP4193754B2 (en) Data duplication method and program
JP3070492B2 (en) Data transfer control method and data transfer control method
JP3458037B2 (en) Split bus control method
JPH0863427A (en) Data processor
JPH10116245A (en) Dma controller
JPH0689258A (en) Bus control system
JP2752456B2 (en) Channel device
JP4738756B2 (en) Information processing device
JP2002269033A (en) Bus system using arbiter having retry control function and system lsi
JPH07319802A (en) Data transfer system
JPS5816322A (en) Input and output controllng system of information processing system
JPH0314055A (en) Communication controller

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20050510