JPH02195439A - Programmable control device - Google Patents

Programmable control device

Info

Publication number
JPH02195439A
JPH02195439A JP1420389A JP1420389A JPH02195439A JP H02195439 A JPH02195439 A JP H02195439A JP 1420389 A JP1420389 A JP 1420389A JP 1420389 A JP1420389 A JP 1420389A JP H02195439 A JPH02195439 A JP H02195439A
Authority
JP
Japan
Prior art keywords
level
control module
module
time
control
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.)
Pending
Application number
JP1420389A
Other languages
Japanese (ja)
Inventor
Takashi Ando
隆 安藤
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP1420389A priority Critical patent/JPH02195439A/en
Publication of JPH02195439A publication Critical patent/JPH02195439A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To eliminate the need for using a timer in 1 st table by setting up a timer in each level, and at the time-up of the level, starting a control module linked to the time-up level. CONSTITUTION:A start period is set up in each level by a monitor program. At the time of generating a request for the formation of each control module, a monitor program linking means obtains the address of a corresponding MCB 1 from a control module number informed at the time of generating the request. After setting up various information in the MCB 1, the address of the corresponding level of an LCB 2 is obtained from the module levels stored in the MCB 1 and the number 4 of registered modules in the level is increased. During the period of operation, the periods 3 of respective levels in the LCB 2 are counted. When the periods of any one of the levels are counted up, an execution state setting means sets up the leading module number 6 in an executing module number 5.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、複数の制御モジ為−ルをモニタプログラム
の実行管理によって動作させるように構成したプログラ
マブル制御装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a programmable control device configured to operate a plurality of control modules through execution management of a monitor program.

〔従来の技術〕[Conventional technology]

第2図は例えばインタフェース1983年6月号(CQ
出版社刊)のP・191〜P、192に記載された従来
のマルチタスク制御における各テーブルの構成を示す構
成図である。図において、1は各タスクに対応して設け
られているタスクコントロールブロック(TCB ’)
で、実行可能状態タスクリスト作成用のポインタ、タイ
ム・カクンタ、タスク番号(タスク宛)、優先度を示す
タスク・レベルおよび実行可能状態を示すステータス等
の情報が設定されるものである。
Figure 2 is, for example, from the June 1983 issue of Interface (CQ
FIG. 2 is a configuration diagram showing the configuration of each table in the conventional multitask control described in P. 191 to 192 of the publisher (Publisher). In the figure, 1 is a task control block (TCB') provided corresponding to each task.
Information such as a pointer for creating an executable state task list, a time kakunta, a task number (addressed to the task), a task level indicating priority, and a status indicating an executable state is set.

2は優先度数(レベル数)の数に分割されて構成すして
いるレベルコントロールブロッ/ (LCB)で、該当
するレベルに含まれるタスクのうち、最先に起動される
タスクのTCB 1の先頭アドレスが格納されている。
2 is a level control block/(LCB) that is divided into a number of priority levels (level numbers), and is the start address of TCB 1 of the task that is activated first among the tasks included in the corresponding level. is stored.

第2図の例ではLCB 2のレベル0を示すポインタに
はTCB 1 mのアドレスが格納されている。また、
TCBlaのポインタにはTCBlbのアドレスが格納
されている。以下、同様に設定されて、結局レベルOで
はTCB 1a m 1 b # 1c。
In the example of FIG. 2, the address of TCB 1 m is stored in the pointer indicating level 0 of LCB 2. Also,
The address of TCBlb is stored in the pointer of TCBla. Thereafter, the settings are made in the same way, and in the end, at level O, TCB 1a m 1 b # 1c.

1に対応したタスクが実行可能状態にあることを示して
いる。なおTCB 1は第1のテーブルに、LCB2は
第2のテーブルに相当するものである。
This indicates that the task corresponding to 1 is in an executable state. Note that TCB 1 corresponds to the first table, and LCB 2 corresponds to the second table.

次に動作について説明する。第3図に示すフローチャー
トは、あるタスクが他のタスクの起動要求を行なった際
のモニタプログラムの動作を示している。まず、ステッ
プSTIで起動要求され九タスクに対応するTCB 1
の先頭アドレスを求め、ステップST2でそのTCB 
を内のタスク・レベルを得て、LCB2の対応するレベ
ルの位置を求める。そして、ステップST3でレベル0
に属するタスクで実行可能状態になっているタスクのT
CB 1のポインタを頴次たどりて、最後のTCB 1
のポインタに起動要求されたタスクのTCB 1のアド
レスを設定する。最後に、ステップST4で起動要求さ
れたタスクのTCB 1のステータスを実行可能に設定
する。
Next, the operation will be explained. The flowchart shown in FIG. 3 shows the operation of the monitor program when a certain task requests the activation of another task. First, TCB 1 corresponding to nine tasks requested to be activated in step STI
Find the start address of the TCB in step ST2.
Obtain the task level in , and find the position of the corresponding level in LCB2. Then, in step ST3, level 0
T of tasks that belong to and are in executable state
Follow the pointer of CB 1 and find the last TCB 1
The address of TCB 1 of the task requested to be started is set in the pointer. Finally, in step ST4, the status of TCB 1 of the task requested to be activated is set to executable.

また、一定周期で起動されるタスクの起動タイミングは
、TCBI内のタイム・カウンタを使用して定めること
ができる。例えば、モニタプログラムは適当なタイミン
グで、各TCB I内のタイム・カウンタをチエツクし
、所定の計数値に違しているものがあったら、第3図に
示したステップST2〜ST4の処理を行い、そのタス
クを実行可能状態に設定する。
Furthermore, the activation timing of tasks that are activated at regular intervals can be determined using a time counter within the TCBI. For example, the monitor program checks the time counters in each TCB I at appropriate timing, and if there is one that is different from a predetermined count value, it performs the processing in steps ST2 to ST4 shown in Figure 3. , set the task to a runnable state.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従来のマルチタスク制御は以上のように行われているの
で、各制御モジュールを各タスクとしてプログラマブル
制御装置に適用した場合に、すべての制御モジュールの
TCB i内のタイム・カウンタを動作させることが必
要で、また、タイムアツプするたびに上記LCB2への
登録処理を行わなければならず、ソフトウェア動作時の
むだ時間が大きくなυ、リアルタイム性が損なわれ、グ
ログ2マブル制御装置を制御する制御モジュールに悪影
響を及ぼすなどの課題があった。
Conventional multi-task control is performed as described above, so when each control module is applied to a programmable control device as each task, it is necessary to operate the time counter in TCB i of all control modules. In addition, registration processing to the LCB2 described above must be performed every time a timeout occurs, resulting in a large dead time during software operation, which impairs real-time performance and has a negative impact on the control module that controls the Grogu2 Mable control device. There were issues such as the effects of

この発明は上記のような課題を解消するためになされた
もので、TCB1内のタイム・カウンタを動作させずに
済み、その結果、ソフトウェア動作時のむだ時間を短く
することができるプログラマブル制御装置を得ることを
目的とする。
This invention was made in order to solve the above problems, and provides a programmable control device that does not require the time counter in the TCB1 to operate, and as a result, can shorten the dead time during software operation. The purpose is to obtain.

〔課題を解決するための手段〕[Means to solve the problem]

この発明におけるプログラマブル制御装置は、モニタプ
ログラムに、制御モジュールを生成時にレベルに応じて
第2のテーブルに登録するリンク手段を設け、第2のテ
ーブルに、第2のテーブルの各レベルに対応して、周期
的に所定の計数値に達するタイマを設け、前記タイマが
タイムアツプしたら、そのレベルを実行可能状態に設定
する実行状態設定手段を備えて構成したものである。
In the programmable control device according to the present invention, the monitor program is provided with linking means for registering the control modules in the second table according to the level at the time of generation, and the programmable control device is provided with linking means for registering the control modules in the second table according to the level at the time of generation. , a timer that periodically reaches a predetermined count value is provided, and when the timer times out, execution state setting means is provided for setting the level to an executable state.

〔作用〕[Effect]

この発明におけるモニタプログラムは、各制御モジュー
ル生成時に、生成された制御モジュールを第2のテーブ
ルの該当するレベルに登録する。
The monitor program in this invention registers the generated control module in the corresponding level of the second table when each control module is generated.

〔実施例〕〔Example〕

以下、この発明の一実施例を図について説明する。第1
図において、1.1a、1b、1cは各制御モジュール
に対応して設けられたモジュール制御ブロック(MCB
)で、従来のTCBと同様のものである。2は実行レベ
ルごとに制御情報を設定するLCBで、3は起動周期(
タイマ)、4はそのレベルに含まれる制御モジュール数
を登録しである登録モジュール数、5は現在実行中の、
もしくは次に実行される制御モジュールの番号を示す実
行中モジュールtr号、6は各レベルにおいて最初に起
動される制御モジ、−ルの番号を示す先頭モジュール番
号、7は各レベルにおいて最後に起動される制御モジュ
ールの番号を示す終了モジュール番号、8は各レベルの
タイマ3がタイムアツプしたことを示すレディフラグで
ある。
An embodiment of the present invention will be described below with reference to the drawings. 1st
In the figure, 1.1a, 1b, 1c are module control blocks (MCBs) provided corresponding to each control module.
), which is similar to the conventional TCB. 2 is the LCB that sets control information for each execution level, and 3 is the startup cycle (
timer), 4 is the number of registered modules that register the number of control modules included in that level, and 5 is the number of registered modules currently being executed.
Or, the running module tr number indicates the number of the control module to be executed next, 6 is the first module number to be activated at each level, the first module number indicates the number of the control module, and 7 is the first module number to be activated at each level. The ending module number 8 is a ready flag indicating that the timer 3 of each level has timed up.

9は、MCBIK対応する制御モジュールの実行が終了
した時に、次に実行される制御モジ、−ルの番号を示す
次実行モジー−ル番号であり、従来のTCBのポインタ
に相当するものでおる。
9 is a next execution module number indicating the number of the control module to be executed next when the execution of the control module corresponding to MCBIK is completed, and corresponds to a conventional TCB pointer.

次に動作について説明する。まず、モニタプログラムは
各レベルごとに起動周期3を設定しておく。各制御モジ
ュールの生成の要求が発生した時には、モニタプログラ
ムのリンク手段は要求時に通知された制御モジュール番
号から対応するMCB1のアドレスを得る。続いて、そ
のMCB1に各種の情報を設定した後、MCBIK格納
されているモジェールレベル(従来のタスクレベルに相
当する)からLCB 2の該当するレベルのアドレスを
得て、そのレベルの登録モジュール数4をインクリメン
トする。
Next, the operation will be explained. First, the monitor program sets the activation cycle 3 for each level. When a request for generation of each control module occurs, the linking means of the monitor program obtains the address of the corresponding MCB 1 from the control module number notified at the time of the request. Next, after setting various information in MCB1, obtain the address of the corresponding level of LCB2 from the module level (corresponding to the conventional task level) stored in MCBIK, and calculate the number of registered modules at that level. Increment 4.

ここで、登録モジュール数4がIllの場合には、先頭
モジュール番号6、終了モジュール番号7ともに登録を
行りている制御モジ・ニールの番号を設定する。111
ではない場合、つまシ、既に登録された制御モジュール
が存在する場合には、終了モジュール番号7が示す制御
モジュールに対応するMCB 1 cの次実行モジュー
ル番号9に、登録を行りている制御モジュールの番号を
設定する。同時に終了モジュール数号Tにその制御モジ
ュールの番号を設定する。以上のようにして、制御モジ
ュールの登録が行われる。
Here, when the number of registered modules 4 is Ill, both the start module number 6 and the end module number 7 are set to the number of the control module being registered. 111
If not, if there is already a registered control module, the registering control module is added to the next execution module number 9 of MCB 1 c corresponding to the control module indicated by the end module number 7. Set the number. At the same time, the end module number T is set to the number of the control module. Registration of the control module is performed as described above.

プログラマブル制御装置の動作中は、 LCB2の各レ
ベルの起動周期3が、それぞれ並行してカウントされる
。どれかの起動周期3がカウントアツプすると、実行状
態設定手段は、対応するレベルのレディフラグ8をON
し、先頭モジュール番号6を実行中モジ具−層番号5J
C設定する。以上のようにして、そのレベルに登録され
ている制御モジュールが、すべて実行可能状態となる。
During operation of the programmable control device, activation periods 3 for each level of LCB2 are counted in parallel. When any activation cycle 3 counts up, the execution state setting means turns on the ready flag 8 of the corresponding level.
and the first module number 6 is being executed - layer number 5J
C Set. As described above, all control modules registered at that level become executable.

モニタプログラムは、レディフラグがON状態になりて
いるレベルを検出したら、そのレベルの実行中モジュー
ル番号5に対応する制御モジュールのMCB1に設定さ
れている開始アドレスから、その制御モジ、−ルを動作
開始させる。この制御モジュールの動作が完了したら、
対応するMCB1の次実行モジュール番号9に対応する
制御モジ島−ルのMCB1に設定されている開始アドレ
スを得る。以下、順次MCBIの内容を検索して、この
レベルの各制御モジュールを動作させる。
When the monitor program detects a level where the ready flag is in the ON state, it operates the control module from the start address set in MCB1 of the control module corresponding to the module number 5 currently being executed at that level. Let it start. Once the operation of this control module is complete,
Obtain the start address set in the MCB1 of the control module corresponding to the next execution module number 9 of the corresponding MCB1. Thereafter, the contents of the MCBI are sequentially retrieved and each control module at this level is operated.

ここで、MCB1にもレディフラグを設定しておいて、
レディフラグがON状態でないMCB 1に対応する制
御モジュールはスキップするように制御することもでき
る。
Here, set the ready flag on MCB1 as well,
The control module corresponding to MCB 1 whose ready flag is not in the ON state can also be controlled to be skipped.

なお、上記実施例ではレベルごとに制御モジュールをリ
ンクして、レベル単位に起動周期3を設定するようKし
たが、各制御モジュール登録時に、同一制御周期のもの
をリンクするようにしてもよい。
In the above embodiment, the control modules are linked for each level and the activation period 3 is set for each level, but when each control module is registered, those having the same control period may be linked.

〔発明の効果〕〔Effect of the invention〕

以上のように、この発明によればプログラマブル制御装
置を、レベルごとにタイマを設定し、このタイマのタイ
ムアツプ時に、タイムアツプしたレベルにリンクされて
いる制御モジュールを起動するように構成したので、 
TCB−)まシ第1のテーブル中のタイマを使用する必
要がなくなシ、ン7トクエアのむだ時間が小さくなシ、
リアルタイム性が向上するものが得られる効果がある。
As described above, according to the present invention, the programmable control device is configured such that a timer is set for each level, and when the timer times up, the control module linked to the level at which the timer has timed up is activated.
TCB-) There is no need to use the timer in the first table, and the dead time of the seven squares is small.
This has the effect of improving real-time performance.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図はこの発明の一実施例によるプログ2マブル制御
装置におけるマルチタスク制御の各テーブルの構成を示
す構成図、第2図は従来のマルチタスク制御の各テーブ
ルの構成を示す構成図、第3図は従来のモニタプログラ
ムの動作を示す70−チャートである。 1はTCBもしくはMCB(第1のテーブル)、2はL
CB (第2のテーブル)、8はレディフラグ。 なお、図中、同一符号は同一または相当部分を示す。
FIG. 1 is a configuration diagram showing the configuration of each table for multitask control in a programmable dual-mable control device according to an embodiment of the present invention, FIG. 2 is a configuration diagram showing the configuration of each table for conventional multitask control, and FIG. FIG. 3 is a 70-chart showing the operation of a conventional monitor program. 1 is TCB or MCB (first table), 2 is L
CB (second table), 8 is ready flag. In addition, in the figures, the same reference numerals indicate the same or corresponding parts.

Claims (1)

【特許請求の範囲】[Claims] 機能単位に分割された複数の制御モジュールと、これら
制御モジュールのそれぞれに対応し、各制御モジュール
の優先度および実行可能状態を含む情報を有する第1の
テーブルと、前記制御モジュールを示す情報をレベルご
とに登録する第2のテーブルと、前記第1のテーブルお
よび第2のテーブルに設定された情報にもとづいて、前
記制御モジュールを起動するモニタプログラムを備えた
プログラマブル制御装置において、前記モニタプログラ
ムに、前記制御モジュールの生成時に各制御モジュール
をレベルに応じて前記第2のテーブルに登録するリンク
手段を設け、前記第2のテーブルに、周期的に所定の計
数値に達するタイマをレベルごとに設け、任意のレベル
の前記タイマが所定の計数値に達したことを検出してそ
のレベルを実行可能状態に設定する実行状態設定手段を
備えたことを特徴とするプログラマブル制御装置。
A plurality of control modules divided into functional units, a first table corresponding to each of these control modules and having information including the priority and executable state of each control module, and a first table having information indicating the control module at a level. In the programmable control device, the programmable control device includes a second table that is registered in each case, and a monitor program that starts the control module based on information set in the first table and the second table. providing a linking means for registering each control module in the second table according to the level when the control module is generated, and providing a timer in the second table for each level that periodically reaches a predetermined count value; A programmable control device characterized by comprising execution state setting means for detecting that the timer at an arbitrary level reaches a predetermined count value and setting the level to an executable state.
JP1420389A 1989-01-25 1989-01-25 Programmable control device Pending JPH02195439A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1420389A JPH02195439A (en) 1989-01-25 1989-01-25 Programmable control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1420389A JPH02195439A (en) 1989-01-25 1989-01-25 Programmable control device

Publications (1)

Publication Number Publication Date
JPH02195439A true JPH02195439A (en) 1990-08-02

Family

ID=11854552

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1420389A Pending JPH02195439A (en) 1989-01-25 1989-01-25 Programmable control device

Country Status (1)

Country Link
JP (1) JPH02195439A (en)

Similar Documents

Publication Publication Date Title
CN110620712B (en) Method for realizing real-time EtherCAT master station of Window platform
KR970016979A (en) Queuing system and method of tasks in a multiprocessing system
JP2001265609A (en) Arithmetic processor
JPS61272833A (en) Data processor
JP2001306341A (en) Computer system and computer readable recording medium
CN111158875B (en) Multi-module-based multi-task processing method, device and system
JPH02195439A (en) Programmable control device
JP2002073354A (en) Task control device and task contol method
JP2002157279A (en) Data collecting device
Verhulst Virtuoso: A virtual single processor programming system for distributed real-time applications
CN110109743B (en) Real-time process scheduling method
JPH03131935A (en) Timer managing system
JP2885631B2 (en) Operating system management device and operating system management method
JP2566002B2 (en) Task dispatching method
JPH08328881A (en) Task scheduling system
KR100289039B1 (en) Method for executing control of process in cross debugging server
JPH0683652A (en) Microcomputer system
JPH0342765A (en) Decentralized processor
JPH05158710A (en) Timer managing system
JPH0922363A (en) Task constituting system
JPH0462093B2 (en)
JPS63239537A (en) Task control method
JPH0378837A (en) Task control system
JPH01181130A (en) Task start system for real time os
JPH02311916A (en) Waiting time controller