JPH0424747A - Timer device for multi-task - Google Patents
Timer device for multi-taskInfo
- Publication number
- JPH0424747A JPH0424747A JP2125005A JP12500590A JPH0424747A JP H0424747 A JPH0424747 A JP H0424747A JP 2125005 A JP2125005 A JP 2125005A JP 12500590 A JP12500590 A JP 12500590A JP H0424747 A JPH0424747 A JP H0424747A
- Authority
- JP
- Japan
- Prior art keywords
- time
- timer
- setting
- value
- priority
- 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
Links
Abstract
(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明はマルチタスク処理が可能なコンピュータ、パソ
コン等の情報処理装置におけるタイマ装置、−特にパソ
コンのキーボード、マウス等の入力待機のタイマ処理に
適用可能なタイマ装置に関する。[Detailed Description of the Invention] (Industrial Application Field) The present invention is applicable to a timer device in an information processing device such as a computer or a personal computer capable of multitasking processing, and particularly to a timer processing for waiting for input from a keyboard, mouse, etc. of a personal computer. Relating to an applicable timer device.
(従来の技術)
従来、マルチタスク処理が可能なコンピュータ、パソコ
ン等においてタイマ処理が必要な場合は第5図に示すよ
うにソフトウェアにより処理していた0図では、タイマ
要求タスクでタイマテーブル3を検索して希望すべき設
定時間に相当するカウント値がタイマ処理ごとにN個登
録されている。(Prior Art) Conventionally, when timer processing is required in computers, personal computers, etc. capable of multitasking, it is processed by software as shown in FIG. N count values corresponding to the set time to be searched and desired are registered for each timer process.
タイマテーブル3に設定されたN個のカウント値は、設
定時間が経過するたびに実行されるタイマ割り込みタス
クの開始によりそれぞれカウントされ、設定カウント値
がカウントされた時点で該当するタイマ処理が開始され
るように構成されている。また、タイマ割り込みタスク
は、常に次のカウント値をタイマテーブル3から読み出
してタイマに再設定するようになっている。The N count values set in the timer table 3 are counted by starting a timer interrupt task that is executed every time the set time elapses, and the corresponding timer process is started when the set count value is counted. It is configured to Further, the timer interrupt task always reads the next count value from the timer table 3 and resets it in the timer.
(発明が解決しようとする謀B)
しかしながら、上述した従来の処理方法では、タイマ割
り込みタスクの実行途中でタイマテーブル3を検索して
設定値を逐−読み出し、タイマを再起動させるための設
定が必要であるため、設定個数Nが多い場合はその所要
時間が無視できない長さになることがある。(Plot B to be Solved by the Invention) However, in the conventional processing method described above, the timer table 3 is searched during the execution of the timer interrupt task, the set values are sequentially read out, and the settings for restarting the timer are made. Therefore, if the set number N is large, the required time may become too long to ignore.
また、タイマテーブルに設定できるカウント値も最大値
が制限されるため、例えば1年というような長時間を設
定することは一般には難しがった。Furthermore, since the maximum count value that can be set in the timer table is limited, it is generally difficult to set a long time, such as one year.
そこで、本発明は上記問題点を解決するためになされた
もので、その目的とするところは、タイマ割り込みタス
ク時の処理を簡単にするとともに設定できるタイマの設
定レンジを大きくすることができるマルチタスク用タイ
マ装置を提供することにある。SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems, and its purpose is to simplify processing during timer interrupt tasks and to increase the range of timer settings that can be set. The purpose of the present invention is to provide a timer device for
(課題を解決するための手段)
上記目的を達成するために、第1の発明は、タイムアツ
プ時の処理項目、およびタイムアツプ比較処理の優先順
位、優先順位が第1位であるタイマ設定についての現在
時からタイムアツプまでの設定時間、優先順位が第2位
以降であるタイマ設定についての直近上位の設定時間と
の時間差を、タイマ設定ごとに格納するタイマテーブル
と、−定間隔でおこなわれるタイマ割込みタスク開始の
たびごとにカウントアツプして現在時を計時する現在時
カウンタと、タイマ設定のためのタイマ要求タスクの実
行開始時に、タイマテーブル内に格納されている優先順
第1位の設定時間から現在時カウンタの計時値を減算し
て変更するとともに、現在時カウンタの計時値をクリア
する手段と、タイマ要求タスクの実行時に、タイムアツ
プ時の処理項目とともに入力された新たな設定時間を、
すでに前記タイマテーブルに格納されているタイマ設定
値とタイムアツプの前後関係を比較して優先順位を決定
し、得られた優先順位にもとづき直近上位の設定値との
差を夏山してタイマテーブルに格納するとともに、直近
下位として格納されている設定値を新たな設定値に基づ
いて補正し書換える手段とを備えたことを特徴とする。(Means for Solving the Problems) In order to achieve the above object, a first invention provides information on processing items at time-up, priority order of time-up comparison processing, and current setting of a timer with the first priority. A timer table that stores, for each timer setting, the set time from time to time-up, and the time difference from the most recent higher set time for timer settings whose priority is second or higher, and a timer interrupt task that is performed at regular intervals. A current time counter that counts up and measures the current time each time the timer is started, and a current time counter that counts up and measures the current time at the start of execution of the timer request task for timer settings. A means for subtracting and changing the time value of the hour counter and clearing the time value of the current time counter, and a new setting time inputted together with the processing item at time up when executing the timer request task.
The priority order is determined by comparing the timer setting values already stored in the timer table with the time-up order, and based on the obtained priority order, the difference between the set value and the immediately higher setting value is calculated and stored in the timer table. In addition, the present invention is characterized by comprising means for correcting and rewriting the setting value stored as the immediately lower-order value based on the new setting value.
第2の発明は、タイムアツプ時の処理項目、およびタイ
ムアツプ比較処理の優先順位、優先順位が第1位である
タイマ設定についての現在時からタイムアツプまでの設
定時間、優先順位が第2位以陳であるタイマ設定につい
ての直近上位の設定時間との時間差を、タイマ設定ごと
に格納するタイマテーブルと、一定間隔でおこなわれる
タイマ割込みタスク開始のたびごとにカウントアツプし
て現在時を計時する現在時カウンタと、カウントアツプ
された現在時カウンタの計時値とタイマテーブルの優先
順第1位の設定値とを比較し、一致した場合に両方の値
をクリアするとともに前記りイマテーブルの設定値に付
帯して格納されていたタイムアツプ時の処理項目データ
を出力する手段とを備えたことを特徴とする。The second invention is the processing items at time-up, the priority order of time-up comparison processing, the set time from the current time to time-up for the timer setting with the first priority, and the priority order of the timer setting with the second or higher priority. A timer table that stores the time difference between a certain timer setting and the most recent upper setting time for each timer setting, and a current time counter that counts up and measures the current time every time a timer interrupt task starts at regular intervals. Then, the counted up current time counter value is compared with the setting value of the first priority in the timer table, and if they match, both values are cleared and the above value is attached to the setting value of the timer table. The present invention is characterized by comprising means for outputting processing item data at time-up that has been stored.
(作 用)
第1の発明においては、タイマテーブルにタイムアツプ
時の処理項目およびタイムアツプ比較処理の優先順位が
格納されるとともに、優先順第1位であるタイマ設定に
ついての現在時からタイムアツプまでの設定時間および
優先順第2位以降であるタイマ設定についての直近上位
の設定時間との時間差が一大小複数種の時間単位により
タイマ設定ごとに格納される。一定間隔でおこなわれる
タイマ割込みタスクの開始のたびごとにカウントされて
経過時間が現在時カウンタに計測される。タイマ要求タ
スクの開始時に、タイマテーブル内に格納されている優
先順第1位の設定時間から現在時カウンタの計時値が減
算されて変更されるとともに、現在時カウンタの計時値
がクリアされる。(Function) In the first invention, the timer table stores the processing items at the time of time-up and the priority of the time-up comparison process, and also the settings for the timer setting that has the first priority from the current time to the time-up. The time difference between the time and the immediately higher setting time for timer settings that are second or higher in priority are stored for each timer setting in multiple types of time units, one large and one small. Each time a timer interrupt task starts at regular intervals, it is counted and the elapsed time is measured in the current time counter. At the start of the timer request task, the time value of the current time counter is subtracted and changed from the first priority set time stored in the timer table, and the time value of the current time counter is cleared.
タイマ要求タスクにおいて、タイムアツプ時の処理項目
とともに新たな設定時間が入力されると、すでにタイマ
テーブルに格納されている設定時間値とタイムアツプの
前後関係が比較されて優先順位が決定される。得られた
優先順位にもとづき入力した設定値とその直近上位の設
定値との差が夏山されてタイマテーブルに格納されると
ともに、すでに直近下位として格納されていた設定値が
新たな設定値に基づいて補正され書換えられる。In the timer request task, when a new setting time is input together with a processing item at time-up, the setting time value already stored in the timer table and the context of time-up are compared to determine the priority order. Based on the obtained priority order, the difference between the input setting value and the immediately higher setting value is calculated and stored in the timer table, and the setting value that was already stored as the immediately lower setting value is changed based on the new setting value. corrected and rewritten.
第2の発明においては、タイマテーブルにタイムアツプ
時の処理項目およびタイムアツプ比較処理の優先順位が
格納されるとともに、優先順第1位であるタイマ設定に
ついての現在時からタイムアツプまでの設定時間および
優先順第2位以降であるタイマ設定についての直近上位
の設定時間との時間差が大小複数種の時間単位によりタ
イマ設定ごとに格納される。一定間隔でおこなわれるタ
イマ割込みタスクが開始のたびごとにカウントされて経
過時間が現在時カウンタに計測される。タイマ要求タス
クの開始時に、タイマテーブル内に格納されている優先
順第1位の設定時間から現在時カウンタの計時値が減算
されて変更されるとともに、現在時カウンタの計時値が
クリアされる。In the second invention, the timer table stores the processing items at time-up and the priority order of time-up comparison processing, and also the setting time and priority order from the current time to time-up regarding the timer setting having the first priority. The time difference between the second and subsequent timer settings and the immediately higher setting time is stored for each timer setting in multiple types of time units, large and small. A timer interrupt task that is performed at regular intervals is counted each time it is started, and the elapsed time is measured in the current time counter. At the start of the timer request task, the time value of the current time counter is subtracted and changed from the first priority set time stored in the timer table, and the time value of the current time counter is cleared.
現在時カウンタの計時値とタイマテーブルの優先順第1
位の設定値とが比較され、一致した場合に両方の値がク
リアされるとともに前記タイマテーブルの設定値に付帯
して格納されているタイムアップ時の処理項目データが
出力される。Current time counter time value and timer table priority number 1
If they match, both values are cleared and the processing item data at the time of time-up, which is stored along with the set value of the timer table, is output.
(実施例) 以下、図に沿って本発明の詳細な説明する。(Example) The present invention will be described in detail below with reference to the drawings.
第1図は本発明の動作の概要をあられす説明図であり、
マルチタスクの一つであるタイマ要求タスクにおいて、
図示しないメモリに設けられたタイマテーブル1を検索
して、空いているエリアにタイマの設定値をミリ秒、秒
、千秒単位により登録する。このとき設定値とともにタ
イムアツプ時の処理内容等も一緒に登録され、さらに設
定値が2個以上の場合、現在時刻から設定した作動時ま
でが短い順に優先順位が付加されて登録される。FIG. 1 is an explanatory diagram outlining the operation of the present invention.
In the timer request task, which is one of the multitasking,
A timer table 1 provided in a memory (not shown) is searched, and timer setting values are registered in an empty area in units of milliseconds, seconds, and thousand seconds. At this time, the contents of processing at time-up are registered together with the set values, and if there are two or more set values, they are registered with priority added in descending order of time from the current time to the set activation time.
同しくメモリ内あるいはレジスタに、ミリ秒、秒、千秒
単位で経過時間をカウントする現在時カウンタ2が設け
られ、タイマ割り込みタスクの実行ごとにその実行間隔
の1ミリ秒をカウントする。Similarly, in the memory or in the register, a current time counter 2 is provided which counts elapsed time in units of milliseconds, seconds, and thousands of seconds, and counts 1 millisecond of the execution interval every time a timer interrupt task is executed.
同時にこのタイマ割り込みタスクではカウントされた経
過時間と、タイマテーブル1の最優先順位の設定値とが
比較され、一致した場合は該当する処理内容をタイマテ
ーブル1から読み出して出力する。At the same time, this timer interrupt task compares the counted elapsed time with the highest priority setting value of the timer table 1, and if they match, the corresponding processing content is read out from the timer table 1 and output.
次いで出力された処理内容から、次のアイドルタスクに
おいて該当する処理が起動されて、一つのタイマ処理が
終了する。Then, based on the output processing content, a corresponding process is started in the next idle task, and one timer process ends.
第2図はタイマテーブル1の構成を示すものであり、入
力された設定値および処理内容がアドレス順に格納され
る。各アドレスは上位ビット側から、優先順位、設定カ
ウント値(ミリ秒)、設定カウント値(秒)、設定カウ
ント+[(千秒)、タイムアツプ時の処理種別が順に書
き込まれる。FIG. 2 shows the structure of the timer table 1, in which input setting values and processing contents are stored in address order. For each address, the priority, set count value (milliseconds), set count value (seconds), set count + [(thousand seconds), and processing type at time-up are written in order from the upper bit side.
優先順位は、後述する処理により最も先にタイムアツプ
する設定値、すなわち最も小さい設定値から順に割り振
られる番号である。The priority is a number that is assigned in order from the setting value that times up first in the process described later, that is, the smallest setting value.
各カウント値は、タイマ割り込みタスクの実行間隔であ
る1ミリ秒を最小単位として設定され、最大値で約6千
5百万秒、すなわち約2年間の長期間についてタイマ設
定することができる。Each count value is set with the minimum unit being 1 millisecond, which is the execution interval of the timer interrupt task, and the timer can be set for a long period of about 65 million seconds at the maximum, that is, about 2 years.
第3図は本発明のマルチタスク用タイマ装置のタイマ要
求タスクにおいて新たにタイマを設定する際の動作を表
すフローチャートである。以下、フローチャートを参照
しながら動作を系統的に説明する。FIG. 3 is a flowchart showing the operation of the multitask timer device of the present invention when setting a new timer in a timer request task. The operation will be systematically explained below with reference to flowcharts.
タイマ要求タスクが開始されると、最初にタイマテーブ
ルlの優先順位を格納するレジスタ(図示せず)にn=
1を設定する(ステップ301)。When the timer request task is started, n=
1 is set (step 301).
次にレジスタに指定された優先順位“1”のタイマテー
ブルl内の該5欄に格納されている設定値T 111か
ら、その時点における現在時カウンタの値Yを減じる(
ステップ302)、同時に現在時カウンタのカウント値
Yをクリアする(ステップ303)。Next, the current time counter value Y at that point is subtracted from the set value T111 stored in the 5th column in the timer table l with the priority level "1" specified in the register (
Step 302), and at the same time, the count value Y of the current counter is cleared (Step 303).
ここで、現在時カウンタの値Yを減じたT(1)が零で
あるか否かを判別し、零である場合は(ステップ304
肯定)、T(1)として設定されたタイマ処理が開始さ
れる(ステップ305)。Here, it is determined whether T(1), which is obtained by subtracting the value Y of the current time counter, is zero, and if it is zero, (step 304
(Yes), a timer process set as T(1) is started (step 305).
T(1)が零でないと判別された場合は(ステップ30
4否定)、新たにタイマに設定を希望する時間KがT(
、)よりも大であるか否かを判別しくステップ306)
、時間KがT(1)よりも大でない場合(ステップ30
6否定)、そのT(1)の値をWKとして登録する(ス
テップ307)。If it is determined that T(1) is not zero (step 30
4 negation), and the new time K desired to be set in the timer is T(
Step 306)
, if time K is not greater than T(1) (step 30
6 (No), and the value of T(1) is registered as WK (step 307).
次いで、優先順位(n+1)以降、すなわち2゜3、・
・・とじてタイマテーブルに書き込まれている優先順位
の値をそれぞれ+1して、3.4゜・・・とする(ステ
ップ30B)。Next, after priority (n+1), that is, 2゜3, .
. . and the priority values written in the timer table are each incremented by 1 to become 3.4° (step 30B).
ここで、空白となったT、1.のタイマ設定時間として
Kを登録しくステップ309)、さらに空白となったT
(1)として、先に変更前のT(1)を登録しておいた
WKから設定時間Kを減じた値を登録する(ステップ3
10)。Here, the blank T, 1. In order to register K as the timer setting time of step 309), T is blank.
As (1), register the value obtained by subtracting the set time K from the WK in which T(1) before the change was previously registered (Step 3
10).
また、ステップ306において、新たにタイマに設定を
希望する時間KがT(ト)よりも大である場合(ステッ
プ306肯定)、レジスタに格納されている優先順位の
値nに1を加算しくステップ321)、レジスタに指定
されている優先順位nまでのタイマテーブル1の各欄に
それぞれ格納されているタイマ設定値の合計をWKとし
て算出する(ステップ322)、次いで得られたWKが
設定希望時間により小さいか否かを判別しくステップ3
23)、WKが設定希望時間によりもまだ小さい場合(
ステップ323肯定)、WKが設定希望時間Kを越え、
しかも最後のタイマ設定値になるまでレジスタの優先順
位nを順次、+ILで、WKに順に加算していく(ステ
ップ324否定、ステップ321.322)。Further, in step 306, if the time K that is newly desired to be set in the timer is greater than T (step 306, affirmative), 1 is added to the priority value n stored in the register. 321), the sum of the timer setting values stored in each column of timer table 1 up to priority n specified in the register is calculated as WK (step 322), then the obtained WK is the desired setting time Step 3 to determine whether it is smaller than
23), if WK is still smaller than the desired setting time (
step 323 (affirmative), WK exceeds the desired set time K,
Moreover, the priority order n of the register is sequentially added to WK by +IL until the last timer setting value is reached (step 324 is negative, steps 321 and 322).
優先順位nまでのタイマ設定値を順に加算して得られた
WKが設定希望時間によりも大きくなったら(ステップ
323否定)、優先順位(n+1)以降のタイマテーブ
ル1の各欄に書き込まれている優先順位の値にそれぞれ
+1を加算する(ステップ325)。If the WK obtained by sequentially adding up the timer setting values up to the priority level n becomes larger than the desired setting time (No in step 323), the values are written in each column of the timer table 1 starting from the priority level (n+1). +1 is added to each priority value (step 325).
優先順位の書換えの結果、空白となった優先順位(n+
1)のタイマ設定値T (e*+1に、WKから設定希
望時間Kを減じた値を新たに書き込む(ステップ326
)、同様にして優先順位nのタイマテーブル設定値T、
R,を、優先順位が1から(n−1)までのタイマ設定
値を加算して得られたWKを設定希望時間Kから減じた
値に書換えて(ステップ327)、タイマ設定の処理を
終了する。As a result of rewriting the priority order, the priority order (n+
1) Write a new value obtained by subtracting the desired setting time K from WK to the timer setting value T (e*+1) (step 326
), similarly, the timer table setting value T of priority n,
R, is rewritten to the value obtained by subtracting WK obtained by adding the timer setting values whose priorities are from 1 to (n-1) from the desired setting time K (step 327), and the timer setting process ends. do.
なお、上述した処理においては、タイマテーブル1にタ
イマ設定値のみを登録する処理として説明したが、新た
にタイマ設定される場合、その処理内容を指定する処理
種別も同時にタイマテーブル1の該5欄に書き込まれる
。Note that in the above process, only the timer setting value is registered in timer table 1, but when a new timer is set, the process type that specifies the process content is also registered in the 5 columns of timer table 1. will be written to.
第4図は、タイマテーブル1における設定値の入力処理
の具体例を示す説明図である。FIG. 4 is an explanatory diagram showing a specific example of input processing of setting values in the timer table 1.
先ず、図aにおいて、タイマテーブル1には、1つのタ
イマ処理に関する設定値が入力されている。設定内容は
、タイムアツプ設定時刻として“10”秒、処理種別が
“3“であり、設定値が1個であるので優先順位は自動
的に“1″となる。First, in FIG. a, a setting value related to one timer process is input into a timer table 1. The setting contents are that the time-up setting time is "10" seconds, the processing type is "3", and since there is only one setting value, the priority is automatically set to "1".
また、設定直後では現在時カウンタ2のカウント値は“
000″である。Also, immediately after setting, the count value of current counter 2 is “
000''.
図すは、3秒経過後を表し現在時カウンタの値は030
”となる。The figure shows 3 seconds have passed and the current time counter value is 030.
” becomes.
ここで、新たなタイマ処理として20”秒の設定が開始
される。図Cに示すようにタイマテーブル1内の優先順
第1位の設定値の“10”秒から現在時カウンタのカウ
ント値3秒が減じられ“7”秒に書換えられる。同時に
現在時カウンタはクリアされて′000″となる。Here, setting of 20" seconds is started as a new timer process. As shown in Figure C, the current time counter's count value 3 The seconds are decremented and rewritten to "7" seconds. At the same time, the current time counter is cleared and becomes "000".
なお、以上の処理は第3図のステップ301〜303に
対応する。Note that the above processing corresponds to steps 301 to 303 in FIG.
続いて、処理種別″3″について、“20”秒を登録す
るために、現在のタイマテーブル1の設定値の累計(こ
の場合設定値は1つだけであるから“7″秒)と20”
秒とを比較する。ここでは新たな設定値“20″秒の方
が7°°秒よりも大きいため、両者の差である“13”
秒を図C′に示すように優先順位“2”として登録する
。Next, in order to register "20" seconds for processing type "3", add the cumulative total of the current timer table 1 settings (in this case, there is only one setting value, so "7" seconds) and 20".
Compare with seconds. Here, the new setting value "20" seconds is larger than 7°° seconds, so the difference between the two is "13".
Seconds are registered as priority "2" as shown in Figure C'.
以上の処理は第3図のステップ306肯定、321〜3
27に対応する。The above processing is affirmative in steps 306 and 321 to 3 in FIG.
Corresponds to 27.
図dは、さらに2秒経過後を表し現在時カウンタの値は
”020”となる。FIG. d shows the state after another 2 seconds have elapsed, and the value of the current time counter becomes "020".
二こで、処理種別″3″についてさらに“3″秒を登録
するために新たなタイマ処理の設定が開始される。タイ
マテーブル1内の優先順第1位の設定値の“7”秒から
現在時カウンタのカウント値である2″秒が減じられて
図eに示すように“5”秒に書換えられる。同時に現在
時カウンタはクリアされて“000″となる。At this point, setting of a new timer process is started in order to further register "3" seconds for the process type "3". The count value of the current time counter, 2" seconds, is subtracted from "7" seconds, the first priority setting value in timer table 1, and is rewritten to "5" seconds, as shown in Figure e. At the same time, the current The hour counter is cleared to "000".
ここまでの処理は、前記同様に第3図のステップ301
〜303に対応する。The processing up to this point is the same as described above at step 301 in FIG.
- Corresponds to 303.
続いて、図e′の最上段に示すように新たな設定値“3
″秒が処理種別°゛3”とともに書き込まれる。書き込
まれた設定値′3”秒は、それまで優先順第1位であっ
た“5″秒よりも小さいため優先順位を“1”としてそ
のまま書き込まれる。Next, as shown in the top row of Figure e', a new setting value "3" is set.
"Seconds" are written together with the processing type "3". The written setting value '3'' seconds is smaller than '5'' seconds which had been ranked first in the priority order, so it is written as is with the priority order being set to '1'.
その結果、それまでに入力されていた各設定値の順位が
相対的に後退する。また、第2位に後退したそれまでの
第1位の設定値の“5”秒からは新たに入力された設定
値°“3”秒が減じられて、残りの2”秒が新たな設定
値として優先順第2位の欄に書換えられる。As a result, the ranking of each setting value inputted up to that point is relatively lowered. In addition, the newly input setting value ° "3" seconds is subtracted from the previously entered first place setting value of "5" seconds, which has fallen to second place, and the remaining 2" seconds are used as the new settings. The value is rewritten to the second priority column.
ここまでの処理は、第3図のステップ306否定、30
7〜310に対応する。The processing up to this point includes steps 306 negation and 30 in FIG.
7 to 310.
以後、新たにタイマ処理が入力される場合は、新たに優
先順第1位となった設定値について現在時カウンタ値の
減電および設定値の大小比較がなされる。Thereafter, when a new timer process is input, the current counter value is reduced and the set values are compared in size for the set value that has newly become the first priority.
このように本発明では、設定値を作動タイミングの時系
列により優先順を付加して登録しておき、実際の時間経
過に関する処理として、現在値カウンタの更新および優
先順第1位の設定値と現在値カウンタとの比較処理をお
こない、比較結果が一致したときのみタイムアツプの出
力処理をおこなう。その結果、従来おこなっていたタイ
マテーブル1に設定されている複数の設定値を処理サイ
クルごとにそれぞれ書き換える処理が不要となり、多数
のタイマ処理を設定する場合でも、タイマ設定に関して
処理の負担増にならず、他のタスク実行に対する悪影響
を回避することができる。In this way, in the present invention, the set values are registered in order of priority according to the chronological order of operation timing, and the current value counter is updated and the set value with the first priority is registered as a process related to the actual passage of time. Comparison processing with the current value counter is performed, and time-up output processing is performed only when the comparison results match. As a result, the process of rewriting multiple setting values set in timer table 1 for each processing cycle, which was previously performed, is no longer necessary, and even when setting a large number of timer processes, there is no need to increase the processing burden regarding timer settings. First, it is possible to avoid adverse effects on the execution of other tasks.
(発明の効果)
以上述べたように本発明によれば、タイマチー4゜
プルに複数のタイマ設定値が設定された場合も、最も先
に作動する設定値のみをカウントする処理だけがおこな
われるため、タイマ割り込みタスク時の処理が簡単にな
る。また、設定時間についても大小複数種の単位により
設定可能にしたため設定範囲が大きくなって長時間のタ
イマ設定が可能となり使い勝手が向上する。(Effects of the Invention) As described above, according to the present invention, even when multiple timer setting values are set in the timer pull 4, only the setting value that operates first is counted. , processing during timer interrupt tasks becomes easier. In addition, since the setting time can be set in units of various sizes, the setting range is widened, making it possible to set the timer for a long time, improving usability.
第1図は本発明の一実施例の処理概要を示す説明図、第
2図はタイマテーブルの構成図、第3図は動作を示すフ
ローチャート、第4図は設定時におけるタイマテーブル
と現在時カウンタの格納値の変化例を示す説明図、第5
図は従来例を示す図である。
1・・・タイマテーブル 2・・・現在時カウンタ第
1
図
タイマ ↑Aと7又7
第
図
タイマテーフ・lン
第−
タイマItt29スフ
タイ2劃込22:AりFIG. 1 is an explanatory diagram showing a processing overview of an embodiment of the present invention, FIG. 2 is a configuration diagram of a timer table, FIG. 3 is a flowchart showing the operation, and FIG. 4 is a timer table and current counter at the time of setting. Explanatory diagram showing an example of change in the stored value of
The figure shows a conventional example. 1... Timer table 2... Current time counter 1 Figure Timer ↑A and 7 prongs 7 Figure Timer table 1 - Timer Itt 29 Sftai 2 entry 22: A
Claims (2)
比較処理の優先順位、優先順位が第1位であるタイマ設
定についての現在時からタイムアップまでの設定時間、
優先順位が第2位以降であるタイマ設定についての直近
上位の設定時間との時間差を、タイマ設定ごとに格納す
るタイマテーブルと、一定間隔でおこなわれるタイマ割
込みタスク開始のたびごとにカウントアップして現在時
を計時する現在時カウンタと、 タイマ設定のためのタイマ要求タスクの実行開始時に、
タイマテーブル内に格納されている優先順第1位の設定
時間から現在時カウンタの計時値を減算して変更すると
ともに、現在時カウンタの計時値をクリアする手段と、 タイマ要求タスクの実行時に、タイムアップ時の処理項
目とともに入力された新たな設定時間を、すでに前記タ
イマテーブルに格納されているタイマ設定値とタイムア
ップの前後関係を比較して優先順位を決定し、得られた
優先順位にもとづき直近上位の設定値との差を算出して
タイマテーブルに格納するとともに、直近下位として格
納されている設定値を新たな設定値に基づいて補正し書
換える手段と、 を備えたことを特徴とするマルチタスク用タイマ装置。(1) Processing items when time is up, priorities for time-up comparison processing, and set time from the current time to time-up for the timer setting with the first priority;
For timer settings whose priority is second or higher, the time difference between the time and the most recent higher setting is stored in a timer table for each timer setting, and is counted up each time a timer interrupt task is started at regular intervals. When starting execution of the current time counter that measures the current time and the timer request task for setting the timer,
A means for subtracting and changing the time value of the current time counter from the first priority set time stored in the timer table and clearing the time value of the current time counter; The new setting time input together with the processing item when the time is up is compared with the timer setting value already stored in the timer table and the context of the time up to determine the priority order, and the priority order is determined based on the obtained priority order. It is characterized by comprising means for calculating the difference between the set value and the immediately higher set value and storing it in the timer table, and correcting and rewriting the set value stored as the immediately lower set value based on the new set value. Multitasking timer device.
比較処理の優先順位、優先順位が第1位であるタイマ設
定についての現在時からタイムアップまでの設定時間、
優先順位が第2位以降であるタイマ設定についての直近
上位の設定時間との時間差を、タイマ設定ごとに格納す
るタイマテーブルと、一定間隔でおこなわれるタイマ割
込みタスク開始のたびごとにカウントアップして現在時
を計時する現在時カウンタと、 カウントアップされた現在時カウンタの計時値とタイマ
テーブルの優先順第1位の設定値とを比較し、一致した
場合に両方の値をクリアするとともに前記タイマテーブ
ルの設定値に付帯して格納されていたタイムアップ時の
処理項目データを出力する手段と、 を備えたことを特徴とするマルチタスク用タイマ装置。(2) Processing items when time is up, priorities for time-up comparison processing, and set time from the current time to time-up for the timer setting with the first priority;
For timer settings whose priority is second or higher, the time difference between the time and the most recent higher setting is stored in a timer table for each timer setting, and is counted up each time a timer interrupt task is started at regular intervals. The current time counter that measures the current time is compared with the counted-up current time counter value and the first priority setting value in the timer table, and if they match, both values are cleared and the timer A multitasking timer device comprising: means for outputting processing item data at time-up that was stored incidentally to table setting values;
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2125005A JPH0424747A (en) | 1990-05-15 | 1990-05-15 | Timer device for multi-task |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2125005A JPH0424747A (en) | 1990-05-15 | 1990-05-15 | Timer device for multi-task |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0424747A true JPH0424747A (en) | 1992-01-28 |
Family
ID=14899518
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2125005A Pending JPH0424747A (en) | 1990-05-15 | 1990-05-15 | Timer device for multi-task |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0424747A (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS58166421A (en) * | 1982-03-29 | 1983-10-01 | Nec Corp | Control system for elapsed time |
| JPS61229128A (en) * | 1985-04-04 | 1986-10-13 | Mitsubishi Electric Corp | Timer managing system |
| JPS62221039A (en) * | 1986-03-20 | 1987-09-29 | Seiko Epson Corp | Timer control method |
| JPH01259430A (en) * | 1988-04-11 | 1989-10-17 | Oki Electric Ind Co Ltd | Subtracting method for interval timer value |
| JPH0217542A (en) * | 1988-07-06 | 1990-01-22 | Fuji Xerox Co Ltd | Time control system for real time monitor |
-
1990
- 1990-05-15 JP JP2125005A patent/JPH0424747A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS58166421A (en) * | 1982-03-29 | 1983-10-01 | Nec Corp | Control system for elapsed time |
| JPS61229128A (en) * | 1985-04-04 | 1986-10-13 | Mitsubishi Electric Corp | Timer managing system |
| JPS62221039A (en) * | 1986-03-20 | 1987-09-29 | Seiko Epson Corp | Timer control method |
| JPH01259430A (en) * | 1988-04-11 | 1989-10-17 | Oki Electric Ind Co Ltd | Subtracting method for interval timer value |
| JPH0217542A (en) * | 1988-07-06 | 1990-01-22 | Fuji Xerox Co Ltd | Time control system for real time monitor |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5818715A (en) | Method and system for efficiently modifying a project model in response to an update to the project model | |
| US4967386A (en) | Simulation method for modifiable simulation model | |
| JP6329038B2 (en) | Information processing apparatus, process buffer calculation method, and program | |
| JPH0424747A (en) | Timer device for multi-task | |
| US6085264A (en) | Accounting-information outputting device | |
| JP7509590B2 (en) | Work instruction presentation device and work instruction presentation method | |
| JP3003605B2 (en) | Word correction device and word correction method | |
| JPH10143400A (en) | Performance evaluation method of control computer system | |
| JPH0973407A (en) | Data management device | |
| JPS6368934A (en) | Task scheduing system | |
| EP1072993A2 (en) | Method of processing the preceding work for workflow system | |
| US5148531A (en) | System for executing a conditional statement without reading program data part that does not satisfy the conditional clause | |
| JP3075929B2 (en) | Job management method | |
| JPH0950391A (en) | Data processing device | |
| JPH0944208A (en) | Simulation method | |
| JP2003208333A (en) | Trace information retrieval apparatus and method | |
| JP2843748B2 (en) | Exclusive control method | |
| JP2901786B2 (en) | Schedule creation device | |
| JP2015028687A (en) | Device and program | |
| JPH0784786A (en) | Program execution control method | |
| JPS6010342A (en) | Reload control system of general-purpose register | |
| JPH06223084A (en) | Constraint correction support device | |
| JPS6148741B2 (en) | ||
| JP2900065B2 (en) | Programming device for programmable controller | |
| JP2001117623A (en) | Scheduling system |