JPH0461378B2 - - Google Patents

Info

Publication number
JPH0461378B2
JPH0461378B2 JP61175561A JP17556186A JPH0461378B2 JP H0461378 B2 JPH0461378 B2 JP H0461378B2 JP 61175561 A JP61175561 A JP 61175561A JP 17556186 A JP17556186 A JP 17556186A JP H0461378 B2 JPH0461378 B2 JP H0461378B2
Authority
JP
Japan
Prior art keywords
program
cycle
programs
same
time
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 - Lifetime
Application number
JP61175561A
Other languages
Japanese (ja)
Other versions
JPS6332636A (en
Inventor
Masanori Hikichi
Hiroshi Sugiura
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.)
Fuji Electric Co Ltd
Fuji Facom Corp
Original Assignee
Fuji Electric Co Ltd
Fuji Facom 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 Fuji Electric Co Ltd, Fuji Facom Corp filed Critical Fuji Electric Co Ltd
Priority to JP17556186A priority Critical patent/JPS6332636A/en
Publication of JPS6332636A publication Critical patent/JPS6332636A/en
Publication of JPH0461378B2 publication Critical patent/JPH0461378B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、プログラマブルコントローラのア
プリケーシヨンプログラムの如く、一定時間毎の
割込み処理にて実行される定周期割込みプログラ
ムの起動方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for starting a fixed periodic interrupt program, such as an application program of a programmable controller, which is executed by interrupt processing at fixed time intervals.

〔従来の技術〕[Conventional technology]

定周期プログラムの起動に当たつては、各プロ
グラムの周期Tをセツトしておく定周期テーブル
が用いられる。第3図に定周期テーブルの例を示
す。この定周期テーブルには同図の如く、定周期
割込プログラム番号(No.)と、周期T(T1,T2
…)とが格納される。
When starting a fixed cycle program, a fixed cycle table is used in which the cycle T of each program is set. FIG. 3 shows an example of a periodic table. As shown in the figure, this fixed period table contains the fixed period interrupt program number (No.) and the period T (T 1 , T 2 . . .
...) are stored.

第4図に定周期テーブル作成のための手順を示
す。すなわち、イニシヤル時に各プログラムの検
索を行い(参照)、次いで定周期テーブルを作
成し(参照)、このテーブルに各プログラムの
周期をセツトして完了する(参照)。
FIG. 4 shows the procedure for creating a periodic table. That is, at the initial time, each program is searched (reference), then a fixed cycle table is created (reference), the cycle of each program is set in this table, and the process is completed (reference).

こうして作成された定周期テーブルにもとづ
き、第5図の如き手順で各プログラムが実行され
る。
Based on the fixed-period table thus created, each program is executed according to the procedure shown in FIG.

まず、プログラム登録数が零か否かの判定が行
われる(参照)。通常は零でないので、タイマ
による割込処理により、登録されている全定周期
プログラムの周期(周期に対応するカウント値)
が1つずつ順次カウントダウンされる(参照)。
次いで、周期が零となつたプログラムの起動フラ
グを全てセツトし(参照)、以後はこのフラグ
とプログラムの優先(割込)レベルに応じた処理
が行われる(,参照)。つまり、周期が零と
なつたプログラムのうち、最も割込レベルの高い
プログラムの周期をプリセツトし(参照)、プ
ログラム起動処理をして(参照)、プログラム
を実行する(参照)。この処理が終ると再びセ
ツトされている起動フラグがあるか否かを調べ、
あればその割込レベルの高いものからの参照をす
る手順を、セツトされている起動フラグが無くな
るまで繰り返す。このとき、同一の割込レベルを
もつ同一周期のプログラムが複数ある場合は、そ
れらは同時に起動され、レベル内の登録優先順位
に従つて順次実行されることになる。
First, it is determined whether the number of registered programs is zero (see). Normally, it is not zero, so by interrupt processing by the timer, the period (count value corresponding to the period) of all registered periodic programs is
are counted down one by one (see).
Next, all activation flags of programs whose cycles have become zero are set (see), and thereafter processing is performed according to these flags and the priority (interrupt) level of the program (see, ). That is, among the programs whose cycle has become zero, the cycle of the program with the highest interrupt level is preset (see), program startup processing is performed (see), and the program is executed (see). When this process is finished, check whether there is a startup flag that has been set again.
If so, the procedure of referring to the one with the higher interrupt level is repeated until there are no more activation flags set. At this time, if there are multiple programs with the same interrupt level and the same cycle, they will be started at the same time and will be executed sequentially according to the registered priority within the level.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

しかしながら、このような方式では同じ割込レ
ベルで第1番目に実行されるプログラムの処理時
間にバラツキが生じると、第2番目以降に実行さ
れるプログラム周期にずれが生じると云う問題が
ある。
However, with this method, there is a problem in that if there is variation in the processing time of the first program to be executed at the same interrupt level, there will be a shift in the cycle of the second and subsequent programs.

この点を具体的に示したのが第6図である。こ
れは、同一割込レベルをもつ同一周期のプログラ
ムはこゝではA,Bの如く2つで、プログラムB
よりもAの方が登録優先順位が高く、プログラム
Aが第5図に示す割込処理プログラムのスタート
時点tSから一定周期(T)経過後の時刻t0で実行され
たときの処理時間をt1、時刻t0から一定周期(T)経
過後の処理時間をt2とした場合の例を示してお
り、このときのプログラムBの周期は、 T±(t2−t1) となり、プログラムAの処理時間に影響を受けて
一定周期が確保されないことになる。
FIG. 6 specifically shows this point. This means that there are two programs with the same interrupt level and the same cycle, such as A and B, and program B.
A has a higher registration priority than program A, and the processing time when program A is executed at time t 0 after a certain period (T) has elapsed from the start time t S of the interrupt processing program shown in FIG. An example is shown in which t 2 is the processing time after a certain period (T) has elapsed from time t 1 and time t 0 , and the period of program B at this time is T±(t 2 - t 1 ), A constant cycle cannot be secured due to the influence of the processing time of program A.

したがつて、この発明は上述の如き同一割込レ
ベルもつ同一周期のプログラムにおいて、プログ
ラムの処理時間の違いによる周期Tのずれをなく
し、同一割込レベルもつ同周期のプログラムを一
定の周期で実行可能とすることを目的とする。
Therefore, the present invention eliminates the deviation in the period T due to the difference in processing time of the programs with the same interrupt level and the same cycle as described above, and executes the programs with the same interrupt level and the same cycle at a constant cycle. The purpose is to make it possible.

〔問題点を解決するための手段〕[Means for solving problems]

同一の割込レベルをもち同一周期で実行される
複数の定周期割込プログラムの各々について、動
作周期と基準時点からの起動遅れ時間とをそれぞ
れテーブルに設定し、起動遅れ時間が経過したプ
ログラムからの動作周期に基づいて一定周期をも
つて順次起動する。
For each of multiple fixed-cycle interrupt programs that have the same interrupt level and are executed at the same cycle, set the operating cycle and start-up delay time from the reference time in a table, and start the program after the start-up delay time has elapsed. They are activated sequentially at a fixed cycle based on the operating cycle of.

〔作用〕[Effect]

定周期割込プログラムの各々に起動遅れ時間を
設定することにより、同一割込レベルをもつ同一
周期のプログラムが同一レベルの他のプログラム
の実行時間に影響を受けないようにし、常に一定
の周期で実行されるようにして安定性,信頼性を
向上させる。
By setting a startup delay time for each fixed-cycle interrupt program, programs with the same interrupt level and the same cycle can be prevented from being affected by the execution time of other programs with the same level, and can always be executed at a constant cycle. improve stability and reliability.

〔実施例〕〔Example〕

第1図はこの発明の実施例を説明するためのフ
ローチヤート、第2図はこの発明による動作を説
明するためのタイムチヤートである。
FIG. 1 is a flow chart for explaining an embodiment of the present invention, and FIG. 2 is a time chart for explaining the operation of the present invention.

まず、各プログラムに番号を付与するとゝも
に、それぞれの動作周期T、プログラムスタート
時からの起動遅れ時間Tiを或る特別の命令(例え
ば、Prog命令)により予め定義しておき、その
イニシヤル時に第1図の如き手順により、起動遅
れ時間Tiを第3図と同様の定周期テーブルにセツ
トする。その後は、従来の場合と同様にTiを1ず
つカウントダウンし、零になつた時点で対応する
プログラムを実行すると同時に、周期Tを定周期
テーブルにセツトすることにより、該当プログラ
ムが周期Tで実行されるようにする。なお、上記
のプログラム番号は、割込レベルや優先順位等も
考慮した形で各プログラムに与ええられるものと
する。
First, a number is assigned to each program, and the operating period T and startup delay time T i from the start of the program are defined in advance by a certain special instruction (for example, the Prog instruction), and the initial At times, the startup delay time T i is set in a fixed periodic table similar to that shown in FIG. 3 using the procedure shown in FIG. After that, as in the conventional case, T i is counted down by 1, and when it reaches zero, the corresponding program is executed, and at the same time, the period T is set in the fixed period table, so that the corresponding program is executed at the period T. to be done. Note that the above program number is given to each program in consideration of the interrupt level, priority, etc.

以上の様子を示すのが第2図である。こゝでは
同じ割込レベルをもち同じ周期Tで実行されるプ
ログラムがA,Bと2つある場合で、プログラム
A,Bの起動遅れ時間がそれぞれT10,T20に設
定された例が示されている。
FIG. 2 shows the above situation. This example shows a case where there are two programs A and B that have the same interrupt level and are executed at the same cycle T, and the startup delay times of programs A and B are set to T 10 and T 20 , respectively. has been done.

このように、プログラムコントローラの定周期
割込プログラムに起動遅れ時間を設定可能とする
とにより、同一割込レベルもつ同一周期Tのプロ
グラムが同一レベルの他のプログラムの実行時間
のバラツキに関係なく、常に周期Tで正確に実行
されることになる。
In this way, by making it possible to set the startup delay time for the fixed-cycle interrupt program of the program controller, programs with the same interrupt level and the same period T can always be executed regardless of variations in the execution time of other programs at the same level. It will be executed exactly in period T.

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

この発明によれば、同一の割込レベルをもち同
一周期で実行される複数の定周期割込プログラム
の各々について、動作周期と基準時点からの起動
遅れ時間とをそれぞれテーブルに設定するように
したので、同一割込レベルもつ同一周期のプログ
ラムの処理時間による周期のずれをなくし、一定
の周期で実行することができるだけでなく、各プ
ログラムの周期、位相を変更したり、新たな処理
を追加するにもプログラムの変更がないため、作
業が容易になるという利点がもたらされる。
According to this invention, for each of a plurality of fixed-cycle interrupt programs that have the same interrupt level and are executed at the same cycle, the operation cycle and startup delay time from a reference time are respectively set in a table. Therefore, it is not only possible to eliminate cycle deviations due to processing time of programs with the same interrupt level and the same cycle, and to execute them at a constant cycle, but also to change the cycle and phase of each program, or to add new processing. The advantage is that there are no changes to the program, making it easier to work with.

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

第1図はこの発明の実施例を説明するためのフ
ローチヤート、第2図はこの発明による動作を説
明するためのタイムチヤート、第3図は定周期テ
ーブルを示す概要図、第4図は定周期テーブル作
成手順を説明するためのフローチヤート、第5図
は割込処理手順を説明するためのフローチヤー
ト、第6図は従来の定周期プログラム起動方式に
よる動作例を示すタイムチヤートである。 符号説明、T,T1,T2……周期、Ti,T10
T20……起動遅れ時間、t1,t2……処理時間。
FIG. 1 is a flow chart for explaining an embodiment of the present invention, FIG. 2 is a time chart for explaining the operation of the present invention, FIG. 3 is a schematic diagram showing a fixed period table, and FIG. FIG. 5 is a flowchart for explaining the periodic table creation procedure, FIG. 5 is a flowchart for explaining the interrupt processing procedure, and FIG. 6 is a time chart showing an example of operation by the conventional fixed-period program starting method. Symbol explanation, T, T 1 , T 2 ...period, T i , T 10 ,
T 20 ...Startup delay time, t 1 , t 2 ...Processing time.

Claims (1)

【特許請求の範囲】 1 同一の割込みレベルをもち同一周期で実行さ
れる複数の定周期割込プログラムにおいて、 該定周期割込プログラムの各々について、動作
周期と基準時点からの起動遅れ時間とをそれぞれ
テーブルに設定し、 前記起動遅れ時間が経過したプログラムから前
記動作周期に基づいて一定周期をもつて順次起動
することを特徴とする定周期割込プログラムの起
動方式。
[Claims] 1. In a plurality of fixed-period interrupt programs having the same interrupt level and executed in the same cycle, for each of the fixed-period interrupt programs, the operating cycle and startup delay time from a reference time are defined. A method for starting a fixed-cycle interrupt program, characterized in that the programs are set in a table, and the program is sequentially started at a constant cycle based on the operation cycle, starting from the program for which the start-up delay time has elapsed.
JP17556186A 1986-07-28 1986-07-28 Starting system for fixed cycle interruption program Granted JPS6332636A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17556186A JPS6332636A (en) 1986-07-28 1986-07-28 Starting system for fixed cycle interruption program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17556186A JPS6332636A (en) 1986-07-28 1986-07-28 Starting system for fixed cycle interruption program

Publications (2)

Publication Number Publication Date
JPS6332636A JPS6332636A (en) 1988-02-12
JPH0461378B2 true JPH0461378B2 (en) 1992-09-30

Family

ID=15998232

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17556186A Granted JPS6332636A (en) 1986-07-28 1986-07-28 Starting system for fixed cycle interruption program

Country Status (1)

Country Link
JP (1) JPS6332636A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2732788B1 (en) * 1995-04-06 1997-05-30 Bull Sa DEVICE FOR MANAGING SELECTIVE CYCLIC CALLS FOR MONITORING COMPUTER RESOURCES IN A NETWORK AND METHOD IMPLEMENTED BY SUCH A DEVICE
US9727124B2 (en) 2011-04-19 2017-08-08 Apple Inc. Power saving application update in a portable electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5238368A (en) * 1975-09-16 1977-03-24 Umekichi Mochizuki Process for reusing paper tndustry sludge
JPS5739452A (en) * 1980-08-20 1982-03-04 Toshiba Corp Timer interruption system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5238368A (en) * 1975-09-16 1977-03-24 Umekichi Mochizuki Process for reusing paper tndustry sludge
JPS5739452A (en) * 1980-08-20 1982-03-04 Toshiba Corp Timer interruption system

Also Published As

Publication number Publication date
JPS6332636A (en) 1988-02-12

Similar Documents

Publication Publication Date Title
JPH0461378B2 (en)
JP2001331461A (en) Multiprocessor system and method of processor scheduling
JPH0542685B2 (en)
JP3011471B2 (en) Control method of form output processing
JPS5916054A (en) Microprocessor
JPH03265033A (en) Terminal program actuation management system
JPH01140339A (en) Constant time start up system
JPH02250122A (en) Cpu simulator
JPH0462093B2 (en)
JPS5995651A (en) Altering method of memory data
JPS6214235A (en) Information processor
JPH04287234A (en) Process multiplicity control system
JPH07175406A (en) Scan start control system of programmable controller
JPS6011946A (en) Programmable controller
JPH09160791A (en) Program load adjustment device
JPH0414109A (en) Brand control sequence controller
JPH04266120A (en) System for managing fixed cycle program
JPH02195439A (en) Programmable control device
JPH0447336A (en) Task synchronization controlling method for multi-task system
JP2001100802A (en) Acceleration/deceleration controller
JPH02282805A (en) Numerical controller for numerically controlled machine tool
JPH0325653A (en) On-line command control system
JPH0654444B2 (en) Programmable controller control system
JPH0236455A (en) Batch processing start control system
JPH06149592A (en) Interruption processing system for microcomputer

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees