JPS6186806A - Digital control arithmetic system - Google Patents

Digital control arithmetic system

Info

Publication number
JPS6186806A
JPS6186806A JP20915084A JP20915084A JPS6186806A JP S6186806 A JPS6186806 A JP S6186806A JP 20915084 A JP20915084 A JP 20915084A JP 20915084 A JP20915084 A JP 20915084A JP S6186806 A JPS6186806 A JP S6186806A
Authority
JP
Japan
Prior art keywords
calculation
sampling
time
changed
command
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
Application number
JP20915084A
Other languages
Japanese (ja)
Inventor
Shinichi Kitagawa
伸一 北川
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.)
Shimadzu Corp
Original Assignee
Shimadzu 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 Shimadzu Corp filed Critical Shimadzu Corp
Priority to JP20915084A priority Critical patent/JPS6186806A/en
Publication of JPS6186806A publication Critical patent/JPS6186806A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)
  • Feedback Control In General (AREA)

Abstract

PURPOSE:To improve the efficiency of a sampling action by changing the definition and the time needed for an operation at every time the contents of the operation are changed and calculating the total operation time of a changed operation to decide a new sampling cycle. CONSTITUTION:An operation executing means 2 executes repetitively a prescribed operation defined by an operation defining means 5 at every time an interruption is applied from a sampling command means 1 in a prescribed sampling cycle. When the operation defined by the means 5 is changed by an operation change command means 4, the time needed for operation which is stored in a memory means 3 is also changed. Then a sampling cycle calculating means 6 decides the new sampling cycle based on the total operation time of the changed operation. This new sampling cycle is informed to the sampling command means 1. In such a way, an operation is always carried out in an optimum sampling cycle despite the change of the operation.

Description

【発明の詳細な説明】 (イ)産業上の利用分野 この発明は、サンプリング周期可変型のデジタル制御演
算方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (a) Field of Industrial Application This invention relates to a digital control calculation system with a variable sampling period.

(ロ)従来技術 一般に、サンプリング周期は、演算の実行が可能な範囲
で、より短い方が効率的であり、望ましい。そのため、
サンプリング周期可変型のデジタル制御演算器では、演
算内容や演算数が変わるたびに、最短のサンプリング周
期を求めて、手動設定し直さなければならず、大変手間
を要し、面倒である。
(B) Prior Art In general, it is more efficient and desirable for the sampling period to be shorter within the range in which calculations can be executed. Therefore,
In a digitally controlled arithmetic unit with a variable sampling period, each time the content of calculations or the number of calculations changes, the shortest sampling period must be found and manually reset, which is very time-consuming and troublesome.

(ハ)目的 この発明の目的は、演算数、演算内容等の変更に応じて
、いちいちサンプリング周期を設定し直す手間を省き、
つねに効率の良いサンプリングをなし得るデジタル制御
演算方式を提供することである。
(C) Purpose The purpose of this invention is to eliminate the trouble of resetting the sampling period each time in response to changes in the number of operations, contents of operations, etc.
It is an object of the present invention to provide a digital control calculation method that can always perform efficient sampling.

(ニ)構成 この発明のデジタル制御演算方式は、上記目的を達成す
るために、第1図に示すように、所定周期のサンプリン
グ指令を出力するサンプリング指令手段1と、予め複数
の演算がプログラムされ、これら一連の演算が前記サン
プリング指令により起動されて実行される演算実行手段
2と、前記演算の種類と演算所要時間を記憶する記憶手
段3と、演算変更指令を出力する演算変更指令手段4と
、この演算変更指令により起動され、前記演算の定義・
所要時間等の変更をなす演算定義変更手段5と、演算の
定義・所要時間等の変更がなされると、変更された演算
の総演算時間を算出し、この総演算時間に基づいて、新
たなサンプリング周期を算出するサンプリング周期算出
手段6とを備え、前記演算の定義・変更がない時は、前
記サンプリング指令手段1のサンプリング指令の周期は
そのままとし、前記演算の定義・変更がある時は、前記
サンプリング指令の周期を算出した新たな周期として前
記一連の演算を実行するようにしている。
(D) Configuration In order to achieve the above object, the digital control calculation method of the present invention includes a sampling command means 1 which outputs a sampling command of a predetermined period, and a plurality of calculations programmed in advance, as shown in FIG. , a calculation execution means 2 for starting and executing a series of calculations by the sampling command, a storage means 3 for storing the type of calculation and the required time for the calculation, and a calculation change command means 4 for outputting a calculation change command. , is started by this operation change command, and changes the definition and
The calculation definition changing means 5 changes the required time, etc. When the definition and required time of the calculation are changed, the total calculation time of the changed calculation is calculated, and the new calculation time is calculated based on this total calculation time. a sampling period calculation means 6 for calculating a sampling period; when there is no definition or change of the calculation, the period of the sampling command of the sampling command means 1 is left as is; when there is a definition or change of the calculation, The series of calculations is executed using the calculated period of the sampling command as a new period.

(ホ)実施例 以下、実施例によりこの発明をさらに詳細に説明する。(e) Examples Hereinafter, this invention will be explained in more detail with reference to Examples.

第2図は、この発明の実施例のプログラム実行タイムチ
ャート例を示している。ここではコントロールプログラ
ムのもとで、優先順位を持つ2つのプログラム、つまり
演算実行プログラム(優先権を持つ)と、演算定義プロ
グラムが実行される。
FIG. 2 shows an example of a program execution time chart according to the embodiment of the present invention. Here, two programs having priority are executed under the control program, namely, an arithmetic execution program (which has priority) and an arithmetic definition program.

演算実行プログラムは、サンプリング指令による割り込
みで、演算定義プログラムは、演算変更指令による割り
込みでそれぞれ起動される。  。
The calculation execution program is started by an interruption caused by a sampling command, and the calculation definition program is started by an interruption caused by a calculation change command. .

コントロールプログラムの実行中に、サンプリング指令
が入ると、割り込みがかかり、演算実行プログラムに移
行する。演算実行プログラムにおける処理動作を、第3
図を参照して説明する。
If a sampling command is entered during execution of the control program, an interrupt is generated and the program shifts to the calculation execution program. The processing operations in the calculation execution program are
This will be explained with reference to the figures.

まず、サンプリング指令で割り込みがかかり、演算実行
プログラムが起動されると、ステ・ノブS′T1でn=
1とし、第1番目に処理すべき演算の種類と、その演算
で用いられる定数等をデータテーブルより読み込み、前
処理を行う (ステ・ノブ5T2)  。
First, when an interrupt is generated by a sampling command and the calculation execution program is started, the steering knob S'T1
1, the type of calculation to be processed first and the constants used in the calculation are read from the data table, and preprocessing is performed (Ste Nobu 5T2).

データテーブルは、第6図に示すように、1番目からn
を経てN番目までのデータテーブルが設けられ、各テー
ブルには上記したように、演算の種類(1、・・・、m
l・・・、Mの演算サブルーチンN11)と定数等がそ
れぞれ記憶されている。例えばデータテーブル1には、
演算阻2の演算の種類と定数2−1.2−2、・・・が
記憶されている。
The data table is as shown in Figure 6, from 1st to n
, up to the Nth data table is provided, and each table has the type of operation (1,..., m
, M calculation subroutines N11), constants, etc. are stored, respectively. For example, in data table 1,
The type of operation of operation function 2 and constants 2-1, 2-2, . . . are stored.

ステップST2では、nに対応してこのデータテーブル
より読み込むことになる。したがって、上記n=1の第
1の段階では、データテーブルlより演算隘2及びそれ
に関する定数が読み出される。
In step ST2, data is read from this data table corresponding to n. Therefore, in the first step where n=1, the calculation unit 2 and its related constants are read out from the data table l.

次にステップST3に移り、m=0か、すなわちデータ
テーブルnの演算サブルーチン胤が0でないか否か判定
される。そしてOでなければ、次にステップST4に移
り、演算サブルーチンmの実行を行う、。演算サブルー
チンは、1.2、・・・m・・・M個の種類が用意され
ているので、これらのサブルーチンより、前記ステップ
ST2で読み出された演算の種類のものが選択実行され
る。
Next, the process moves to step ST3, and it is determined whether m=0, that is, whether the calculation subroutine seed of data table n is not 0. If it is not O, then the process moves to step ST4, and a calculation subroutine m is executed. Since 1.2, . . . m, .

実行により得られた演算結果は記憶部の所定の領域に書
き込まれる。その後、さらにnの内容に+1を施しくス
テップ5T5) 、ステップST6でnがNに達したか
否か判定し、達していない場合にはステップST2にリ
ターンする。そして、当初はステップST5でn=2と
なっているので、次は第2番目のデータテーブルより演
算の種類及びそのデータを読み出し、前記と同様に対応
する演算サブルーチンを実行する。
The calculation results obtained by the execution are written into a predetermined area of the storage section. Thereafter, +1 is added to the contents of n (step 5T5), and it is determined in step ST6 whether n has reached N. If n has not reached N, the process returns to step ST2. Since n=2 at step ST5, the type of operation and its data are then read from the second data table, and the corresponding operation subroutine is executed in the same manner as described above.

なお、ステップST3でm = Oの場合は、ステップ
ST4の処理はスキップされる。以上のようにして、n
がNに達するまで、順次nをインクリメントして、ステ
ップST2からステップST6までの処理を繰り返す。
Note that if m = O in step ST3, the process in step ST4 is skipped. In the above manner, n
The process from step ST2 to step ST6 is repeated by sequentially incrementing n until it reaches N.

この場合演算サブルーチンの演算に要する時間はルーチ
ン毎によって異なる。この各演算サブルーチン1.2、
・・・m・・・Mの所要時間は、演算時間チルプルに記
憶されている。
In this case, the time required for the calculation of the calculation subroutine varies depending on the routine. Each calculation subroutine 1.2,
. . . m . . . The required time for M is stored in the calculation time chill pull.

その1例を第5図に示している。An example is shown in FIG.

ステップST2からステップST6までの処理がN回繰
り返されると、ステップST6の判定がYESとなり、
演算実行プログラムの動作は終了し、コントロールプロ
グラムにリターンする。そして、次の割り込み待ちを行
う。
When the processing from step ST2 to step ST6 is repeated N times, the determination in step ST6 becomes YES,
The operation of the calculation execution program ends and returns to the control program. Then, it waits for the next interrupt.

以後、サンプリング指令が入力される度に、第3図に示
す演算実行プログラムが起動され、上記と同様の動作が
繰り返される。このサンプリング指令の周期t1は、演
算の定義・変更がない限り、同じ周期t1で繰り返され
る。このサンプリング周期t1は演算実行プログラムの
データテーブル1からデータテーブルNまでに記憶され
る各演算サブルーチンの所要総時間と、第3図に示すス
テップST6等で判別に要する若干の時間を考慮して最
短の時間に選定される。
Thereafter, every time a sampling command is input, the calculation execution program shown in FIG. 3 is activated, and the same operation as described above is repeated. The period t1 of this sampling command is repeated at the same period t1 unless the calculation is defined or changed. This sampling period t1 is the shortest in consideration of the total time required for each calculation subroutine stored in data table 1 to data table N of the calculation execution program and some time required for determination in step ST6 etc. shown in FIG. will be selected at the time of

演算内容が、定義あるいは変更される場合には演算変更
指令が入力され、第4図に示す演算定義プログラムが起
動される。
When the content of the calculation is to be defined or changed, a calculation change command is input, and the calculation definition program shown in FIG. 4 is activated.

演算実行プログラムの実行中に演算変更指令が入力され
ると演算定義プログラムよりも演算実行プログラムの方
に優先度があるので、演算実行プログラムの終了をもっ
て演算定義プログラムに入る。
If a computation change command is input during execution of the computation execution program, the computation execution program has priority over the computation definition program, so the computation definition program is entered upon completion of the computation execution program.

’1M !−定義プログラムに入ると、データテーブル
の変更内容を読み込み、第5図に示す演算所要時間テー
ブルに記憶される時間の他に判断に必要な処理時間より
新たなサンプリング周期t2を算出する。この時点では
、まだテーブルのデータ変更もサンプリング周期の変更
も、実行されていない。
'1M! - When the definition program is entered, the changed contents of the data table are read, and a new sampling period t2 is calculated from the processing time necessary for judgment in addition to the time stored in the calculation required time table shown in FIG. At this point, neither the data in the table nor the sampling period has been changed yet.

次にステップ5T13で前回までのサンプリング周期t
1と新たに算出したサンプリング周期t2の比較を行う
。もし、tl>t2ならば、まず先にデータテーブルに
新たに変更すべきデータを書込んだ後(ステップ5T1
4)、続いてサンプリング周期をtlからt2の周期を
変更する(ステップ5T15)。
Next, in step 5T13, the sampling period t up to the previous time is
1 and the newly calculated sampling period t2. If tl>t2, first write the new data to be changed to the data table (step 5T1).
4) Next, the sampling period is changed from tl to t2 (step 5T15).

またステップ5T13で、t1≦t2ならば、先にサン
プリング周期をtlからt2に変更しくステップ5T1
6)、次にデータテーブルに変更データを書き込む(ス
テップ5T17)。
Also, in step 5T13, if t1≦t2, first change the sampling period from tl to t2, step 5T1
6), then write the changed data to the data table (step 5T17).

このように新たに算出したサンプリング周期t2がtl
よりも大きい場合には、先にサンプリング周期を変更し
ている。もし演算プログラム実行の途中でサンプリング
指令がきて、優先度の高い演算実行プログラムにとんで
も、演算時間がサンプリング周期を越えないようにする
ためである。
The newly calculated sampling period t2 is tl
If it is larger than , the sampling period is changed first. This is to prevent the calculation time from exceeding the sampling period even if a sampling command comes in the middle of the execution of the calculation program and the calculation execution program with a high priority is interrupted.

第2図に示した例では、演算変更指令で起動された演算
定設プログラムの実行途中に、サンプリング指令が人力
されたため、演算定義プログラムが中断され、演算実行
プログラムに移り、その後再度演算定義プログラムに戻
った場合、つまり、演算定義プログラムが2回にわかれ
て処理されている場合が示されている。
In the example shown in Figure 2, a sampling command was input manually during the execution of a calculation setting program started by a calculation change command, so the calculation definition program was interrupted, moved to the calculation execution program, and then restarted the calculation definition program. In other words, the calculation definition program is processed in two parts.

(へ)効果 この発明のデジタル制御演算方式によれば、演算数、演
算内容が変更されると、これに応じて対応するサンプリ
ング周期が算出され、そのサンプリング周期に切替えら
れるので、常に最短のサンプリング周期が得られ、効率
のよい処理をなすことができる。
(f) Effects According to the digital control calculation method of this invention, when the number of calculations or calculation contents is changed, the corresponding sampling period is calculated accordingly and the sampling period is switched to that sampling period, so the shortest sampling is always possible. A cycle can be obtained and efficient processing can be performed.

また、演算内容が変更される場合には演算変更指令が出
され、これにより自動的にサンプリング周期が算出され
、切替えられるので演算内容を変更する場合に、別にサ
ンプリング周期を算出したり、さらにそれを設定入力す
る手間が省略できるという利点がある。
In addition, when the calculation contents are changed, a calculation change command is issued, and the sampling period is automatically calculated and switched. This has the advantage of saving you the trouble of entering the settings.

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

第1図は、この発明の概略構成を示すブロック図、第2
図はこの発明の1実施例のプログラム実行タイムチャー
ト、第3図は演算実行プログラムの処理フローを示す図
、第4図は、演算定義プログラムの処理フローを示す図
、第5図は上記実施例に使用される演算サブルーチンの
所要時間テーブルの1例を示す図、第6図は、上記実施
例に使用される各データテーブルの1例を示す図である
。 l:サンプリング老令手段、 2:演算実行手段、  3:記憶手段、4:演算変更指
令手段、5:演算定義手段、6:サンプリング周期算出
手段
FIG. 1 is a block diagram showing a schematic configuration of the present invention, and FIG.
The figure is a program execution time chart of one embodiment of the present invention, Figure 3 is a diagram showing the processing flow of the calculation execution program, Figure 4 is a diagram showing the processing flow of the calculation definition program, and Figure 5 is a diagram showing the processing flow of the calculation execution program. FIG. 6 is a diagram showing an example of the required time table of the calculation subroutine used in the above embodiment, and FIG. 6 is a diagram showing an example of each data table used in the above embodiment. l: Sampling old means, 2: Calculation execution means, 3: Storage means, 4: Calculation change command means, 5: Calculation definition means, 6: Sampling period calculation means

Claims (1)

【特許請求の範囲】[Claims] (1)所定周期のサンプリング指令を出力するサンプリ
ング指令手段と、予め複数の演算がプログラムされ、こ
れら一連の演算が前記サンプリング指令により起動され
て実行される演算実行手段と、前記演算の種類と演算所
要時間を記憶する記憶手段と、演算変更指令を出力する
演算変更指令手段と、この演算変更指令により起動され
、前記演算の定義・所要時間等の変更をなす演算定義手
段と、演算の定義・所要時間等の変更がなされると、変
更された演算の総演算時間を算出し、この総演算時間に
基づいて、新たなサンプリング周期を算出するサンプリ
ング周期算出手段とを備え、前記演算の定義・変更がな
い時は、前記サンプリング指令手段のサンプリング指令
の周期はそのままとし、前記演算の定義・変更がある時
は、前記サンプリング指令の周期を算出した新たな周期
として前記一連の演算を実行するようにしたデジタル制
御演算方式。
(1) Sampling command means that outputs a sampling command at a predetermined period, a calculation execution means in which a plurality of calculations are programmed in advance and a series of calculations is started and executed by the sampling command, and the types and calculations of the calculations. a storage means for storing the required time; a calculation change command means for outputting a calculation change command; a calculation definition means activated by the calculation change command to change the definition, required time, etc. of the calculation; a sampling period calculation means that calculates the total calculation time of the changed calculation when the required time, etc. is changed, and calculates a new sampling period based on this total calculation time; When there is no change, the period of the sampling command of the sampling command means is left unchanged, and when there is a definition or change of the calculation, the series of calculations is executed as a new period calculated from the period of the sampling command. Digital control calculation method.
JP20915084A 1984-10-04 1984-10-04 Digital control arithmetic system Pending JPS6186806A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20915084A JPS6186806A (en) 1984-10-04 1984-10-04 Digital control arithmetic system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20915084A JPS6186806A (en) 1984-10-04 1984-10-04 Digital control arithmetic system

Publications (1)

Publication Number Publication Date
JPS6186806A true JPS6186806A (en) 1986-05-02

Family

ID=16568137

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20915084A Pending JPS6186806A (en) 1984-10-04 1984-10-04 Digital control arithmetic system

Country Status (1)

Country Link
JP (1) JPS6186806A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63170703A (en) * 1987-01-09 1988-07-14 Fuji Electric Co Ltd Loader command processing device
WO1992009940A1 (en) * 1990-11-22 1992-06-11 Fanuc Ltd Method for executing program for cnc equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63170703A (en) * 1987-01-09 1988-07-14 Fuji Electric Co Ltd Loader command processing device
WO1992009940A1 (en) * 1990-11-22 1992-06-11 Fanuc Ltd Method for executing program for cnc equipment

Similar Documents

Publication Publication Date Title
JP2883784B2 (en) Microcomputer
JPS62236006A (en) Processing method for numerical controller
JPS6186806A (en) Digital control arithmetic system
JPS59105110A (en) Programmable controller
CA1155232A (en) Pipelined digital signal processor using a common data and control bus
JPS58139254A (en) Programmable controller
JP3575052B2 (en) Electronic equipment
JPS58200349A (en) Microprogram controller
JPH02162914A (en) Digital signal processing processor
JPS6130282B2 (en)
JPH0198023A (en) Conditional subroutine calling system
JPS6136837A (en) Digital control arithmetic system
JPS5899843A (en) Condition branching device of microprogram
JPH05303419A (en) Storage device for robot program
JP2001075778A (en) Arithmetic unit and its method
JPS616704A (en) Programmable controller
JP2793809B2 (en) Applied instruction processing method of programmable controller
JP3663680B2 (en) Programmable controller
JPS60220468A (en) Vector arithmetic control system
JPS59189407A (en) Sequence control device
JPH05224711A (en) Control method for programmable controller
JPS63170703A (en) Loader command processing device
JPS5943446A (en) Microcomputer system
JPH05334098A (en) Method and device for interruption control
JPS6235991A (en) Image processing device