JP2880658B2 - Runaway detection device for multitask program - Google Patents

Runaway detection device for multitask program

Info

Publication number
JP2880658B2
JP2880658B2 JP6266167A JP26616794A JP2880658B2 JP 2880658 B2 JP2880658 B2 JP 2880658B2 JP 6266167 A JP6266167 A JP 6266167A JP 26616794 A JP26616794 A JP 26616794A JP 2880658 B2 JP2880658 B2 JP 2880658B2
Authority
JP
Japan
Prior art keywords
program
task
address
switching
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.)
Expired - Fee Related
Application number
JP6266167A
Other languages
Japanese (ja)
Other versions
JPH08106406A (en
Inventor
均 小野
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 Sankyo Corp
Original Assignee
Nidec Sankyo 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 Nidec Sankyo Corp filed Critical Nidec Sankyo Corp
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

Description

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

【0001】[0001]

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

【0002】[0002]

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

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

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

【0005】[0005]

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

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

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

【0008】[0008]

【課題解決するための手段】第1手段のマルチタスクプ
ログラムの暴走検出装置は、上記目的を達成するため
に、プログラムを複数のタスクプログラムに分割し、各
タスクプログラムを所定の順序で実行させるようにした
マルチタスクプログラムの暴走を検出する装置であっ
て、タスクプログラムを記憶する複数のタスクプログラ
ム記憶手段と、これらタスクプログラム記憶手段に記憶
されたタスクプログラムを、指令手段から指定されたタ
スクプログラムに切り替える切替手段と、この切替手段
による切り替え時に、切替前に実行していたタスクプロ
グラムに基づいたプログラム番地が、切替前に指定され
ていたタスクプログラムのプログラム番地の範囲内に在
るか否かを判定し、範囲内にないと判定した場合には暴
走だとする判定手段と、を具備した。
The first object of the present invention is to provide a multitask program runaway detection device which divides a program into a plurality of task programs and executes each task program in a predetermined order. An apparatus for detecting a runaway of a multi-task program, comprising: a plurality of task program storage means for storing a task program; and the task program stored in the task program storage means being converted to a task program designated by the command means. Switching means for switching and this switching means
At the time of switching by, it is determined whether or not 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. Means for determining that a runaway has occurred if the determination is made.

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

【0010】[0010]

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

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

【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 entire configuration of a multi-task program runaway detection device 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 apparatus 20 of the present embodiment includes a plurality of task program storage units 1 to
4, a command means 5 for sequentially designating task programs to be executed in accordance with a predetermined order determined in advance, and a task program stored in the task program storage means 1 to 4 is designated 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 task programs by the switching means 6 (a program address to be executed next to the last program executed; details will be described later) as a standby program address, and a register, flag ( 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, a program address added to the last program address being executed (storage means) 7
Is the same as the program address stored in the task program) is within the program address range of the specified task program. If the dog pulse is not output for a predetermined time or more, and if it is determined that it is within the range, a watchdog pulse is output as not running out (this output is actually used to determine whether there is runaway as described later). (Because it can be detected in a short time, it is performed at a predetermined time interval or less.) The judgment means 8 and the task program to be executed next switched by the switching means 6 The main part is constituted by an execution unit 9 for executing the program by using a register, a flag, a stack pointer, and the like stored in the storage unit 7 after shifting to the program address.

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

【0015】また、実行手段9に対しては、例えばカー
ド位置を検出しその位置情報を入力するためのセンサ1
2が外部から接続されており、該実行手段9において、
この位置情報を用いてプログラム処理がなされるように
なっている。
The execution means 9 includes, for example, a sensor 1 for detecting a card position and inputting the position information.
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も外部に接
続されている。
The execution means 9 includes, for example, a drive circuit 13 for driving a motor 14, a solenoid 16 for controlling a mechanism, and a write circuit 15 which are controlled by a program process using the position information. A warning means 11 for notifying runaway of the program by blinking of an alarm lamp or the like is also connected to the outside.

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

【0018】このウォッチドッグリセットIC10には
上記実行手段9が接続されており、該実行手段9は、上
記リセットパルスの入力がない場合には、上述のよう
に、切替手段6により切り替えられた次に実行すべきタ
スクプログラムを、格納手段7に格納された次に実行す
べき待機プログラム番地に移行して、同格納手段7に格
納されたレジスタ、フラグ、スタックポインタ等を用い
て、実行させるが、一方リセットパルスの入力がある
と、プログラムが暴走しているとしてプログラムの実行
を停止すると共に、上記警告手段11を駆動するように
なっている。
The execution means 9 is connected to the watchdog reset IC 10, and when no reset pulse is input, the execution means 9 is switched by the switching means 6 as described above. The task program to be executed is shifted to the next standby program address to be executed stored in the storage means 7 and executed using the registers, flags, stack pointers and the like stored in the storage means 7. On the other hand, when a reset pulse is input, the program is determined to be out of control, 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 for a multitask program configured as described above will be described. FIG. 2 is a flowchart showing the processing of each task program in association with a 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), each task process is performed, and the task 1 is, for example, from address 1000h to 1FFFFh.
The task program is completed by performing the process up to the address, the task 2 performs the process from the address 2000h to the address 2FFFFh, and the task 3 performs the process from the address 3000h to the address 3FFFh, for example. ing

【0021】そして、先ずタスクプログラムの指定があ
り、例えばタスク1が指定されたとすると、次のタスク
プログラムの指定があるまで、タスク1の処理をプログ
ラム番地の順に従って行う。
First, if a task program is designated, for example, if 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のプログラムを継続して実行するのに必要とされるデ
ータ等を格納する。
Here, when the next task program is designated during execution of the program of task 1, for example, if task 3 is designated, the task program is switched from task 1 to task 3. The program address of No. 1 is set to a program address which is added to the most recently executed program address (this program address is set to, for example, 1001h for the following description).
Then, the process proceeds to the flowchart shown in FIG. 3. First, in step 1, the program address (1001h) to be executed next to the program executed last in task 1 that has been executed is stored (evacuated) as the standby program address. ), And also stores a register, a flag, a stack pointer, and the like of the task 1 being executed. That is, when the task 1 is designated next time, the data necessary for continuously executing the program of the task 1 is stored.

【0023】そして、ステップ2に進み、ステップ2に
おいて、実行していたタスクが1か否かの判定を行い、
実行していたタスクが1ではない場合にはステップ3に
進み、ステップ3において、実行していたタスクが2か
否かの判定を行い、実行していたタスクが2ではない場
合にはステップ4に進み、ステップ4において、実行し
ていたタスクが3か否かの判定を行う。このように、実
行していたタスクに該当するまで同様な判定を繰り返し
ていく。
Then, the process proceeds to step 2, and in step 2, it is determined whether the executed task is 1 or not.
If the executed task is not 1, the process proceeds to step 3. In step 3, it is determined whether the executed task is 2 or not. If the executed task is not 2, the process proceeds to step 4. In step 4, it is determined whether or not the number of executed tasks is 3. In this way, the same determination is repeated until the task that has been 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 this embodiment, since the executed task is 1, the process proceeds from step 2 to step 5, where the stored standby program address (address 1001h) is specified. It is determined whether or not the program address of task 1 is within the range of addresses 1000h to 1FFFh, and the range of addresses 1000h to 1FFFh is determined.
If it is determined that the standby program address is not in the address (actually, the standby program address 1001h is in the range of 1000h to 1FFFFh, but here, for convenience of explanation, the standby program address is set to only 2002h and the range of 1000h to 1FFFh If the address is not within the address), it is determined that the program 1 has not actually been performed and the program has runaway, and the process proceeds to step 8. In step 8, a watchdog pulse is sent to the watchdog reset IC 10 for a predetermined time. Output a reset pulse without sending
Upon receiving the reset pulse, for example, the program is stopped and an alarm lamp or the like is blinked to notify the program of runaway.

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

【0026】ここで、本実施例にあっては、タスク3の
待機プログラム番地及びレジスタ、フラグ、スタックポ
インタ等は未だ格納されていないので、上述のように、
タスク3のプログラムの一番最初のプログラム番地を待
機プログラム番地としてこの暴走検出フローを終了し
て、図2(c)に示されるタスク3のプログラムに移行
し、待機プログラム番地としての3000h番地からの
処理を行う。
In this embodiment, since the standby program address of the task 3, the register, the flag, the stack pointer, and the like have not been stored yet, as described above,
The runaway detection flow is ended with the first program address of the task 3 program as the standby program address, and the program shifts to the task 3 program shown in FIG. 2C. 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 during the processing of task 3 in the order of the program addresses, the process moves to the flowchart shown in FIG. Execute Step 2. Here, since the task program being executed is task 3, the process proceeds from step 2 to steps 3, 4, and 10. In step 10, the same determination as in step 5 is performed.
The range of the program address of the task 3 for which the standby program address stored in step 1 was specified, 3000h
It is determined whether or not the address is within the range from address 3FFh to address 3
If it is determined that the address is not within the range from address 000h to address 3FFFFh, the process proceeds to step 8, and in step 8, the same abnormal processing as described above is executed.
If it is determined that the address is within the address 3FFFh, the process proceeds to steps 6 and 7, and in step 7, the stored standby program address (address 1001h) of the task 1 and the registers, flags, stack pointer, and the like are restored. After the end of the runaway detection flow, the process proceeds to the task 1 program shown in FIG. 2A, and the process is performed from the address 1001h as the standby program address. That is, task 1
The processing is executed from the program address next to the program address of the previous end, and the processing can be continued using the register, flag, and stack pointer at the time of the previous 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 a task program is designated by the command means 5, the task program being executed is switched to the designated task program by the switching means 6, but at this time, the judgment means According to 8, it is determined whether or not the standby program address is within the program address range of the task program specified before the switching, and if it is determined that the standby program address is not within the range, it is determined that runaway has occurred, and the program is executed. The system is configured to detect runaway by focusing only on the task program that has run out, so that runaway of the task program can be detected in a short time. It is no longer necessary to reduce the execution time of the task program in consideration of the output of a dog pulse. It has become possible to increase the execution time of the click program.

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

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

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

【0033】[0033]

【発明の効果】以上述べたように、本発明のマルチタス
クプログラムの暴走検出装置によれば、指令手段によ
り、タスクプログラムの指定を行うと、切替手段によ
り、実行中のタスクプログラムを指定したタスクプログ
ラムに切り替えるが、この時、判定手段により、切替前
に実行していたタスクプログラムに基づいたプログラム
番地が、切替前に指定されていたタスクプログラムのプ
ログラム番地の範囲内に在るか否かを判定し、範囲内に
ないと判定した場合には暴走だとし、実行していたタス
クプログラムのみに着目して暴走の検出を行うよう構成
したものであるから、タスクプログラムの暴走検出が短
時間でできるようになり、該タスクプログラムの実行時
間を長くすることが可能になる。また、このように、実
行していたタスクプログラムのみに着目して暴走の検出
を行うよう構成したものであるから、休止・停止中のタ
スクの判定プログラムは勿論必要ない。
As described above, according to the multitask program runaway detection apparatus of the present invention, when a task program is designated by the command means, the task program in execution is designated by the switching means. 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 program address range of the task program designated before the switching. If it is determined that it is not within the range, it is determined that runaway has occurred, and runaway detection is performed by focusing only on the task program that was being executed. It is possible to extend the execution time of the task program. In addition, since runaway detection is performed by focusing only on the task program that has been executed in this way, a program for judging a suspended or stopped task is of course unnecessary.

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

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

【図2】各タスクプログラムの処理をプログラム番地に
関連づけて表した各フローチャートである。
FIG. 2 is a flowchart showing processing of each task program in association with a 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 Judgment means 9 Execution means 20 Multitask program runaway detection device

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 プログラムを複数のタスクプログラムに
分割し、各タスクプログラムを所定の順序で実行させる
ようにしたマルチタスクプログラムの暴走を検出する装
置であって、 タスクプログラムを記憶する複数のタスクプログラム記
憶手段と、 これらタスクプログラム記憶手段に記憶されたタスクプ
ログラムを、指令手段から指定されたタスクプログラム
に切り替える切替手段と、この切替手段による切り替え時に、切替前に 実行してい
たタスクプログラムに基づいたプログラム番地が、切替
前に指定されていたタスクプログラムのプログラム番地
の範囲内に在るか否かを判定し、範囲内にないと判定し
た場合には暴走と判定する判定手段と、 を具備したマルチタスクプログラムの暴走検出装置。
1. An apparatus for detecting a runaway of a multitask program in which a program is divided into a plurality of task programs and each of the task programs is executed in a predetermined order. Storage means, switching means for switching the task programs stored in these task program storage means to the designated task program from the command means, and when switching by the switching means , based on the task program executed before the switching . Program address is switched
Determines whether within the scope of the program address of the task program which has been specified before, runaway multitasking program if it is determined not within the range equipped with determining means for determining a runaway, the Detection device.
【請求項2】 請求項1記載のマルチタスクプログラム
の暴走検出装置において、 少なくともタスクプログラム切替時のプログラム番地を
待機プログラム番地として格納する格納手段と、 判定手段により、切替前に実行していたタスクプログラ
ムに基づいたプログラム番地が、切替前に指定されてい
たタスクプログラムのプログラム番地の範囲内にあると
判定した場合には、切替手段により切り替えられたタス
クプログラムにおける待機プログラム番地に移行してプ
ログラムを実行させる実行手段と、 を具備したマルチタスクプログラムの暴走検出装置。
2. The multi-task program runaway detection device according to claim 1, wherein the storage means for storing at least a program address at the time of switching the task program as a standby program address, and the task executed before the switching by the determination means. When it is determined that the program address based on the program is within the range of the program address of the task program specified before the switching, the program shifts to the standby program address of the task program switched by the switching means and executes the program. A runaway detection device for a multitask program, comprising: an execution unit that executes the program.
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 JPH08106406A (en) 1996-04-23
JP2880658B2 true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5853691B2 (en) 2011-12-28 2016-02-09 アイシン・エィ・ダブリュ株式会社 Vehicle control apparatus and method

Also Published As

Publication number Publication date
JPH08106406A (en) 1996-04-23

Similar Documents

Publication Publication Date Title
US4839895A (en) Early failure detection system for multiprocessor system
JP2880658B2 (en) Runaway detection device for multitask program
JPH064417A (en) Battery backup control system for memory
JPH03144705A (en) Operation state monitor for programmable controller
JPH1011320A (en) Rom program monitor device of processor of computer or the like
JPH11119992A (en) Trace controller for firmware
JP2001005689A (en) Trace sampling circuit
JPS595931B2 (en) Address stop method for arithmetic processing system
JPS61211746A (en) Program executing control system
JPS631630B2 (en)
JPH0540510A (en) Controller
JPH10143376A (en) Information processing device
JPS6053887B2 (en) information processing system
JPS59178547A (en) Instruction retry system
JPS638841A (en) Interruption accepting system
JPH05257745A (en) Runaway-monitoring system for microcomputer
JPH0226249B2 (en)
JPS63223829A (en) Information processor
JPH04343148A (en) Exception processing method for integrated type multitask operating system
KR920006847A (en) Processor Diagnosis Device and Diagnosis Method
JP2004005302A (en) Motion program execution device and motion program debugging device
JPH03269752A (en) Information processing system and input/output controller used for the same
JPS59116858A (en) Machine check interruption processing system
JPH06119169A (en) Microcomputer
JPH0756765A (en) Debugging device for input/output processor

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