JPH08106406A - Runaway detecting device for multitrask program - Google Patents

Runaway detecting device for multitrask program

Info

Publication number
JPH08106406A
JPH08106406A JP6266167A JP26616794A JPH08106406A JP H08106406 A JPH08106406 A JP H08106406A JP 6266167 A JP6266167 A JP 6266167A JP 26616794 A JP26616794 A JP 26616794A JP H08106406 A JPH08106406 A JP H08106406A
Authority
JP
Japan
Prior art keywords
program
task
address
executed
runaway
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.)
Granted
Application number
JP6266167A
Other languages
Japanese (ja)
Other versions
JP2880658B2 (en
Inventor
Hitoshi Ono
均 小野
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.)
Nidec Instruments Corp
Original Assignee
Sankyo Seiki Manufacturing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sankyo Seiki Manufacturing Co Ltd filed Critical Sankyo Seiki Manufacturing Co Ltd
Priority to JP6266167A priority Critical patent/JP2880658B2/en
Publication of JPH08106406A publication Critical patent/JPH08106406A/en
Application granted granted Critical
Publication of JP2880658B2 publication Critical patent/JP2880658B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE: To make the execution time of a task program long by detecting the runaway state of the task program in a short time, and to eliminate the need for a decision program for a task in a halt or stop state. CONSTITUTION: When a command means 5 specifies a task program, a switching means 6 switches a task program in execution to the specified task program and a decision means 8 decides whether or not the program address based upon the task program executed before the switching is in the range of the program addresses of the task program specified before the switching; it is decided that the address is not in the range, a runaway state is judged and the runaway state of only the task program executed before the switching is detected.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、マルチタスクプログラ
ムの暴走検出装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a runaway detecting device for a multitask program.

【0002】[0002]

【従来の技術】近年、マイクロコンピュータを用いた装
置においては、プログラムを複数のタスクプログラムに
分割し、各タスクプログラムを異なる周期で起動・実行
させて、その結果所定のある一つの制御を実行するよう
にした所謂マルチタスク処理方式が採用されている。こ
のような装置にあっては、プログラムの暴走検出用のウ
ォッチドッグタイマが備えられている。このウォッチド
ッグタイマは、ウォッチドッグパルスが所定時間間隔以
下で入力されている間は、暴走していないとして何も出
力しないが、ウォッチドッグパルスが所定時間以上途絶
えると、暴走しているとしてCPUにリセットパルスを
出力し、暴走検出ができるようになっている。このウォ
ッチドッグパルスは、各タスクプログラムの途中に頻繁
に挿入された(上記所定時間間隔内に次々と挿入されて
いる)暴走検出用のプログラムを通過した場合に、出力
されるようになっている。
2. Description of the Related Art In recent years, in a device using a microcomputer, a program is divided into a plurality of task programs, each task program is activated and executed at different cycles, and as a result, one predetermined control is executed. The so-called multi-task processing method is adopted. Such a device is equipped with a watchdog timer for detecting program runaway. This watchdog timer does not output anything as long as the watchdog pulse is input within the predetermined time interval because it is not out of control, but if the watchdog pulse is cut off for more than the predetermined time, it outputs to the CPU as runaway. It outputs a reset pulse and can detect runaway. This watchdog pulse is output when a runaway detection program that is frequently inserted in the middle of each task program (one after another within the predetermined time interval) is passed. .

【0003】しかしながら、このような暴走検出方式で
は、例えばタスク1のプログラム処理中に、例えばタス
ク2のプログラムに暴走してしまった場合でも、タスク
2の暴走検出用のプログラム通過時にウォッチドッグパ
ルスを出力してしまうので、暴走していないとされてし
まう。
However, in such a runaway detection method, even if the program of the task 2 runs out of control during the program processing of the task 1, for example, a watchdog pulse is issued when the program for the runaway detection of the task 2 passes. Since it will be output, it is said that it is not out of control.

【0004】そこで、このような問題点の解決を図った
提案が、特開平3−288942号公報記載のプログラ
ム暴走検出方法になされている。この特開平3−288
942号公報記載のプログラム暴走検出方法は、各タス
クプログラムのタスク処理が正常に実行されているか否
かをチェックし、各タスク処理の実行が正常に行われて
いる場合には、各タスクプログラムごとに対応して設け
られたデータセット手段の内容の所定の変更を行い、且
つ所定のタスクプログラムの実行時に、これらのデータ
セット手段の内容をチェックすることにより、全てのタ
スクプログラムが正常に実行されているか否かを検出す
るようにしたものである。
Therefore, a proposal for solving such a problem is made in the program runaway detection method described in Japanese Patent Laid-Open No. 3-288942. This Japanese Patent Laid-Open No. 3-288
The program runaway detection method described in Japanese Patent No. 942 checks whether or not the task processing of each task program is normally executed, and when each task processing is normally executed, By changing the contents of the data set means provided corresponding to the above, and checking the contents of these data set means at the time of executing the predetermined task program, all the task programs are executed normally. It is designed to detect whether or not there is.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上記特
開平3−288942号公報記載のプログラム暴走検出
方法にあっては、以下の問題がある。すなわち、各タス
クを起動する度に、各タスクが正常か否かのチェック処
理を行うと共にデータセット処理を行い、さらにこれら
データに基づいて全タスクが正常か否かのチェック処理
を行わなければいけないので、所定時間間隔内にウォッ
チドッグパルスを出力する(勿論正常と判定した場合)
には、実際のところ、タスクプログラムの実行時間を短
くしなければならないといった問題がある。
However, the program runaway detection method disclosed in Japanese Patent Laid-Open No. 3-288942 has the following problems. That is, every time each task is started, it is necessary to perform a check process of whether each task is normal, perform a data set process, and further perform a check process of whether all tasks are normal based on these data. Therefore, a watchdog pulse is output within a predetermined time interval (of course, when it is determined to be normal)
Has the problem that the execution time of the task program must be shortened.

【0006】また、実際の起動にあっては、休止や停止
しているタスクが存在する場合があり、このような場合
には、全タスクのチェック処理フローにおいて、暴走と
判定してしまうので、該全タスクのチェック処理フロー
に、休止や停止しているタスクの判定プログラムを設け
なけれならず、従って判定が複雑になるといった問題も
ある。
In actual activation, there may be tasks that are inactive or stopped, and in such a case, it is determined as a runaway in the check processing flow for all tasks. There is also a problem that the check processing flow for all the tasks must be provided with a determination program for tasks that are paused or stopped, and therefore the determination becomes complicated.

【0007】そこで本発明は、タスクプログラムの暴走
検出が短時間になされ、該タスクプログラムの実行時間
を長くできると共に、休止・停止中のタスクの判定プロ
グラムも不要なマルチタスクプログラムの暴走検出装置
を提供することを目的とする。
Therefore, the present invention provides a runaway detection device for a multi-task program which can detect runaway of a task program in a short time, can extend the execution time of the task program, and does not require a decision program for a task that is suspended or stopped. The purpose is to provide.

【0008】[0008]

【課題を解決するための手段】第1手段のマルチタスク
プログラムの暴走検出装置は、上記目的を達成するため
に、プログラムを複数のタスクプログラムに分割し、各
タスクプログラムを所定の順序で実行させるようにした
マルチタスクプログラムの暴走を検出する装置であっ
て、タスクプログラムを記憶する複数のタスクプログラ
ム記憶手段と、これらタスクプログラム記憶手段に記憶
されたタスクプログラムを、指令手段から指定されたタ
スクプログラムに切り替える切替手段と、実行していた
タスクプログラムに基づいたプログラム番地が、指定さ
れていたタスクプログラムのプログラム番地の範囲内に
在るか否かを判定し、範囲内にないと判定した場合には
暴走だとする判定手段と、を具備した。
In order to achieve the above object, a multitask program runaway detecting device of a first means divides a program into a plurality of task programs, and executes each task program in a predetermined order. And a plurality of task program storing means for storing the task programs, and a task program specified by the command means for storing the task programs stored in these task program storing means. It is determined whether the switching means for switching to and the program address based on the task program being executed are within the range of the program address of the specified task program, and if it is determined that they are not within the range. Was equipped with a means for determining that it was a runaway.

【0009】第2手段のマルチタスクプログラムの暴走
検出装置は、上記目的を達成するために、上記第1手段
に加えて、少なくともタスクプログラム切替時のプログ
ラム番地を待機プログラム番地として格納する格納手段
と、判定手段により、実行していたタスクプログラムに
基づいたプログラム番地が、指定されていたタスクプロ
グラムのプログラム番地の範囲内にあると判定した場合
には、切替手段により切り替えられたタスクプログラム
における待機プログラム番地に移行してプログラムを実
行させる実行手段と、を具備した。
In order to achieve the above object, the multitask program runaway detection device of the second means includes, in addition to the first means, a storage means for storing at least a program address at the time of switching the task program as a standby program address. If the determination means determines that the program address based on the task program being executed is within the range of the program address of the specified task program, the standby program in the task program switched by the switching means And executing means for moving to the address and executing the program.

【0010】[0010]

【作用】このような第1手段におけるマルチタスクプロ
グラムの暴走検出装置によれば、指令手段により、タス
クプログラムの指定がなされると、切替手段により、実
行中のタスクプログラムが指定されたタスクプログラム
に切り替えられるが、この時、判定手段により、切替前
に実行していたタスクプログラムに基づいたプログラム
番地が、切替前に指定されていたタスクプログラムのプ
ログラム番地の範囲内に在るか否かが判定され、範囲内
にないと判定された場合には暴走だとし、実行していた
タスクプログラムのみに着目した暴走の検出がなされ
る。
According to the runaway detection device for a multitask program in the first means, when the command program is designated by the command means, the switching means changes the task program being executed to the designated task program. At this time, the determination means determines whether or not the program address based on the task program executed before the switching is within the range of the program address of the task program specified before the switching. If it is determined that the runaway is not within the range, the runaway is detected, and the runaway is detected by focusing only on the task program that was being executed.

【0011】また、第2手段におけるマルチタスクプロ
グラムの暴走検出装置によれば、切替時に、格納手段に
より、少なくともタスクプログラム切替時のプログラム
番地が待機プログラム番地として格納される一方で、判
定手段により、切替前に実行していたタスクプログラム
に基づいたプログラム番地が、切替前に指定されていた
タスクプログラムのプログラム番地の範囲内に在ると判
定した場合には、実行手段により、切替手段に従って切
り替えられたタスクプログラムにおける待機プログラム
番地に移行してプログラムが実行される。
Further, according to the runaway detecting device for a multitask program in the second means, at the time of switching, at least the program address at the time of switching the task program is stored as the standby program address by the storing means, and at the same time by the judging means, If it is determined that the program address based on the task program that was being executed before the switching is within the range of the program address of the task program that was specified before the switching, the execution unit switches the program according to the switching unit. The program is executed by shifting to the standby program address in the task program.

【0012】[0012]

【実施例】以下、本発明の実施例を図面に基づいて説明
する。図1は本発明の一実施例におけるマルチタスクプ
ログラムの暴走検出装置の全体構成を表したブロック図
であり、本マルチタスクプログラムの暴走検出装置は、
例えば磁気カードリーダーに適用されている。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the overall configuration of a runaway detecting device for a multitask program according to an embodiment of the present invention.
For example, it is applied to a magnetic card reader.

【0013】本実施例のマルチタスクプログラムの暴走
検出装置20は、同図に示されるように、各タスクプロ
グラムを記憶する複数のタスクプログラム記憶手段1〜
4と、予め決定された所定の順序に従って実行すべきタ
スクプログラムを順次指定していく指令手段5と、上記
タスクプログラム記憶手段1〜4に記憶されたタスクプ
ログラムを、該指令手段5から指定されたタスクプログ
ラムに従って切り替える切替手段(ディスパッチャ)6
と、切替手段6によるタスクプログラム切替時のプログ
ラム番地(実行していた最後のプログラムの次に実行す
るプログラム番地;詳しくは後述)を待機プログラム番
地として格納すると共に、実行していたレジスタ、フラ
グ(FLG)、スタックポインタ(SP)等を格納する
格納手段7と、実行していたタスクプログラムに基づい
たプログラム番地(PC)として例えば実行していた最
後のプログラム番地に一番地追加したもの(格納手段7
に格納されているのと同じプログラム番地)が、指定さ
れていたタスクプログラムのプログラム番地の範囲内に
在るか否かを判定し、範囲内にないと判定した場合に
は、暴走だとしてウォッチドッグパルスを所定時間以上
出力せず、一方範囲内にあると判定した場合には、暴走
していないとしてウォッチドッグパルスを出力する(こ
の出力は、実際には、後述のように暴走の有無を短時間
で検出できるので、所定時間間隔以下になされる)判定
手段8と、上記切替手段6により切り替えられた次に実
行すべきタスクプログラムを、格納手段7に格納された
次に実行すべき待機プログラム番地に移行して、同格納
手段7に格納されたレジスタ、フラグ、スタックポイン
タ等を用いて、実行させる実行手段9と、からその主要
部が構成されている。
As shown in FIG. 1, a multitask program runaway detection device 20 of the present embodiment has a plurality of task program storage means 1 to store each task program.
4, command means 5 for sequentially specifying task programs to be executed in accordance with a predetermined order, and task programs stored in the task program storage means 1 to 4 are specified from the command means 5. Switching means (dispatcher) 6 for switching according to the task program
And a program address at the time of switching the task program by the switching means 6 (a program address to be executed next to the last program being executed; details will be described later) are stored as a standby program address, and registers and flags being executed ( FLG), a storage means 7 for storing a stack pointer (SP), etc., and a program address (PC) based on the task program being executed, for example, the one that is added to the last program address being executed (storage means) 7
(The same program address stored in the) is within the range of the program address of the specified task program, and if it is not within the range, it is regarded as a runaway and is watched. If the dog pulse is not output for a predetermined time or more and it is determined that it is within the range, a watchdog pulse is output because it has not runaway (this output actually indicates whether or not there is runaway, as described later). Since it can be detected in a short time, it is made within a predetermined time interval) determination means 8 and a task program to be executed next that is switched by the switching means 6 is stored in the storage means 7 and is to be executed next. The main part is composed of the execution means 9 which is executed by shifting to the program address and using the registers, flags, stack pointers and the like stored in the storage means 7.

【0014】なお、実行手段9によるタスクプログラム
実行時に、格納手段7において、該当するタスクプログ
ラムの待機プログラム番地が格納されていない場合に
は、そのタスクプログラムの一番最初のプログラム番地
を待機プログラム番地とするように構成されている。
When the executing means 9 executes the task program, if the storing means 7 does not store the standby program address of the corresponding task program, the first program address of the task program is set to the standby program address. Is configured to.

【0015】また、実行手段9に対しては、例えばカー
ド位置を検出しその位置情報を入力するためのセンサ1
2が外部から接続されており、該実行手段9において、
この位置情報を用いてプログラム処理がなされるように
なっている。
For the executing means 9, for example, the sensor 1 for detecting the card position and inputting the position information thereof.
2 is connected from the outside, and in the execution means 9,
Program processing is performed using this position information.

【0016】また、実行手段9には、この位置情報を用
いたプログラム処理によって制御される、例えばモータ
14を駆動するための駆動回路13、メカを制御するた
めのソレノイド16、ライト回路15が外部にそれぞれ
接続されており、さらにアラームランプ等の点滅により
プログラムの暴走を知らしめる警告手段11も外部に接
続されている。
Further, the execution means 9 is externally provided with a drive circuit 13 for driving a motor 14, a solenoid 16 for controlling a mechanism, and a light circuit 15, which are controlled by a program process using the position information. Further, warning means 11 for informing program runaway by blinking an alarm lamp or the like is also connected to the outside.

【0017】また、判定手段8には、ウォッチドッグパ
ルスが所定時間間隔以下で入力されている間は、暴走し
ていないとして何も出力せず、一方ウォッチドッグパル
スが所定時間以上途絶えると、暴走しているとしてリセ
ットパルスを出力するウォッチドッグリセットIC10
が外部に接続されている。
Further, while the watchdog pulse is being input at a predetermined time interval or less, nothing is output to the judging means 8 because the watchdog pulse is not running. On the other hand, when the watchdog pulse is cut off for a predetermined time or more, the runaway runs. Watchdog reset IC 10 that outputs reset pulse
Is connected to the outside.

【0018】このウォッチドッグリセットIC10には
上記実行手段9が接続されており、該実行手段9は、上
記リセットパルスの入力がない場合には、上述のよう
に、切替手段6により切り替えられた次に実行すべきタ
スクプログラムを、格納手段7に格納された次に実行す
べき待機プログラム番地に移行して、同格納手段7に格
納されたレジスタ、フラグ、スタックポインタ等を用い
て、実行させるが、一方リセットパルスの入力がある
と、プログラムが暴走しているとしてプログラムの実行
を停止すると共に、上記警告手段11を駆動するように
なっている。
The watchdog reset IC 10 is connected to the executing means 9 which is switched by the switching means 6 as described above when the reset pulse is not input. The task program to be executed is transferred to the standby program address to be executed next, which is stored in the storage means 7, and is executed using the registers, flags, stack pointers, etc. stored in the storage means 7. On the other hand, when a reset pulse is input, it is determined that the program is running out of control, and the execution of the program is stopped and the warning means 11 is driven.

【0019】次に、このように構成されたマルチタスク
プログラムの暴走検出装置の処理について、以下説明す
る。図2は各タスクプログラムの処理をプログラム番地
に関連づけて表した各フローチャート、図3は本発明に
より実行される暴走検出手順を表したフローチャートで
ある。
Next, the processing of the runaway detecting device of the multitask program thus configured will be described below. 2 is a flowchart showing the processing of each task program in association with the program address, and FIG. 3 is a flowchart showing a runaway detection procedure executed by the present invention.

【0020】各タスクプログラムは、図2(a)〜
(c)に示されるように、それぞれタスク処理を行なう
が、タスク1は、例えば1000h番地から1FFFh
番地までの処理を、タスク2は、例えば2000h番地
から2FFFh番地までの処理を、タスク3は、例えば
3000h番地から3FFFh番地までの処理を、それ
ぞれ行なうことで、各タスクプログラムが完遂するよう
になっている
Each task program is shown in FIG.
As shown in (c), task processing is performed respectively, but task 1 is, for example, from address 1000h to 1FFFh.
For example, task 2 completes the processing from address 2000h to 2FFFh, and task 3 completes the processing from address 3000h to 3FFFh, so that each task program is completed. ing

【0021】そして、先ずタスクプログラムの指定があ
り、例えばタスク1が指定されたとすると、次のタスク
プログラムの指定があるまで、タスク1の処理をプログ
ラム番地の順に従って行う。
First, if a task program is designated, for example, task 1 is designated, the processing of task 1 is performed in the order of program addresses until the next task program is designated.

【0022】ここで、タスク1のプログラム実行中に次
のタスクプログラムの指定があり、例えばタスク3が指
定されたとすると、タスクプログラムがタスク1からタ
スク3に切り替わるわけであるが、この時、タスク1の
プログラム番地は最後に実行したプログラム番地に一番
地追加したプログラム番地にされる(以降の説明のため
にこのプログラム番地を、例えば1001hとする)。
そして、以降は図3に示されるフローチャートに移行
し、先ずステップ1において、実行していたタスク1の
最後に実行したプログラムの次に実行するプログラム番
地(1001h番地)を待機プログラム番地として格納
(退避)すると共に、実行していたタスク1のレジス
タ、フラグ、スタックポインタ等も格納する。すなわ
ち、次回にこのタスク1が指定された時に、このタスク
1のプログラムを継続して実行するのに必要とされるデ
ータ等を格納する。
If the next task program is specified during execution of the task 1 program, for example, task 3 is specified, the task program is switched from task 1 to task 3. At this time, The program address of 1 is set to the program address added most to the last executed program address (for the following description, this program address is set to 1001h, for example).
After that, the process proceeds to the flowchart shown in FIG. 3, and first, in step 1, the program address (1001h address) to be executed next to the last executed program of task 1 being executed is stored (saved) as the standby program address. In addition, the registers, flags, stack pointer, etc. of the task 1 being executed are also stored. That is, when the task 1 is designated next time, the data and the like required for continuously executing the program of the task 1 are stored.

【0023】そして、ステップ2に進み、ステップ2に
おいて、実行していたタスクが1か否かの判定を行い、
実行していたタスクが1ではない場合にはステップ3に
進み、ステップ3において、実行していたタスクが2か
否かの判定を行い、実行していたタスクが2ではない場
合にはステップ4に進み、ステップ4において、実行し
ていたタスクが3か否かの判定を行う。このように、実
行していたタスクに該当するまで同様な判定を繰り返し
ていく。
Then, in step 2, in step 2, it is judged whether or not the task being executed is 1.
If the task being executed is not 1, the procedure proceeds to step 3, and in step 3, it is determined whether the task being executed is 2 or not. If the task being executed is not 2, step 4 is executed. Then, in step 4, it is determined whether the number of tasks being executed is three. In this way, the same determination is repeated until the task that is being executed is applicable.

【0024】ここで、本実施例にあっては、実行してい
たタスクが1であるので、ステップ2からステップ5に
進み、ステップ5において、格納した待機プログラム番
地(1001h番地)が指定されていたタスク1のプロ
グラム番地の範囲1000h番地〜1FFFh番地内に
在るか否かを判定し、範囲1000h番地〜1FFFh
番地内にないと判定した場合(実際には待機プログラム
番地1001hは範囲1000h番地〜1FFFh番地
内にあるが、ここでは説明の都合上、該待機プログラム
番地をここのみ2002h番地とし範囲1000h番地
〜1FFFh番地内にないとした場合)には、実際には
タスク1のプログラム処理を行っておらず暴走してしま
ったとしてステップ8に進み、ステップ8において、ウ
ォッチドッグリセットIC10にウォッチドッグパルス
を所定時間以上送出せずにリセットパルスを出力させ、
このリセットパルスを受けた時点で、例えばプログラム
を停止すると共にアラームランプ等を点滅させて、プロ
グラムの暴走を知らしめる。
In the present embodiment, since the task being executed is 1, the process proceeds from step 2 to step 5, and in step 5, the stored standby program address (1001h address) is designated. It is determined whether the program address of the task 1 is within the range 1000h to 1FFFh, and the range 1000h to 1FFFh.
When it is determined that the address is not within the address (actually, the standby program address 1001h is in the range 1000h to 1FFFh, but for convenience of explanation, the standby program address is set to 2002h only here, and the range 1000h to 1FFFh. If the address is not within the address), it is assumed that the program has not actually executed the task 1 program and has run out of control, and the process proceeds to step 8. At step 8, the watchdog reset IC 10 is supplied with a watchdog pulse for a predetermined time. Output reset pulse without sending more than
At the time of receiving this reset pulse, for example, the program is stopped and an alarm lamp or the like is blinked to inform the runaway of the program.

【0025】一方、ステップ5において、格納した待機
プログラム番地(1001h番地)が指定されていたタ
スク1のプログラム番地の範囲1000h番地〜1FF
Fh番地内に在ると判定した場合には、実際にタスク1
のプログラム処理を行っており暴走していないとしてス
テップ6に進み、ステップ6において、ウォッチドッグ
リセットIC10にウォッチドッグパルスを出力しリセ
ットパルスを出力させないようにしてステップ7に進
み、ステップ7において、格納してある次に実行すべき
指定タスクプログラムの待機プログラム番地及びレジス
タ、フラグ、スタックポインタ等を復帰させる。
On the other hand, in step 5, the program address range of task 1 for which the stored standby program address (1001h address) was specified is 1000h to 1FF.
If it is determined that the address is within Fh, task 1 is actually
Since the program processing is being performed and no runaway has occurred, the process proceeds to step 6, the step 6 outputs the watchdog pulse to the watchdog reset IC 10 and the reset pulse does not output, and the process proceeds to step 7. The standby program address, register, flag, stack pointer, etc. of the designated task program to be executed next are restored.

【0026】ここで、本実施例にあっては、タスク3の
待機プログラム番地及びレジスタ、フラグ、スタックポ
インタ等は未だ格納されていないので、上述のように、
タスク3のプログラムの一番最初のプログラム番地を待
機プログラム番地としてこの暴走検出フローを終了し
て、図2(c)に示されるタスク3のプログラムに移行
し、待機プログラム番地としての3000h番地からの
処理を行う。
Here, in this embodiment, the standby program address of the task 3, the register, the flag, the stack pointer, etc. are not yet stored, so as described above,
This runaway detection flow is terminated by using the first program address of the program of task 3 as the standby program address, and the process moves to the program of task 3 shown in FIG. 2C, starting from the address 3000h as the standby program address. Perform processing.

【0027】そして、このタスク3のプログラム番地の
順に従った処理の途中で、例えばタスク1が指定された
とすると、図3に示されるフローチャートに移行し、上
記の場合と同様にして、ステップ1、2を実行する。こ
こで、実行していたタスクプログラムはタスク3である
ので、ステップ2からステップ3、4、10に進み、ス
テップ10において、ステップ5と同様な判定を行い、
ステップ1において格納した待機プログラム番地が指定
されていたタスク3のプログラム番地の範囲3000h
番地〜3FFFh番地内に在るか否かを判定し、範囲3
000h番地〜3FFFh番地内にないと判定した場合
には、ステップ8に進み、ステップ8において、上記と
同様な異常処理を実行し、一方、範囲3000h番地〜
3FFFh番地内に在ると判定した場合には、ステップ
6、7に進み、ステップ7において、格納してあるタス
ク1の待機プログラム番地(1001h番地)及びレジ
スタ、フラグ、スタックポインタ等を復帰させてこの暴
走検出フローを終了して、図2(a)に示されるタスク
1のプログラムに移行し、待機プログラム番地としての
1001h番地からの処理を行う。すなわち、タスク1
は、前回終了したプログラム番地の次のプログラム番地
から処理が実行されるようになっていると共に、前回終
了時のレジスタ、フラグ、スタックポインタを用いて処
理を継続できるようになっている。
If, for example, task 1 is specified in the middle of the processing in the order of the program address of task 3, the process proceeds to the flowchart shown in FIG. 3 and, in the same manner as in the above case, step 1, Execute 2. Here, since the task program being executed is task 3, the process proceeds from step 2 to steps 3, 4, and 10, and in step 10, the same judgment as in step 5 is performed.
Range of the program address of task 3 for which the standby program address stored in step 1 was designated 3000h
Address to 3FFFh It is determined whether or not it is within the address, and the range is 3
If it is determined that the address is not within the address range from 000h to 3FFFh, the process proceeds to step 8, and in step 8, the same abnormality processing as described above is executed, while the range from address 3000h to
If it is determined that the address is in the 3FFFh address, the process proceeds to steps 6 and 7, and in step 7, the stored standby program address (address 1001h) of task 1, the register, the flag, the stack pointer, etc. are restored. This runaway detection flow is terminated, the program for the task 1 shown in FIG. 2A is entered, and the processing from the address 1001h as the standby program address is performed. That is, task 1
The process is executed from the program address next to the program address that ended last time, and the process can be continued using the register, flag, and stack pointer at the time of the last end.

【0028】そして、このようなプログラム処理が、次
のタスクプログラムの指定があると、同様にして繰り返
される。
Then, such program processing is repeated in the same manner when the next task program is designated.

【0029】このように、本実施例においては、指令手
段5により、タスクプログラムの指定を行うと、切替手
段6により、実行中のタスクプログラムを指定したタス
クプログラムに切り替えるが、この時、判定手段8によ
り、待機プログラム番地が、切替前に指定されていたタ
スクプログラムのプログラム番地の範囲内に在るか否か
を判定し、範囲内にないと判定した場合には暴走だと
し、実行していたタスクプログラムのみに着目して暴走
の検出を行うよう構成しているので、タスクプログラム
の暴走検出が短時間でできるようになっており、従って
ウォッチドッグタイマのタイムアップ(所定時間間隔内
にウォッチドッグパルスを出力すること)を考慮して該
タスクプログラムの実行時間を短くする必要がなくなっ
ており、もって該タスクプログラムの実行時間を長くす
ることが可能になっている。
As described above, in this embodiment, when the task program is designated by the command means 5, the switching means 6 switches the running task program to the designated task program. By 8, it is determined whether the standby program address is within the range of the program address of the task program that was specified before the switching. Since it is configured to detect runaway by focusing only on the task program, it is possible to detect runaway of the task program in a short time. Therefore, the watchdog timer times out (watch within the specified time interval). It is not necessary to shorten the execution time of the task program in consideration of outputting a dog pulse). It has become possible to increase the execution time of the click program.

【0030】また、このように、実行していたタスクプ
ログラムのみに着目して暴走の検出を行うよう構成して
いるので、休止・停止中のタスクの判定プログラムの必
要もなくなっている。
Further, as described above, since the runaway is detected by focusing only on the task program being executed, there is no need for the determination program for the task in the suspended / stopped state.

【0031】以上本発明者によってなされた発明を実施
例に基づき具体的に説明したが、本発明は上記実施例に
限定されるものではなく、その要旨を逸脱しない範囲で
種々変形可能であるというのはいうまでもなく、例え
ば、上記実施例においては、待機プログラム番地(最後
に実行したプログラムの次ぎに実行するプログラム番
地)が、切替前に指定されていたタスクプログラムのプ
ログラム番地の範囲内に在るか否かを判定するようにし
ているが、この待機プログラム番地に代えて、切替前に
実行していたタスクプログラムに基づいたプログラム番
地として、例えば最後に実行したプログラム番地や実行
していたあるプログラム番地を用いるようにしても良
い。
Although the invention made by the present inventor has been specifically described based on the embodiments, the invention is not limited to the above embodiments, and various modifications can be made without departing from the scope of the invention. Needless to say, for example, in the above embodiment, the standby program address (the program address to be executed next to the last executed program) is within the range of the program address of the task program specified before switching. Although it is determined whether or not it exists, instead of this standby program address, as the program address based on the task program executed before the switching, for example, the last executed program address or the executed program address was executed. You may make it use a certain program address.

【0032】また、上記実施例においては、ウォッチド
ッグリセットIC10を用いているが、このウォッチド
ッグリセットIC10を用いずに、判定手段8から直接
実行手段9に信号を送出するようにして、該実行手段9
において、正常・異常時の動作をさせるようにすること
も可能である。
Further, in the above embodiment, the watchdog reset IC 10 is used, but without using the watchdog reset IC 10, the determination means 8 directly sends a signal to the execution means 9 to execute the execution. Means 9
In the above, it is also possible to operate in normal / abnormal state.

【0033】[0033]

【発明の効果】以上述べたように、本発明のマルチタス
クプログラムの暴走検出装置によれば、指令手段によ
り、タスクプログラムの指定を行うと、切替手段によ
り、実行中のタスクプログラムを指定したタスクプログ
ラムに切り替えるが、この時、判定手段により、切替前
に実行していたタスクプログラムに基づいたプログラム
番地が、切替前に指定されていたタスクプログラムのプ
ログラム番地の範囲内に在るか否かを判定し、範囲内に
ないと判定した場合には暴走だとし、実行していたタス
クプログラムのみに着目して暴走の検出を行うよう構成
したものであるから、タスクプログラムの暴走検出が短
時間でできるようになり、該タスクプログラムの実行時
間を長くすることが可能になる。また、このように、実
行していたタスクプログラムのみに着目して暴走の検出
を行うよう構成したものであるから、休止・停止中のタ
スクの判定プログラムは勿論必要ない。
As described above, according to the runaway detecting device for a multi-task program of the present invention, when the task program is designated by the command means, the task for which the running task program is designated by the switching means is designated. The program is switched to a program, but at this time, the determination means determines whether the program address based on the task program executed before the switching is within the range of the program address of the task program specified before the switching. If it is judged that it is not within the range, it is judged that it is a runaway, and since it is configured to detect the runaway by focusing on only the task program that was executing, it is possible to detect the runaway of the task program in a short time. This makes it possible to extend the execution time of the task program. In addition, as described above, since the runaway is detected by focusing only on the task program that is being executed, it is needless to say that there is no task determination program for the suspended / stopped task.

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

【図1】本発明の一実施例におけるマルチタスクプログ
ラムの暴走検出装置の全体構成を表したブロック図であ
る。
FIG. 1 is a block diagram showing an overall configuration of a runaway detection device for a multitask program according to an embodiment of the present invention.

【図2】各タスクプログラムの処理をプログラム番地に
関連づけて表した各フローチャートである。
FIG. 2 is a flowchart showing the processing of each task program in association with the program address.

【図3】本発明により実行される暴走検出手順を表した
フローチャートである。
FIG. 3 is a flowchart showing a runaway detection procedure executed according to the present invention.

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

1〜4 タスクプログラム記憶手段 5 指令手段 6 切替手段 7 格納手段 8 判定手段 9 実行手段 20 マルチタスクプログラムの暴走検出装置 1-4 Task Program Storage Means 5 Command Means 6 Switching Means 7 Storage Means 8 Judging Means 9 Execution Means 20 Multi-task Program Runaway Detection Device

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 プログラムを複数のタスクプログラムに
分割し、各タスクプログラムを所定の順序で実行させる
ようにしたマルチタスクプログラムの暴走を検出する装
置であって、 タスクプログラムを記憶する複数のタスクプログラム記
憶手段と、 これらタスクプログラム記憶手段に記憶されたタスクプ
ログラムを、指令手段から指定されたタスクプログラム
に切り替える切替手段と、 実行していたタスクプログラムに基づいたプログラム番
地が、指定されていたタスクプログラムのプログラム番
地の範囲内に在るか否かを判定し、範囲内にないと判定
した場合には暴走だとする判定手段と、 を具備したマルチタスクプログラムの暴走検出装置。
1. An apparatus for detecting runaway of a multi-task program, wherein the program is divided into a plurality of task programs, and the task programs are executed in a predetermined order, and the plurality of task programs store the task programs. Storage means, switching means for switching the task program stored in these task program storage means from the command means to the designated task program, and the program address based on the task program being executed. The multi-task program runaway detection device comprising: a judgment means for judging whether or not the program address is within the range, and judging that the program is out of control when it is judged not within the range.
【請求項2】 請求項1記載のマルチタスクプログラム
の暴走検出装置において、 少なくともタスクプログラム切替時のプログラム番地を
待機プログラム番地として格納する格納手段と、 判定手段により、実行していたタスクプログラムに基づ
いたプログラム番地が、指定されていたタスクプログラ
ムのプログラム番地の範囲内にあると判定した場合に
は、切替手段により切り替えられたタスクプログラムに
おける待機プログラム番地に移行してプログラムを実行
させる実行手段と、 を具備したマルチタスクプログラムの暴走検出装置。
2. The runaway detection device for a multitask program according to claim 1, wherein at least a storage means for storing a program address at the time of switching the task programs as a standby program address, and a determination means based on the task program being executed. When the determined program address is within the range of the program address of the specified task program, the execution means for shifting to the standby program address in the task program switched by the switching means and executing the program, A multi-task program runaway detection device equipped with.
JP6266167A 1994-10-05 1994-10-05 Runaway detection device for multitask program Expired - Fee Related JP2880658B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6266167A JP2880658B2 (en) 1994-10-05 1994-10-05 Runaway detection device for multitask program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6266167A JP2880658B2 (en) 1994-10-05 1994-10-05 Runaway detection device for multitask program

Publications (2)

Publication Number Publication Date
JPH08106406A true JPH08106406A (en) 1996-04-23
JP2880658B2 JP2880658B2 (en) 1999-04-12

Family

ID=17427207

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6266167A Expired - Fee Related JP2880658B2 (en) 1994-10-05 1994-10-05 Runaway detection device for multitask program

Country Status (1)

Country Link
JP (1) JP2880658B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9080661B2 (en) 2011-12-28 2015-07-14 Aisin Aw Co., Ltd. Vehicle control device and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9080661B2 (en) 2011-12-28 2015-07-14 Aisin Aw Co., Ltd. Vehicle control device and method

Also Published As

Publication number Publication date
JP2880658B2 (en) 1999-04-12

Similar Documents

Publication Publication Date Title
US4839895A (en) Early failure detection system for multiprocessor system
JPS63250702A (en) Sequence controller
JP2880658B2 (en) Runaway detection device for multitask program
JPH064417A (en) Battery backup control system for memory
JP2004318658A (en) Debugging control device and control method thereof
JPH0635757A (en) Abnormality detector of cpu
JPH03144705A (en) Operation state monitor for programmable controller
JPH0540510A (en) Controller
JPS6053887B2 (en) information processing system
JPH07295834A (en) Debug monitor processing method/device
JPS61211746A (en) Program executing control system
JPS595931B2 (en) Address stop method for arithmetic processing system
KR920006847A (en) Processor Diagnosis Device and Diagnosis Method
JPH1011320A (en) Rom program monitor device of processor of computer or the like
JPH0353348A (en) Debugging system for microprogram
JPH11272490A (en) Dlagnostic control system
JPS63316146A (en) Microcomputer
JPH0764822A (en) Microcomputer
JPS6063662A (en) Multiprocessor system
JPS6367615A (en) Power supply control system at time of automatic operation
JPH05257745A (en) Runaway-monitoring system for microcomputer
JPH0458339A (en) Control microprocessor system
JPS63226745A (en) Processor system
JPH05158896A (en) Structure control system
JPH02129744A (en) Data transfer equipment

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990119

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20090129

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20100129

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20100129

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20110129

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20120129

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20130129

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20130129

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20140129

Year of fee payment: 15

LAPS Cancellation because of no payment of annual fees