JPH05307487A - Multi-task monitor - Google Patents

Multi-task monitor

Info

Publication number
JPH05307487A
JPH05307487A JP11264492A JP11264492A JPH05307487A JP H05307487 A JPH05307487 A JP H05307487A JP 11264492 A JP11264492 A JP 11264492A JP 11264492 A JP11264492 A JP 11264492A JP H05307487 A JPH05307487 A JP H05307487A
Authority
JP
Japan
Prior art keywords
task
processing
monitor
value
tasks
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
JP11264492A
Other languages
Japanese (ja)
Inventor
Tsutomu Murayama
努 村山
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP11264492A priority Critical patent/JPH05307487A/en
Publication of JPH05307487A publication Critical patent/JPH05307487A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To provide a multi-task monitor which omits useless operation on the multi-task monitor and executes efficiently processing by knowing a task number only at the time of necessity. CONSTITUTION:First of all at a step S1, the value of a stack pointer storing the address value of a stack area is read. Next, at the step S2, it is discriminated an address in what stack area the value of the stack pointer is, and at the following step S3, the task number is fixed in accordance with a judged result, and the useless operation on the multi-task monitor is omitted, and the processing can be executed efficiently.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、例えば複数のタスクを
制御し、並列処理を行うマルチタスクモニタに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multitask monitor for controlling a plurality of tasks and performing parallel processing.

【0002】[0002]

【従来の技術】従来、CPUを用いた機器制御におい
て、並列処理を行ったり、疑似的に同時に異なる処理を
行う場合のソフトウェアの制御方法の一つとして、マル
チタスクモニタを用いた方法がある。
2. Description of the Related Art Conventionally, in equipment control using a CPU, there is a method using a multitask monitor as one of software control methods for performing parallel processing or pseudo different processing at the same time.

【0003】このマルチタスクモニタを利用して並列処
理を行う場合は、それぞれの処理の流れであるタスクを
同一プログラム上で動作させることが可能であるが、処
理に用いられる入出力信号や動作そのものをタスクで変
更するには、今どのタスクがプログラム上の動作を行っ
ているかを認識する必要があった。
When performing parallel processing using this multitask monitor, it is possible to operate the tasks, which are the flow of each processing, on the same program, but the input / output signals used for processing and the operation itself. In order to change a task with, it was necessary to know which task was performing the program action now.

【0004】そこで、プログラム上でのタスクの認識方
法として、メモリ内に所定のエリアを設け、そのエリア
にタスクナンバーを書き込んでおき、マルチタスクモニ
タによってタスクを変更する際に、毎回タスクナンバー
を次のタスクナンバーに書き換える方法が用いられてい
る。
Therefore, as a method of recognizing a task on a program, a predetermined area is provided in the memory, the task number is written in the area, and the task number is changed every time the task is changed by the multitask monitor. The method of rewriting to the task number of is used.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上記従
来例では、プログラム上でタスクナンバーを知る回数が
少ない場合でも、マルチタスクモニタでタスクを変更す
る際に、タスクナンバーを毎回書き換えているために、
無駄な処理を行っていた。
However, in the above-mentioned conventional example, even when the number of times the task number is known on the program is small, the task number is rewritten every time the task is changed by the multitask monitor.
It was doing useless processing.

【0006】本発明は、上記課題を解決するために成さ
れたもので、必要なときだけタスクナンバーを知ること
により、マルチタスクモニタ上での無駄な動作を省き、
処理を効率良く行えるマルチタスクモニタを提供するこ
とを目的とする。
The present invention has been made to solve the above-mentioned problems, and by knowing the task number only when necessary, unnecessary operation on the multi-task monitor can be omitted.
It is an object to provide a multitask monitor that can efficiently perform processing.

【0007】[0007]

【課題を解決するための手段】及び[Means for Solving the Problems] and

【作用】上記目的を達成するために、本発明のマルチタ
スクモニタは以下の構成を有する。すなわち、複数のタ
スクを制御し、並列処理を行うマルチタスクモニタにお
いて、並列処理される複数のタスクから動作中のタスク
を特定する特定手段を、処理プログラムに有することに
より、マルチタスクモニタ上での無駄な動作を省き、処
理を効率良く行うことができる。
In order to achieve the above object, the multitask monitor of the present invention has the following configuration. That is, in a multitask monitor that controls a plurality of tasks and performs parallel processing, by providing a processing program with a specifying unit that specifies an active task from a plurality of tasks that are processed in parallel, Useless operations can be omitted and processing can be performed efficiently.

【0008】[0008]

【実施例】以下、図面を参照して本発明に係る好適な一
実施例を詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT A preferred embodiment of the present invention will be described in detail below with reference to the drawings.

【0009】マルチタスクモニタでは、図2に示すよう
に、複数のタスク1〜4に対応するスタック領域がそれ
ぞれ確保されており、例えばタスク1のスタック領域に
格納されているデータが他のタスク2〜4によって書き
換えられないように構成されている。そして、現在実行
中のタスクを一時停止させ、新たなタスクを起動する場
合には、実行中のタスクのスタック領域を記憶している
スタックポインタの値を前もって取り込んでおいた次の
タスクのスタック領域のアドレスに書き換えている。例
えば、タスク1が動作中の場合、スタックポインタの値
はタスク1用に確保されているスタック領域の始端アド
レスA1と終端アドレスA2の間の値を取る。また同様
に、各タスク2〜4がそれぞれ動作中の場合、スタック
ポインタの値は各タスク2〜4のスタック領域の始端ア
ドレスと終端アドレスの間であるB1,B2、C1,C
2、D1,D2の間の値をそれぞれ取る。
In the multi-task monitor, as shown in FIG. 2, stack areas corresponding to a plurality of tasks 1 to 4 are secured respectively. For example, the data stored in the stack area of task 1 is stored in other task 2 It is configured so that the data cannot be rewritten by .about.4. Then, when suspending the currently running task and starting a new task, the stack area of the next task that has previously fetched the stack pointer value that stores the stack area of the running task I am rewriting to the address. For example, when task 1 is operating, the value of the stack pointer takes a value between the start address A1 and the end address A2 of the stack area reserved for task 1. Similarly, when each of the tasks 2 to 4 is operating, the value of the stack pointer is between the start address and the end address of the stack area of each of the tasks 2 to 4 B1, B2, C1, C.
Take values between 2, D1 and D2, respectively.

【0010】ここで、例えば図3に示すような複数の同
時に動作可能な動作部3A〜3DをCPU31がそれぞ
れの情報交換用の入出力信号3a〜3cにより制御し、
並列処理させる場合、各動作部3A〜3Dの処理がそれ
ぞれタスク1〜4として実行される。そして、各タスク
1〜4において、同一の処理を行うリエントラントな処
理ルーチンがあった場合、その処理ルーチンでは、動作
中のタスクナンバーによって入出力信号3a〜3cを選
択し、処理する際に、プログラム上でタスクナンバーを
知る必要が生じる。
Here, for example, the CPU 31 controls a plurality of simultaneously operating units 3A to 3D as shown in FIG. 3 by input / output signals 3a to 3c for information exchange,
When performing parallel processing, the processing of each of the operation units 3A to 3D is executed as tasks 1 to 4, respectively. Then, in each of the tasks 1 to 4, if there is a reentrant processing routine that performs the same processing, in that processing routine, when the input / output signals 3a to 3c are selected and processed according to the task number in operation, the program is executed. You will need to know the task number above.

【0011】図1は、本実施例におけるタスクナンバー
を確定するための処理を示すフローチャートである。ま
ずステップS1において、スタック領域のアドレス値を
格納しているスタックポインタの値を読み取る。次に、
ステップS2では、スタックポインタの値がどのスタッ
ク領域内のアドレスか判別し、続くステップS3では、
判別結果に従ってタスクナンバーを確定する。
FIG. 1 is a flow chart showing the processing for determining the task number in this embodiment. First, in step S1, the value of the stack pointer that stores the address value of the stack area is read. next,
In step S2, it is determined in which stack area the value of the stack pointer is, and in step S3,
The task number is decided according to the discrimination result.

【0012】このように、本実施例によれば、マルチタ
スクモニタ上で処理を行わなくても、プログラム上で必
要なときに、タスクナンバーを知ることができる。
As described above, according to this embodiment, it is possible to know the task number when the program requires it, without performing the processing on the multitask monitor.

【0013】<変形例1>図4は、変形例1におけるタ
スク構成を示す図である。図において、処理4はプログ
ラム上でのデータの入出力を行う処理を示し、P,Q,
R,Sはそれぞれタスク1,タスク2,タスク3,タス
ク4用に確保したデータ用メモリである。このような構
成において、複数のタスクが処理しているときに、例え
ば処理4のように、タスク1が処理したデータをタスク
1用に確保したデータ用メモリPに格納、あるいはタス
ク1がデータをデータ用メモリPから引き出す際に、他
のタスクのデータ用メモリQ,S,Rと混同しないため
に、プログラム上で今どのタスクが動作しているのかを
タスクナンバーによって知る必要がある。
<Modification 1> FIG. 4 is a diagram showing a task configuration in Modification 1. In the figure, process 4 indicates a process of inputting / outputting data on the program, and P, Q,
R and S are data memories reserved for Task 1, Task 2, Task 3, and Task 4, respectively. In such a configuration, when a plurality of tasks are processing, the data processed by the task 1 is stored in the data memory P reserved for the task 1 or the task 1 stores the data, for example, as in processing 4. When extracting from the data memory P, it is necessary to know which task is currently operating on the program by the task number so as not to be confused with the data memories Q, S and R of other tasks.

【0014】また同様に、タスク2,タスク3,タスク
4についても、データ用メモリ内容を入出力する場合、
他のタスクのデータと混同しないように、タスクナンバ
ーを知る必要がある。
Similarly, for task 2, task 3 and task 4, when inputting / outputting data memory contents,
It is necessary to know the task number so that it will not be confused with the data of other tasks.

【0015】この時、図1に示したフローチャートの処
理を行うことにより、マルチタスクモニタ上で処理を行
わなくても、プログラム上で必要なときにスタックポイ
ンタの値からタスクナンバーを知ることができる。
At this time, by performing the processing of the flowchart shown in FIG. 1, the task number can be known from the value of the stack pointer when it is necessary in the program without performing the processing in the multitask monitor. ..

【0016】<変形例2>図5は、変形例2におけるタ
スク構成を示す図である。図において、処理5は分岐前
の処理を示し、処理51,処理52,処理53,処理5
4はそれぞれ分岐語の処理を示すものである。
<Modification 2> FIG. 5 is a diagram showing a task configuration in Modification 2. In the figure, process 5 indicates a process before branching, and includes process 51, process 52, process 53, and process 5.
Reference numeral 4 indicates processing of branch words.

【0017】このような構成において、同一のプログラ
ム上を、複数のタスクを用いて処理しているときに、途
中から違う処理を行わせたい場合、例えば図5に示すよ
うに、処理5まで同じ処理を行わせ、そこから処理5
1,処理52,処理53,処理54のように、4種類の
処理を行わせたい場合、各処理51〜54に対応させた
タスクを設定し、処理5が終ってから各タスクごとに自
分が対応している処理を各処理51〜54の中から選ん
で行うようにすれば良いが、プログラム上で処理を選ぶ
際にタスクナンバーを知る必要がある。
In such a configuration, when the same program is processed by using a plurality of tasks, if different processing is desired to be performed from the middle, for example, as shown in FIG. Let the process take place, and then process 5
When it is desired to perform four types of processing, such as 1, processing 52, processing 53, and processing 54, the task corresponding to each processing 51 to 54 is set, and after the processing 5 ends, each task The corresponding process may be selected from among the processes 51 to 54, but it is necessary to know the task number when selecting the process on the program.

【0018】この時、図1に示したフローチャートの処
理を行うことにより、マルチタスクモニタ上で処理を行
わなくても、プログラム上で必要なときにスタックポイ
ンタの値からタスクナンバーを知ることができる。
At this time, by performing the processing of the flowchart shown in FIG. 1, the task number can be known from the value of the stack pointer when necessary in the program without performing the processing on the multitask monitor. ..

【0019】[0019]

【発明の効果】以上説明したように、本発明によれば、
必要なときだけタスクナンバーを知ることにより、マル
チタスクモニタ上での無駄な動作を省き、処理を効率良
く行うことが可能となる。
As described above, according to the present invention,
By knowing the task number only when necessary, it is possible to eliminate wasteful operations on the multitask monitor and perform processing efficiently.

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

【図1】本実施例でのタスクナンバーを確定する処理を
示すフローチャートである。
FIG. 1 is a flowchart showing a process of confirming a task number in this embodiment.

【図2】マルチタスクモニタを使用するために、各タス
クごとに確保したスタック領域を示す図である。
FIG. 2 is a diagram showing a stack area reserved for each task in order to use a multitask monitor.

【図3】本実施例でのタスク構成を示す図である。FIG. 3 is a diagram showing a task configuration according to the present embodiment.

【図4】変形例1でのタスク構成を示す図である。FIG. 4 is a diagram showing a task configuration according to a modified example 1.

【図5】変形例2でのタスク構成を示す図である。FIG. 5 is a diagram showing a task configuration according to a modification 2;

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 複数のタスクを制御し、並列処理を行う
マルチタスクモニタにおいて、 並列処理される複数のタスクから動作中のタスクを特定
する特定手段を、処理プログラムに有することを特徴と
するマルチタスクモニタ。
1. A multitask monitor that controls a plurality of tasks and performs parallel processing, characterized in that the processing program has specifying means for specifying an operating task from the plurality of tasks to be processed in parallel. Task monitor.
JP11264492A 1992-05-01 1992-05-01 Multi-task monitor Withdrawn JPH05307487A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11264492A JPH05307487A (en) 1992-05-01 1992-05-01 Multi-task monitor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11264492A JPH05307487A (en) 1992-05-01 1992-05-01 Multi-task monitor

Publications (1)

Publication Number Publication Date
JPH05307487A true JPH05307487A (en) 1993-11-19

Family

ID=14591894

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11264492A Withdrawn JPH05307487A (en) 1992-05-01 1992-05-01 Multi-task monitor

Country Status (1)

Country Link
JP (1) JPH05307487A (en)

Similar Documents

Publication Publication Date Title
EP0622732A1 (en) Microcomputer
JPH06162228A (en) Data flow processor device
US5872961A (en) Microcomputer allowing external monitoring of internal resources
JPH05307487A (en) Multi-task monitor
US4807178A (en) Programmable sequence controller having indirect and direct input/output apparatus
JPS62162105A (en) Flow chart type programmable controller
JP2506591B2 (en) Auxiliary processor
JP3695078B2 (en) Programmable controller with pulse output instructions
JPH05224707A (en) Program changing method for programmable controller
KR100294655B1 (en) How to Control a My Programmable Controller That Performs a Multitask Function
US5822775A (en) Efficient data processing method for coefficient data in a digital dignal, processor
JPS6180426A (en) System editing processing system
JP2978008B2 (en) Memory management method
JPS5899843A (en) Condition branching device of microprogram
JPS62271003A (en) Programmable controller
JPH0362238A (en) Back-up system for decision of file capacity
JPH03251934A (en) Computer equipment
JPH02110706A (en) Data display system for pc
JPH05224711A (en) Control method for programmable controller
JPH06332508A (en) Programmable controller
JPH02280240A (en) File processing system for program
JPS6238746B2 (en)
JPH1011320A (en) Rom program monitor device of processor of computer or the like
JPS60123938A (en) Debugging system of program
JPS6227830A (en) Interruption control system

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