JPH07111643B2 - Sequence control method - Google Patents
Sequence control methodInfo
- Publication number
- JPH07111643B2 JPH07111643B2 JP62187898A JP18789887A JPH07111643B2 JP H07111643 B2 JPH07111643 B2 JP H07111643B2 JP 62187898 A JP62187898 A JP 62187898A JP 18789887 A JP18789887 A JP 18789887A JP H07111643 B2 JPH07111643 B2 JP H07111643B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- input
- executed
- control
- programs
- 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
Links
Landscapes
- Programmable Controllers (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、各種機械装置からなるシステムを制御するシ
ーケンス制御方式に係り、特に複数の制御用語を並列に
使用した制御方式に関する。Description: TECHNICAL FIELD The present invention relates to a sequence control method for controlling a system including various mechanical devices, and more particularly to a control method using a plurality of control terms in parallel.
自動機械制御用言語として、従来広く用いられてきた走
査型プログラムであるラダーダイアグラムに加え、近
年、例えば特開昭61−110204号に記載のように、FORTRA
N,BASICのような高級言語に準拠した逐次実行型プログ
ラムが用いられる傾向にある。一方、使用者の入力する
プログラムとして、走査型プログラムであるラダーダイ
アグラムと、逐次実行型プログラムである命令語,フロ
ーチヤート,BASIC等を選択的に用いることができるシー
ケンス制御装置の開発が、技術的な動向となつている。In addition to the ladder diagram which is a scanning type program which has been widely used as a language for automatic machine control, in recent years, as described in JP-A-61-110204, FORTRA
Sequential execution type programs based on high-level languages such as N and BASIC tend to be used. On the other hand, the development of a sequence control device that can selectively use a ladder diagram, which is a scanning type program, and command words, flow charts, BASIC, etc., which are sequential execution type programs, is a technically This is a trend.
上記従来技術は、走査型プログラムと逐次実行型プログ
ラムを単一のシーケンス制御装置で併用することについ
て配慮されておらず、以下の問題があつた。すなわち、
一般に対象が論理性の強いシステムの場合、ラダーダイ
アグラムで記述した方が容易であるが、逆に順序性の強
いシステムの場合には、BASICの方が記述しやすい等、
制御対象によつて使用言語を使い分け、制御時にはそれ
らを適当にリンケージして実行したいという要求があ
る。しかし、従来技術では、単一のシーケンス制御装置
でシステムの制御を行う場合、使用者は最初に選択した
一つの言語で一貫したプログラムを書かなければなら
ず、例えばBASICのプログラムからラダーダイアグラム
のルーチンを起動するといつた、複数言語を混在させた
記述は不可能であつた。また、多様な使用者が分担して
プログラムを記述する場合には、上記の点が制約とな
り、制御プログラムの作成能率に支障をきたす場合があ
つた。複数のシーケンス制御を用い、それぞれに別言語
で入力することができればよいが、機器構成の複雑化に
伴い価格が上昇するとともに、制御装置同士のデータ交
換等リンケージに手間がかかることが問題となる。ま
た、サーボ制御等の連続系の制御を必要とする場合に
は、位置決めユニツト等専用の制御装置を別に付加接続
して実行しなければならず、同様に高価格となる問題が
あつた。The above-mentioned prior art does not consider using a scanning type program and a sequential execution type program together in a single sequence control device, and has the following problems. That is,
In general, if the target is a system with strong logic, it is easier to describe it with a ladder diagram, but on the contrary, if the system has a strong order, BASIC is easier to describe.
There is a demand to properly use the languages to be used depending on the control target and to execute them by appropriately linking them during control. However, in the prior art, when the system is controlled by a single sequence controller, the user must write a consistent program in one language selected first, for example, a BASIC program to a ladder diagram routine. When I started up, it was impossible to write a mixture of multiple languages. Further, when various users share the program and describe the program, the above-mentioned point becomes a constraint, which may hinder the efficiency of creating the control program. It is only necessary to be able to input in different languages using multiple sequence controls, but it becomes a problem that the price increases due to the complexity of the device configuration and the linkage such as data exchange between control devices takes time and effort. . Further, when continuous control such as servo control is required, a dedicated control device such as a positioning unit must be additionally connected and executed, which also causes a problem of high price.
本発明の目的は、単一の制御装置の処理を適切に時分割
することにより、走査型制御,逐次実行型制御,連続系
の制御を並行して実行することで、安価で高機能なシー
ケンス制御装置を提供するとともに、複数の入力言語
(ラダーダイアグラム,BASICのような逐次実行型言語,N
C言語等)の制御対象に応じた混在使用を可能にするこ
とで、その使い勝手を向上させることにある。An object of the present invention is to perform a scan-type control, a sequential-execution-type control, and a continuous-system control in parallel by appropriately time-dividing the processing of a single control device, thereby providing an inexpensive and highly functional sequence. In addition to providing a control device, multiple input languages (ladder diagram, sequential execution language such as BASIC, N
It is intended to improve the usability by allowing mixed use according to the controlled object (C language etc.).
本発明は、上記目的を達成するために、所望のプログラ
ムを入力するプログラム入力手段と、プログラム入力手
段に入力されたプログラムを記憶する記憶手段と、記憶
手段の記憶内容を実行する演算手段とを有するシーケン
ス制御方式において、演算手段に所定の周期で割込信号
を発信する計時手段を備え、プログラム入力手段より入
力された逐次実行型プログラム,連続系の制御プログラ
ム,走査型プログラムの内の1のプログラムを実行中の
演算手段が割込信号により複数のプログラムの内の他の
プログラムを順次実行し、所定の単位量の演算を実行し
た後、再び1のプログラムを実行し、次の割込信号によ
り再び他のプログラムを順次実行し、この操作を繰返す
際に、連続系の制御プログラムの次に走査型プログラム
を実行するシーケンス制御方式を提案する。In order to achieve the above object, the present invention comprises a program input means for inputting a desired program, a storage means for storing the program input to the program input means, and an arithmetic means for executing the stored contents of the storage means. In the sequence control system having the above, the arithmetic means is provided with a timing means for transmitting an interrupt signal at a predetermined cycle, and one of the sequential execution type program, the continuous system control program and the scanning type program inputted from the program input means is selected. The arithmetic unit that is executing the program sequentially executes another program of the plurality of programs by the interrupt signal, executes a predetermined unit amount of arithmetic operation, and then executes the first program again, and then executes the next interrupt signal. Sequence to execute another program in sequence and repeat this operation, the sequence program to execute the scanning program next to the continuous control program. To propose a scan control method.
本発明は、また、上記目的を達成するために、所望のプ
ログラムを入力するプログラム入力手段と、プログラム
入力手段に入力されたプログラムを記憶する記憶手段
と、記憶手段の記憶内容を実行する演算手段とを有する
シーケンス制御方式において、演算手段に所定の周期で
割込信号を発信する第1計時手段と、割込信号を同時に
スタートし所定の周期より短い所定期間を計時する第2
計時手段を備え、プログラム入力手段より入力された複
数プログラムの内の1のプログラムを実行中の演算手段
が割込信号により複数のプログラムの内の他のプログラ
ムを順次実行し、所定期間を計時して再び1のプログラ
ムを実行し、次の割込信号により再び他のプログラムを
順次実行し、この操作を繰返すシーケンス制御方式を提
案するものである。In order to achieve the above object, the present invention also provides a program input means for inputting a desired program, a storage means for storing the program input to the program input means, and an arithmetic means for executing the stored contents of the storage means. In a sequence control system having: a first clock means for transmitting an interrupt signal to the arithmetic means at a predetermined cycle; and a second clock means for simultaneously starting the interrupt signal and measuring a predetermined period shorter than the predetermined cycle.
The arithmetic means, which is provided with a time measuring means and is executing one of the plurality of programs input from the program inputting means, sequentially executes the other programs of the plurality of programs in response to an interrupt signal to measure a predetermined period. Then, the program 1 is executed again, another program is sequentially executed again by the next interrupt signal, and this operation is repeated to propose a sequence control method.
前記1のプログラムが逐次実行型プログラムであり、他
のプログラムの1つが連続系の制御プログラムであり、
他のプログラムの別の1つが走査型プログラムである場
合は、連続系の制御プログラムの次に走査型プログラム
を実行する。The one program is a sequential execution type program, and one of the other programs is a continuous control program,
When another one of the other programs is a scanning type program, the scanning type program is executed next to the continuous control program.
前記1のプログラムが逐次実行型プログラムであり、他
のプログラムが走査型プログラムである場合は、走査型
プログラムを実行中、1つの出力を決定する演算に必要
な入力信号の取り込みを開始した後、入力信号の取り込
みを終了する前に所定期間が経過した場合、入力信号の
取り込みを終了するまで走査型プログラムの実行を継続
することもできる。When the one program is a sequential execution type program and the other programs are scanning type programs, after starting the acquisition of an input signal necessary for an operation for determining one output during execution of the scanning type program, If a predetermined period of time elapses before the end of the input signal acquisition, the execution of the scanning program can be continued until the end of the input signal acquisition.
本発明において、連続系の制御プログラムの後に走査型
プログラムを実行するので、タイマの節約となる。In the present invention, since the scanning type program is executed after the continuous system control program, the timer is saved.
連続系の制御プログラムと走査型プログラムとはともに
周期的に実行されるが、連続系の制御プログラムは、必
ず実行開始の起点を定周期にする必要がある。例えば、
サーボ系の速度制御演算であれば、3ms毎等に定周期に
実行する必要がある。これに対して、走査型プログラム
の実行開始時間が定周期である必要はあまりない。そこ
で、連続系の制御プログラムの後に走査型プログラムを
実行するという実行順序で演算すれば、これらのプログ
ラムの実行の起点を1つのタイマで管理できる。Both the continuous system control program and the scanning program are periodically executed, but the continuous system control program must always set the starting point of the execution start to the fixed cycle. For example,
If it is a speed control calculation of a servo system, it is necessary to execute it every 3 ms at regular intervals. On the other hand, it is not necessary that the execution start time of the scanning program is a fixed cycle. Therefore, if the scanning type program is executed after the continuous control program, the start point of the execution of these programs can be managed by one timer.
なお、走査型プログラムの実行の終わりを時間で管理す
る場合は、後述の通り、もうひとつのタイマが必要とな
る。これは、起点を2つのタイマで管理した場合も同じ
である。If the end of execution of the scanning program is managed by time, another timer will be required as described later. This is the same when the starting point is managed by two timers.
また、走査型プログラムの終了をタイマ1と同期したタ
イマ2で管理するので、走査型プログラムや逐次型プロ
グラムの実行遅延や渋滞を回避できる。Further, since the end of the scanning type program is managed by the timer 2 synchronized with the timer 1, it is possible to avoid the execution delay and the congestion of the scanning type program and the sequential type program.
走査型プログラム,実行型プログラム,連続系の制御プ
ログラムの3つの実行形態や要求の異なるプログラムを
単一の装置で実行する場合、それぞれのプログラムの優
先関係に十分配慮しないと、優先順位の低いプログラム
に処理の遅延等が生じる。通常、連続系の制御プログラ
ムが最優先されるが、走査型プログラムや逐次型プログ
ラムに優先関係は特に無い。このため、各プログラムの
実行を適当に打ち切って、処理を移行する手法が問題と
なる。走査型プログラムを一通り走査した後、逐次型プ
ログラムに移行したり、この逆を行なうのが一般的であ
るが、先に実行するプログラムの長さにより、後で実行
するプログラムの割当て時間が変動することが問題であ
った。If you want to execute three programs with different execution requirements and scanning programs, execution programs, and continuous control programs on a single device, you must give due consideration to the priority relationships of each program, and the programs with lower priorities. There is a delay in processing. Normally, the continuous control program is given the highest priority, but the scanning type program and the sequential type program have no particular priority relationship. Therefore, there is a problem in a method of appropriately terminating the execution of each program and shifting the processing. After scanning the scanning program once, it is common to move to the sequential program and vice versa, but the allocation time of the program to be executed later varies depending on the length of the program to be executed first. It was a problem to do.
本発明は、タイマ割込みに従属関係を設けることによ
り、両プログラムの間に優先順位を付けること無く、処
理時間を割当てる。したがって、特定の処理を遅延させ
ること無く、処理を平等に割り当てられる。The present invention allocates the processing time without prioritizing between the two programs by providing the timer interrupt with the subordinate relationship. Therefore, the processing can be equally assigned without delaying the specific processing.
さらに、走査型プログラムの終了のタイミングについ
て、タイマ2で終わりが指示されても、終了すべきタイ
ミングまで走査型制御の実行を継続すると、入力時刻の
不揃いによる誤出力を防止できる。Further, even when the timer 2 indicates the end timing of the scanning type program, if the scanning type control is continued until the timing at which the scanning type program is to be ended, it is possible to prevent an erroneous output due to a non-uniform input time.
走査型プログラムでは、複数の入力信号のアンド,オア
等の論理演算の結果を基に出力信号が決定される。この
ため、複数の入力信号の取り込みタイミングが異なる
と、論理演算が正常でなくなり、誤出力のおそれがあ
る。そこで、入力の一部を取り込んでいるときに、タイ
マ2により、走査型プログラムを実行割当て時間が終了
しても、すべての入力を取り込むまで、走査型制御の実
行を継続する。なお、論理演算,出力が終了するまで継
続してもよい。In the scanning program, the output signal is determined based on the result of the logical operation such as AND and OR of the plurality of input signals. Therefore, if the input timings of a plurality of input signals are different, the logical operation becomes abnormal and there is a risk of erroneous output. Therefore, while a part of the input is being taken in, even if the timer 2 finishes the execution time allotted to the scan type program, the execution of the scan type control is continued until all the inputs are taken in. It should be noted that it may be continued until the logical operation and output are completed.
以下、本発明の実施例を、第1図〜第7図に従つて詳細
に説明する。第1図に、本発明を適用する制御装置の構
成を示す。第1図の制御装置101の構成要素において、
システムメモリ111には、演算装置109が実行すべき処理
手順が、またプログラムメモリ112には、ユーザが記述
したプログラムに対応するオブジエクトデータが格納さ
れる。また、データメモリ113には、演算のために必要
なデータが格納され、必要に応じて演算装置109により
書き換えられる。演算装置109は、システムメモリ111に
示す手順に従つて動作し、プログラムメモリ112の内容
に応じた演算を実行する。演算装置109,システムメモリ
111,プログラムメモリ112,データメモリ113は、入力回
路114,出力回路115,サーボ制御回路116,時分割回路108,
通信回路110とともに、バス117によつて接続されてい
る。スイツチ102の出力は、入力接点X1を通して、入力
回路114に入力される。この信号は、バス117を介し、演
算装置109に伝えられる。演算装置109からリレー103,10
4,105をオン,オフする信号は、出力回路115を通して、
出力接点Y1,Y2,Y3からそれぞれ出力される。一方、演算
装置109がサーボ機器106に与える制御量は、サーボ制御
回路116に伝えられる。サーボ制御回路116は、その情報
とサーボ機器106からF1を通して返還される物理量(現
在位置,現在速度等)との間で必要な演算を行つたの
ち、H1を通してサーボ機器106に制御信号を出力する。
演算装置109を動作させるプログラムは、プログラム入
力装置107から入力される。プログラム入力装置107は、
入力されたプログラムを必要に応じて演算装置109で実
行できる形に編集し、通信回路110に送る。この内容
は、プログラムメモリ112に転送される。時分割回路108
は、第1のタイマ121,第2のタイマ120,割込コントロー
ラ122により構成される。それらはいずれもバス117を介
し、演算装置109と接続されており、演算装置109の指令
に従つてプログラマブルに動作する。第1のタイマ121
は、演算装置109により定められた周期ごとに、割込コ
ントローラ122に信号線118を通し、直接信号を送る。割
込コントローラ122は、この信号を割込信号として演算
装置109に、信号線119を通し直接伝える。第2のタイマ
120は、演算装置109により予め定められた一定時間を記
憶しておき、演算装置109の指令により計時を開始す
る。そして、前記一定時間の経過を、演算装置109に知
らせる。第1図では、コントローラ101が制御する機器
として、スイツチ102,リレー103,リレー104,リレー105,
サーボ機器106を接続したが、システム全体としては、
さらに他のスイツチ,リレー,サーボ機器があつてもよ
い。また、プログラム入力装置107と制御装置101を一体
化してもよい。Hereinafter, an embodiment of the present invention will be described in detail with reference to FIGS. FIG. 1 shows the configuration of a control device to which the present invention is applied. In the constituent elements of the control device 101 of FIG. 1,
The system memory 111 stores the processing procedure to be executed by the arithmetic unit 109, and the program memory 112 stores the object data corresponding to the program described by the user. Further, the data memory 113 stores data necessary for calculation and is rewritten by the calculation device 109 as necessary. The arithmetic unit 109 operates according to the procedure shown in the system memory 111, and executes arithmetic according to the contents of the program memory 112. Arithmetic unit 109, system memory
111, program memory 112, data memory 113 includes an input circuit 114, an output circuit 115, a servo control circuit 116, a time division circuit 108,
Together with the communication circuit 110, they are connected by a bus 117. The output of the switch 102 is input to the input circuit 114 through the input contact X1. This signal is transmitted to the arithmetic unit 109 via the bus 117. Arithmetic unit 109 to relay 103,10
The signal for turning on and off 4,105 is output through the output circuit 115.
Output from output contacts Y1, Y2, Y3 respectively. On the other hand, the control amount given by the arithmetic unit 109 to the servo device 106 is transmitted to the servo control circuit 116. The servo control circuit 116 performs necessary calculation between the information and the physical quantity (current position, current speed, etc.) returned from the servo device 106 through F1, and then outputs a control signal to the servo device 106 through H1. .
A program for operating the arithmetic device 109 is input from the program input device 107. The program input device 107 is
The input program is edited as needed so that it can be executed by the arithmetic unit 109, and sent to the communication circuit 110. This content is transferred to the program memory 112. Time division circuit 108
Is composed of a first timer 121, a second timer 120, and an interrupt controller 122. All of them are connected to the arithmetic unit 109 via the bus 117, and operate in a programmable manner in accordance with a command from the arithmetic unit 109. First timer 121
Sends a signal directly through the signal line 118 to the interrupt controller 122 every period determined by the arithmetic unit 109. The interrupt controller 122 directly transmits this signal as an interrupt signal to the arithmetic unit 109 through the signal line 119. Second timer
The storage unit 120 stores a predetermined period of time predetermined by the arithmetic unit 109, and starts clocking according to a command from the arithmetic unit 109. Then, the arithmetic unit 109 is notified of the elapse of the predetermined time. In FIG. 1, as devices controlled by the controller 101, a switch 102, a relay 103, a relay 104, a relay 105,
I connected the servo device 106, but as a whole system,
Other switches, relays, and servo equipment may be provided. Further, the program input device 107 and the control device 101 may be integrated.
第2図は、第1図の制御装置に所望の動作を行わせるた
めに、ユーザがプログラム入力装置107から入力する制
御プログラムの一例である。第2図は、(a)逐次実行
型プログラムと(b)走査型プログラム(ラダーダイア
グラム)からなつている。逐次実行型プログラムに関し
ては、各ラインについてコメント文に示す内容を順次演
算し、走査型プログラムに関しては、第2図で破線によ
り囲んである入出力関係を示す単位ブロツクをプログラ
ムの開始部から終了部まで順次演算することを繰り返
す。単位ブロツクは、一つの出力(第2図の場合、Y3
0)と、その出力を演算するために必要ないくつかの信
号(第2図の場合、X21とY15)とからなる。(a)のラ
イン120の“START $01"は、(b)のプログラムの実
行を開始する命令、またライン170は、その実行を終了
される命令である。プログラムの実行が部分的に遅延す
ると、システム制御上の最大遅れ時間が増大し、問題と
なるため、(a)のライン130〜ライン170と(b)は並
行して実行する必要がある。したがつて、演算装置109
の処理を時分割し、適当な比率で両方を実行することに
なる。FIG. 2 is an example of a control program input by the user from the program input device 107 in order to cause the control device of FIG. 1 to perform a desired operation. FIG. 2 is composed of (a) sequential execution type program and (b) scanning type program (ladder diagram). For the sequential execution type program, the contents shown in the comment sentence are sequentially calculated for each line, and for the scanning type program, the unit block showing the input / output relation surrounded by the broken line in FIG. Repeatedly calculate up to. The unit block has one output (Y3 in the case of FIG. 2).
0) and some signals (X21 and Y15 in the case of FIG. 2) necessary to calculate the output. “START $ 01” on line 120 in (a) is an instruction to start execution of the program in (b), and line 170 is an instruction to terminate its execution. If the execution of the program is partially delayed, the maximum delay time in system control increases, which causes a problem. Therefore, it is necessary to execute lines 130 to 170 and (b) in (a) in parallel. Therefore, the arithmetic unit 109
Will be time-shared and both will be executed at an appropriate ratio.
第3図は、このとき演算装置109が実行するアルゴリズ
ムである。まず、S1で第1のタイマ121に走査型制御の
開始周期T1をセツトしたのち、このタイマを起動する。
S2で走査型制御の実行時間をタイムアツプ時間T2とし、
第2のタイマ120にセツトする。このとき、いうまでも
なく、T1>T2でなければならない。この後、演算装置10
9の割込みをイネーブルにし、S3で(a)逐次実行型プ
ログラムをライン100から順に実行する。第1のタイマ1
21は、周期T1ごとに割込コントローラ122に信号を送
り、割込コントローラ122は、それを演算装置109へ割込
信号として伝える。割込信号を受け付けると、第3図に
示すように、演算装置109は割込処理を開始する。ま
ず、S4で第2のタイマを起動し、S5で実行すべき走査型
プログラムが存在するかどうか、すなわち走査型制御を
行うかどうかを判定する。第2図の例では、(a)のラ
イン130〜ライン170を実行しているときは、$01で示さ
れる(b)の走査型プログラムを並行して実行する。こ
の場合、S6で走査型プログラムの前述した単位ブロツク
を1つ実行し、S7で第2のタイマ120の値を読み込む。S
8でその値をもとにタイムアツプしたかどうかを判定
し、タイムアツプになつていなければ、S6で次の単位ブ
ロツクを実行する。以下、タイムアツプになるまで、S6
〜S8を繰り返す。走査型プログラムの実行の最小単位を
単位ブロツクとしたことで、各単位ブロツクの出力を得
るための複数の信号の入力途中に走査型制御の実行が終
了することはない。したがつて、各単位ブロツク演算の
タイムラグとしては、演算装置が走査型プログラムの実
行に専従している場合と等しい値が保証され、時分割を
行つたことにより生じた動作遅れが、制御装置を誤動作
することはない。(a)でライン120〜ライン170以外を
実行している場合には、S5で走査型制御を実行する必要
はないと判定され、タイムアツプを待つことなく、S3ヘ
リターンする。第3図のアルゴリズムにより、演算装置
109の処理は、結局第4図のように時分割され、二種類
の制御を並行して実行する。第4図の,は、第3図
の,と対応しており、各制御を切り換えるタイミン
グを示している。FIG. 3 shows an algorithm executed by the arithmetic unit 109 at this time. First, in S1, the scanning type control start cycle T1 is set in the first timer 121, and then this timer is started.
In S2, the execution time of scanning control is set as the time-up time T2,
Set second timer 120. At this time, needless to say, T1> T2. After this, the arithmetic unit 10
The interrupt of 9 is enabled, and the sequential execution type program is sequentially executed from line 100 in S3. First timer 1
21 sends a signal to the interrupt controller 122 in every cycle T1, and the interrupt controller 122 sends it to the arithmetic unit 109 as an interrupt signal. Upon receiving the interrupt signal, the arithmetic unit 109 starts the interrupt process as shown in FIG. First, in S4, the second timer is started, and in S5, it is determined whether or not there is a scanning program to be executed, that is, whether or not scanning control is performed. In the example of FIG. 2, when the lines 130 to 170 of (a) are being executed, the scanning type program of (b) indicated by $ 01 is executed in parallel. In this case, one unit block of the scanning program described above is executed in S6, and the value of the second timer 120 is read in S7. S
In 8 it is judged whether or not the time is up based on that value, and if it is not in time up, the next unit block is executed in S6. After that, until the time is up, S6
~ Repeat S8. Since the minimum unit of execution of the scanning type program is the unit block, the execution of the scanning type control does not end in the middle of inputting a plurality of signals for obtaining the output of each unit block. Therefore, as the time lag of each unit block calculation, a value equal to that when the calculation device is dedicated to the execution of the scanning program is guaranteed, and the operation delay caused by the time division is controlled by the control device. There is no malfunction. When the lines other than the lines 120 to 170 are executed in (a), it is determined in S5 that the scanning control need not be executed, and the process returns to S3 without waiting for the time-up. The algorithm of FIG.
The process of 109 is eventually time-divided as shown in FIG. 4, and two types of control are executed in parallel. 4 in FIG. 4 corresponds to that in FIG. 3 and shows the timing at which each control is switched.
この実施例では、逐次実行型プログラムから起動される
走査型プログラムは“$01"のみであつたが、複数の走
査型プログラムが並行して起動されている場合も、それ
らを順に走査していくことにより、第3図のアルゴリズ
ムで処理することができる。また、単位ブロツクを、本
実施例では第2図のように定義したが、演算に都合のよ
い他の形で定義してもさしつかえない。また、第2図で
は、逐次実行型プログラムから走査型プログラムの起
動,終了を管理したが、逆に走査型プログラムから逐次
実行型プログラムの実行を管理することも、同様の考え
方により可能である。さらに、第1のタイマ121の信号
を演算装置109は割込みで受け付けたが、演算装置109が
第1のタイマ121の信号を定期的に検出するポーリング
法を用いてもよい。また、この実施例では、第1図に示
したように、時分割を2つのハードタイマ121,120と割
込コントローラ122により構成したが、演算装置109がソ
フトタイマ機能を有している場合には、その一部あるい
は総てをソフトウエア上で実現することも可能である。
第1のタイマ121の機能をソフトウエアで実行する場合
には、割込コントローラ122は必要なく、ソフトウエア
割込処理を行えばよい。In this embodiment, the scanning program started from the sequential execution program is only "$ 01", but even when a plurality of scanning programs are started in parallel, they are sequentially scanned. As a result, the algorithm shown in FIG. 3 can be used. Although the unit block is defined as shown in FIG. 2 in this embodiment, it may be defined in another form convenient for calculation. Further, in FIG. 2, the start and end of the scanning type program is managed from the sequential execution type program, but conversely, the execution of the sequential execution type program from the scanning type program can be managed by the same idea. Furthermore, although the arithmetic device 109 receives the signal of the first timer 121 as an interrupt, a polling method in which the arithmetic device 109 periodically detects the signal of the first timer 121 may be used. Further, in this embodiment, as shown in FIG. 1, the time division is configured by the two hard timers 121 and 120 and the interrupt controller 122. However, when the arithmetic unit 109 has the soft timer function, It is also possible to realize some or all of them by software.
When the function of the first timer 121 is executed by software, the interrupt controller 122 is not necessary, and software interrupt processing may be performed.
次に、本発明に関する第2の実施例を示す。第5図は、
ユーザがプログラム入力装置107から入力する制御プロ
グラムの一例である。第5図は、第2図と同様の(a)
の逐次実行型プログラムと(b)走査型プログラム(ラ
ダーダイアグラム)に加え、サーボ系に対する位置決め
演算を必要とする(c)サーボ制御プログラムからなつ
ている。$02で示される(c)は、(a)のライン140
の“START $01"により起動され、ライン1000でサーボ
X軸を100に位置決めし、1100でサーボのY軸を50に位
置決めする。サーボ系に対しては安定した応答を保証す
るため、定周期のサンプリングで連続的に実行すること
が必要である。また、一度のサンプリング演算に要する
時間は、制御の内容がPTP(Point to Point)がCP(Con
tinuous Path)か、あるいは制御すべき軸数が何軸ある
かによりかなり変動するが、制御精度や応答性を劣化さ
せないために、一回のサンプリング演算は、終了するま
で続けて実行しなければならない。(b)は第2図の場
合と同様に、(a)のライン120の“START $01"で実
行を開始され、ライン170の“STOP $01"で実行を終了
される。したがつて、(a)のライン140〜ライン170
を、実行時には(b)に加え、(c)のプログラムも並
行して実行する必要がある。演算装置109の処理は、前
述したサーボ系の制御に関する要件を満たしつつ、これ
ら3つの処理に時分割されなければならない。Next, a second embodiment relating to the present invention will be shown. Figure 5 shows
3 is an example of a control program input by a user from the program input device 107. FIG. 5 shows the same (a) as FIG.
In addition to the sequential execution type program (2) and the scanning type program (ladder diagram) (b), the servo control program (c) requires positioning calculation for the servo system. (C) shown at $ 02 is line 140 of (a)
It is started by "START $ 01" of, the servo X axis is positioned at 100 on the line 1000, and the servo Y axis is positioned at 50 on the 1100. In order to guarantee a stable response to the servo system, it is necessary to continuously execute the sampling with a fixed period. In addition, the time required for one sampling calculation depends on whether the control content is PTP (Point to Point) or CP (Con
tinuous path) or the number of axes to be controlled varies considerably, but one sampling operation must be executed continuously until the end in order not to deteriorate control accuracy and responsiveness. . As in the case of FIG. 2, in (b), the execution is started at "START $ 01" on the line 120 in (a), and the execution is ended at "STOP $ 01" on the line 170. Therefore, line 140 to line 170 in (a)
In addition to (b) at the time of execution, it is necessary to execute the program of (c) in parallel. The processing of the arithmetic device 109 must be time-divided into these three processings while satisfying the above-mentioned requirements regarding the control of the servo system.
第6図は、演算装置109が実行するアルゴリズムであ
る。第3図と異なつているのは、割込処理の中に、走査
型プログラムの実行に先立ち実行すべき連続系プログラ
ムが存在するかどうか、すなわち連続系制御を行うかど
うかを判定するT5と、存在した場合に、その制御演算を
実行するT6とを追加したことである。T6からT7への歩進
は、連続系制御のサンプリング当りの演算が全て終了す
ることで行われる。第6図のアルゴリズムにより、演算
装置109の処理は、第7図のように時分割され、三種類
の制御を並行して実行する。FIG. 6 shows an algorithm executed by the arithmetic unit 109. The difference from FIG. 3 is that T5 determines whether or not there is a continuous program to be executed prior to the execution of the scanning type program in the interrupt processing, that is, whether to execute continuous system control. If it exists, T6 that executes the control operation is added. The stepping from T6 to T7 is performed when all the calculations per sampling in the continuous system control are completed. By the algorithm of FIG. 6, the processing of the arithmetic unit 109 is time-divided as shown in FIG. 7, and three types of control are executed in parallel.
この実施例では、サーボ制御プログラムを他の2つのプ
ログラムとは別に記述したが、逐次実行型プログラムや
ラダーダイアグラムの中にその内容とサーボ制御等の連
続系の制御を含んでいる場合も、同様の方式で実行する
ことができる。In this embodiment, the servo control program is described separately from the other two programs, but the same applies to the case where the contents and the continuous control such as servo control are included in the sequential execution type program or the ladder diagram. Can be implemented in the following manner.
本実施例によれば、単一のシーケンス制御装置で、逐次
実行型プログラムと走査型プログラムを並行して実行す
ることが可能となる。したがつて、使用者は自分の好み
やシステムの特色に応じて、入力言語を使い分けること
ができ、逐次実行型プログラムから走査型プログラムを
起動させる等の制御方式の異なる言語をリンクした階層
的な記述も可能となる。また、サーボ系の位置決め等の
連続系の制御が必要な場合も、これを時分割の中に組み
入れ、同様に並行して実行することができる。このと
き、連続系の制御に対して、一定のサンプリング周期が
保証され、連続系の応答を安定に保つことができる。さ
らに、走査型プログラムの実行にあつて、単位ブロツク
の複数の入力信号に生じるタイムラグとしては、シーケ
ンス制御装置が走査型プログラムの実行に専従している
場合と等しい値が保証され、時分割により生じた動作遅
れがシーケンス制御装置を誤動作させることはない。According to this embodiment, it is possible to execute the sequential execution type program and the scanning type program in parallel with a single sequence control device. Therefore, the user can use different input languages according to his / her preference and the characteristics of the system, and a hierarchical system in which languages with different control methods such as activating a scanning program from a sequential execution type program are linked hierarchically. A description is also possible. Also, when continuous system control such as positioning of the servo system is required, this can be incorporated in time division and similarly executed in parallel. At this time, a constant sampling period is guaranteed for control of the continuous system, and the response of the continuous system can be kept stable. Further, in executing the scanning type program, the time lag that occurs in a plurality of input signals of the unit block is guaranteed to be the same value as when the sequence controller is dedicated to executing the scanning type program. The operation delay does not cause the sequence controller to malfunction.
本発明によれば、複数のプログラムを入力して演算手段
により複数のうちの1のプログラムを実行し、所定時間
経過後、他のプログラムを実行し、所定の単位量の演算
を実行したのち、または一定時間経過後、再び前記1の
プログラムを実行し、以下上記作業を繰り返し実行する
ので、走査型制御,逐次実行型制御,連続系の制御を並
行して実行可能となる。また、入力言語の異なる複数の
制御対象を混在使用できるので、その使い勝手が多様化
できる。According to the present invention, after inputting a plurality of programs, one of the plurality of programs is executed by the calculating means, another program is executed after a predetermined time has elapsed, and a predetermined unit amount of calculation is executed, Alternatively, after a lapse of a certain time, the above-mentioned program 1 is executed again, and the above-mentioned work is repeatedly executed, so that the scanning type control, the sequential execution type control, and the continuous system control can be executed in parallel. In addition, since a plurality of control objects having different input languages can be mixedly used, the usability can be diversified.
第1図は本発明の一実施例の機器構成図、第2図は使用
者が入力するプログラムを示す図、第3図は演算装置が
実行するアルゴリズムを示す図、第4図は時分割を示す
図、第5図は使用者が入力するプログラムを示す図、第
6図は演算装置が実行するアルゴリズムを示す図、第7
図は時分割を示す図である。 101……制御装置、107……プログラム入力装置、108…
…時分割回路、109……演算装置。FIG. 1 is a device configuration diagram of an embodiment of the present invention, FIG. 2 is a diagram showing a program input by a user, FIG. 3 is a diagram showing an algorithm executed by an arithmetic unit, and FIG. FIG. 5, FIG. 5 is a diagram showing a program input by the user, FIG. 6 is a diagram showing an algorithm executed by the arithmetic unit, and FIG.
The figure is a diagram showing time division. 101 ... Control device, 107 ... Program input device, 108 ...
… Time division circuit, 109 …… Calculator.
───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭59−79311(JP,A) 特開 昭60−48503(JP,A) 特開 昭61−6704(JP,A) 特開 昭61−156307(JP,A) ─────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-59-79311 (JP, A) JP-A-60-48503 (JP, A) JP-A 61-6704 (JP, A) JP-A 61- 156307 (JP, A)
Claims (4)
力手段と、前記プログラム入力手段に入力されたプログ
ラムを記憶する記憶手段と、前記記憶手段の記憶内容を
実行する演算手段とを有するシーケンス制御方式におい
て、 前記演算手段に所定の周期で割込信号を発信する計時手
段を備え、 前記プログラム入力手段より入力された逐次実行型プロ
グラム,連続系の制御プログラム,走査型プログラムの
内の1のプログラムを実行中の前記演算手段が前記割込
信号により前記複数のプログラムの内の他のプログラム
を順次実行し、 所定の単位量の演算を実行した後、再び前記1のプログ
ラムを実行し、 次の前記割込信号により再び前記他のプログラムを順次
実行し、 この操作を繰返す際に、 前記連続系の制御プログラムの次に前記走査型プログラ
ムを実行することを特徴とするシーケンス制御方式。1. A sequence control system having a program input means for inputting a desired program, a storage means for storing the program input to the program input means, and a calculation means for executing the stored contents of the storage means. The computing means is provided with a clocking means for transmitting an interrupt signal at a predetermined cycle, and executes one program of a sequential execution type program, a continuous system control program, and a scanning type program input from the program input means. The arithmetic means in the sequence sequentially executes another program of the plurality of programs in response to the interrupt signal, executes a predetermined unit amount of arithmetic operation, and then executes the first program again to execute the next interrupt. The other program is sequentially executed again by the input signal, and when this operation is repeated, the scanning is performed next to the control program of the continuous system. Sequence control system and executes the program.
力手段と、前記プログラム入力手段に入力されたプログ
ラムを記憶する記憶手段と、前記記憶手段の記憶内容を
実行する演算手段とを有するシーケンス制御方式におい
て、 前記演算手段に所定の周期で割込信号を発信する第1計
時手段と、前記割込信号を同時にスタートし前記所定の
周期より短い所定期間を計時する第2計時手段を備え、 前記プログラム入力手段より入力された複数プログラム
の内の1のプログラムを実行中の前記演算手段が前記割
込信号により前記複数のプログラムの内の他のプログラ
ムを順次実行し、 前記所定期間を計時して再び前記1のプログラムを実行
し、 次の前記割込信号により再び前記他のプログラムを順次
実行し、 この操作を繰返すことを特徴とするシーケンス制御方
式。2. A sequence control system having a program input means for inputting a desired program, a storage means for storing the program input to the program input means, and a calculation means for executing the stored contents of the storage means. A first clock means for transmitting an interrupt signal to the arithmetic means at a predetermined cycle, and a second clock means for simultaneously starting the interrupt signal and measuring a predetermined period shorter than the predetermined cycle, the program input The arithmetic means, which is executing one program of the plurality of programs input from the means, sequentially executes another program of the plurality of programs by the interrupt signal, measures the predetermined period, and again 1 program is executed, the other program is sequentially executed again by the next interrupt signal, and this operation is repeated. Sequence control system.
制御方式において、 前記1のプログラムが逐次実行型プログラムであり、前
記他のプログラムの1つが連続系の制御プログラムであ
り、前記他のプログラムの別の1つが走査型プログラム
であり、 前記連続系の制御プログラムの次に前記走査型プログラ
ムを実行することを特徴とするシーケンス制御方式。3. The sequence control method according to claim 2, wherein the one program is a sequential execution type program, one of the other programs is a continuous system control program, and the other program is Another one of the programs is a scanning type program, and the scanning type program is executed next to the continuous system control program.
制御方式において、 前記1のプログラムが逐次実行型プログラムであり、前
記他のプログラムが走査型プログラムであり、 前記走査型プログラムを実行中、1つの出力を決定する
演算に必要な入力信号の取り込みを開始した後、前記入
力信号の取り込みを終了する前に前記所定期間が経過し
た場合、前記入力信号の取り込みを終了するまで前記走
査型プログラムの実行を継続することを特徴とするシー
ケンス制御方式。4. The sequence control method according to claim 2, wherein the one program is a sequential execution type program, the other program is a scanning type program, and the scanning type program is being executed. If the predetermined period of time elapses after the acquisition of the input signal necessary for the operation for determining one output is started and before the acquisition of the input signal is completed, the scanning type is continued until the acquisition of the input signal is completed. A sequence control method characterized by continuing program execution.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62187898A JPH07111643B2 (en) | 1987-07-28 | 1987-07-28 | Sequence control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62187898A JPH07111643B2 (en) | 1987-07-28 | 1987-07-28 | Sequence control method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6431203A JPS6431203A (en) | 1989-02-01 |
| JPH07111643B2 true JPH07111643B2 (en) | 1995-11-29 |
Family
ID=16214126
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP62187898A Expired - Fee Related JPH07111643B2 (en) | 1987-07-28 | 1987-07-28 | Sequence control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07111643B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5120424B2 (en) * | 2010-07-27 | 2013-01-16 | 横河電機株式会社 | Sequence control device |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5979311A (en) * | 1982-10-29 | 1984-05-08 | Hitachi Ltd | Sequence controlling device |
| JPS6048503A (en) * | 1983-08-26 | 1985-03-16 | Hitachi Ltd | control method |
| JPS616704A (en) * | 1984-06-21 | 1986-01-13 | Omron Tateisi Electronics Co | Programmable controller |
| JPS61156307A (en) * | 1984-12-27 | 1986-07-16 | Toyoda Mach Works Ltd | Sequence controller |
-
1987
- 1987-07-28 JP JP62187898A patent/JPH07111643B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6431203A (en) | 1989-02-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4663730A (en) | Sequence controller | |
| US5361369A (en) | Synchronous method of, and apparatus for, allowing a processor to process a next task before synchronization between a predetermined group of processors | |
| US4920486A (en) | Distributed arbitration apparatus and method for shared bus | |
| US5636124A (en) | Multitasking industrial controller | |
| JP2002517035A (en) | Distributed computing environment using real-time scheduling logic and time-deterministic architecture | |
| EP0025087A2 (en) | Pipeline Control apparatus for generating Instructions in a Digital Computer | |
| US5459462A (en) | Keyboard controller state machine | |
| Anderson et al. | Accurately timed generation of discrete musical events | |
| JPH11514120A (en) | Method for regulating the performance of application programs in digital computers | |
| US5038274A (en) | Interrupt servicing and command acknowledgement system using distributed arbitration apparatus and shared bus | |
| JPH07111643B2 (en) | Sequence control method | |
| US4736336A (en) | Asynchronous demand selector with multi-tape delay line | |
| US5276900A (en) | Master connected to common bus providing synchronous, contiguous time periods having an instruction followed by data from different time period not immediately contiguous thereto | |
| EP0077835A1 (en) | Data exchanging method and device | |
| US4907190A (en) | Computer control system and method for effecting sequence controls and servo-controls | |
| US6560715B1 (en) | Sequencer of synchronous actions in a processor system, and integrated circuit including such sequencer | |
| JPS6315628B2 (en) | ||
| US5752061A (en) | Arrangement of data processing system having plural arithmetic logic circuits | |
| EP1008054A1 (en) | Real time software system | |
| JP2512119B2 (en) | Microprocessor | |
| JP4349687B2 (en) | Programmable controller | |
| JP2870812B2 (en) | Parallel processor | |
| JPH0573296A (en) | Microcomputer | |
| Kaplan | Clock-driven FORTRAN task scheduling in a multiprogramming environment | |
| JPH05158710A (en) | Timer managing system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |