JPS5927928B2 - sequence controller - Google Patents

sequence controller

Info

Publication number
JPS5927928B2
JPS5927928B2 JP4833376A JP4833376A JPS5927928B2 JP S5927928 B2 JPS5927928 B2 JP S5927928B2 JP 4833376 A JP4833376 A JP 4833376A JP 4833376 A JP4833376 A JP 4833376A JP S5927928 B2 JPS5927928 B2 JP S5927928B2
Authority
JP
Japan
Prior art keywords
sequence
program
stage
test
step number
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
Application number
JP4833376A
Other languages
Japanese (ja)
Other versions
JPS52131082A (en
Inventor
恭輔 芳賀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toyoda Koki KK
Original Assignee
Toyoda Koki KK
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 Toyoda Koki KK filed Critical Toyoda Koki KK
Priority to JP4833376A priority Critical patent/JPS5927928B2/en
Publication of JPS52131082A publication Critical patent/JPS52131082A/en
Publication of JPS5927928B2 publication Critical patent/JPS5927928B2/en
Expired legal-status Critical Current

Links

Landscapes

  • Control By Computers (AREA)
  • Programmable Controllers (AREA)

Description

【発明の詳細な説明】 本発明は工作機械等の制御に用いられるシーケンスコン
トローラ、詳しくは、予めプログラムされ記憶装置に記
憶されているシーケンスプログラムを順次読出し、読出
したシーケンスプログラムに従つて、押ボタンスイッチ
、リミットスイッチ等の入力要素および継電器、ソレノ
イド等の出力要素の選択、選択された入出力要素のオン
オフのテスト、テスト結果に基づく出力要素の付勢、無
勢を実行することにより制御対象を制御するシーケンス
コントローラに関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a sequence controller used for controlling machine tools, etc., and more specifically, a sequence controller that is used to control machine tools, etc. Control the controlled object by selecting input elements such as switches and limit switches and output elements such as relays and solenoids, testing the on/off of the selected input/output elements, and energizing and deenergizing the output elements based on the test results. The present invention relates to a sequence controller.

従来、かかるシーケンスコントローラのシーケンスプロ
グラムを作成するためには、まず最初に被制御対象の動
作を基にサイクル線図を作成し、そのサイクル線図によ
つてリレーマトリクスを設計した上で、このリレーマト
リクスをシーケンスプログラム化する方法がとられてい
た。
Conventionally, in order to create a sequence program for such a sequence controller, first a cycle diagram is created based on the operation of the controlled object, a relay matrix is designed based on the cycle diagram, and then this relay matrix is designed based on the cycle diagram. The method used was to program the matrix into a sequence program.

例えば、第1図に示すような機械においてドリルユニッ
トを前進させワークを加工し、加工終了後ドリルユニッ
トを後退させるf5I脚を行うためのシーケンスプログ
ラムを作成する場合には、まず、第2図に示すようなサ
イクル線図を作成する。
For example, when creating a sequence program for performing the f5I leg in which the drill unit moves forward to process a workpiece in a machine such as the one shown in Figure 1, and the drill unit retreats after finishing machining, first, Create a cycle diagram as shown.

このサイクル線図において、ステップを移行させる条件
がサイクル線図の上側に書か札 ステップを移行させる
ために付勢もしくは無勢する出力要素が書かれている。
このサイクル線図を基に設計したリレーマトリクスが第
3図に示すものでこのリレーマトリクスに基づいてシー
ケンスプログラムが作成される。ただし、プログラムに
使用されている命令語は第1表に示すような意味を有し
ている。また、プログラムには入出力要素もしくはダミ
ーの接続されている入出力アドレスもしくはダミーに変
わるメモリのアドレスが書かれるが、簡単のため、入出
力要素、ダミー等の名称を書いて入出力アドレスまたは
メモリアドレスとしている。これは以後の説明について
も同様である。以上のようなプログラム作成の中でリレ
ーマトリクスからシーケンスプログラムを作成するは比
較的容易であるが、サイクル線図からリレーマトリクス
を設計するには、各動作問のインタロツクを考えて行わ
なければならず、さらに第1図に示すような機械を制御
する場合にはサイクル線図から明らかなように前進条件
と停止条件が全く同一であるため、ユニツトが前進した
ことを記憶しておく回路が必要となつてくるなど、サイ
クル線図から簡単に設計することはできない。
In this cycle diagram, the conditions for transitioning a step are written above the cycle diagram.The output elements that are energized or deenergized to transition a step are written on the top of the cycle diagram.
A relay matrix designed based on this cycle diagram is shown in FIG. 3, and a sequence program is created based on this relay matrix. However, the command words used in the program have meanings as shown in Table 1. Also, in the program, the input/output address to which the input/output element or dummy is connected, or the address of the memory that will be replaced by the dummy, is written, but for simplicity, the name of the input/output element, dummy, etc. is written and the input/output address or memory address is written. This is the address. This also applies to subsequent explanations. It is relatively easy to create a sequence program from a relay matrix in the program creation process described above, but in order to design a relay matrix from a cycle diagram, it is necessary to consider the interlocks of each operation problem. Furthermore, when controlling a machine like the one shown in Figure 1, the advance conditions and stop conditions are exactly the same, as is clear from the cycle diagram, so a circuit is required to remember when the unit has moved forward. It cannot be easily designed from a cycle diagram.

したがつて、サイクル線図からシーケンスプログラムを
作成するには多大の手数を必要としていた。また被制御
対象の動作に変更が生じた場合にも、リレーマトリクス
の設計を変更した後シーケンスプログラムの書替えを行
わなければならず、被制御対象の改造などがあると簡単
には対処できない欠点を有していた。また、一般のシー
ケンスコントローラにおいては、プログラムされたシー
ケンスプログラムの全てを読出して実行しているため、
ステツプ数が増加して制御が複雑になつたり、複数台の
機械を一台のシーケンスコントローラで同時に制御する
場合などプログラム数が著しく増大した場合には全プロ
グラムを1回実行するスキヤンタイムが長くなり、制御
に影響を与える欠点を有していた。
Therefore, creating a sequence program from a cycle diagram requires a great deal of effort. Furthermore, even if the operation of the controlled object changes, the sequence program must be rewritten after changing the design of the relay matrix, and if the controlled object is modified, there are drawbacks that cannot be easily addressed. had. In addition, in general sequence controllers, all programmed sequence programs are read and executed, so
When the number of steps increases and control becomes complicated, or when the number of programs increases significantly, such as when controlling multiple machines at the same time with one sequence controller, the scan time to execute all programs once becomes longer. , had drawbacks that affected control.

本発明は上記のような欠点をなくすためになされたもの
で、第5図に示すようにサイクル線図の各動作ステツプ
ごとにステツプ番号を付し、第6図に示すように各動作
ステツプごとに、そのステツプを移行させる入力条件と
、この入力条件が満足したときに有効にされ、ステツプ
を移行させるための出力命令および次に行われるステツ
プ番号をプログラムしたシーケンスプログラムを用い、
このシーケンスプログラムから読出されたステツプ番号
を現在行われているステツプ動作として記憶し、この記
憶されたステツプ動作に関係したシーケンスプログラム
のみを実行することにより、サイクル線図から直接プロ
グラムできる簡単なシーケンスプログラムを用いること
ができ、さらにシーケンス動作のステツプ数が増大した
場合および複数台の機械を一台のシーケンスコントロー
ラで制御する場合など、シーケンスプログラム量が増大
しても全くスキヤンタイムが長くなることがないシーケ
ンスコントローラを提供するものである。以下本発明の
実施例を図面に基づき説明する。
The present invention has been made in order to eliminate the above-mentioned drawbacks, and as shown in FIG. Then, by using a sequence program programmed with an input condition for transitioning the step, an output command that is activated when the input condition is satisfied, and an output command for transitioning the step and the step number to be performed next,
A simple sequence program that can be programmed directly from the cycle diagram by storing the step number read from this sequence program as the step operation currently being performed and executing only the sequence program related to this stored step operation. Furthermore, the scan time will not increase at all even if the amount of sequence programs increases, such as when the number of steps in sequence operation increases or when multiple machines are controlled by one sequence controller. It provides a sequence controller. Embodiments of the present invention will be described below based on the drawings.

第7図は本発明の第1の実施例を示すもので、ミニコン
ピユータ等のコンピユータでシーケンス制御を行なう場
合の構成を示すプロツク線図である。入力回路10は被
制御機械の動作状態を検出するリミツトスイツチおよび
押ボタンスイツチ等の入力要素より与えられる検出信号
をCレベルの信号に変換するとともにインタフエース1
1より与えられる入出力アドレスデータにて、信号変換
された入力要素のオンオフ状態の1つを選択し出力する
。出力回路12は継電器、ソレノイド等の出力要素の内
の1つを入出力アドレスデータにて選択し、インタフエ
ース11より与えられる出力命令により、選択された出
力要素を付勢もしくは無勢する。また、入出力アドレス
データにて選択された出力要素のオンオフ状態を出力す
る。コンピユータ13はあらかじめプログラムされてい
る実行プログラムに基づいてシーケンスプログラムの実
行を行うようになつており、読出されたシーケンスプロ
グラムがテスト命令であれば、インタフエース11を介
して入力回路10および出力回路12に入出力アドレス
ゼータを与え、入出力要素の1つを選択してそのオンオ
フ状態を読み込む。また、シーケンスプログラムが出力
命令であれば、出力回路12に入出力アドレスデータを
与え選択された出力要素を付勢および無勢して一連のシ
ーケンス制御を行なう。このような一連の処理はコンピ
ュータ12の実行プログラムに基いて行われるが、その
動作を第8図に示すような2台の機械20,30を制御
する場合を例にして詳細に説明する。
FIG. 7 shows a first embodiment of the present invention, and is a block diagram showing a configuration when sequence control is performed by a computer such as a minicomputer. The input circuit 10 converts detection signals provided from input elements such as limit switches and pushbutton switches that detect the operating state of the controlled machine into C-level signals, and also connects the interface 1
With the input/output address data given from 1, one of the on/off states of the input element whose signal has been converted is selected and output. The output circuit 12 selects one of output elements such as a relay or a solenoid using input/output address data, and energizes or deenergizes the selected output element according to an output command given from the interface 11. It also outputs the on/off state of the output element selected by the input/output address data. The computer 13 is adapted to execute a sequence program based on an execution program programmed in advance, and if the read sequence program is a test instruction, the computer 13 is configured to execute a sequence program based on an execution program programmed in advance. Give an input/output address zeta to the input/output element, select one of the input/output elements, and read its on/off state. Further, if the sequence program is an output command, input/output address data is given to the output circuit 12 to energize and de-energize selected output elements to perform a series of sequence control. Such a series of processing is performed based on an execution program of the computer 12, and its operation will be explained in detail by taking as an example the case where two machines 20 and 30 as shown in FIG. 8 are controlled.

この2台のユニツトは全く同一のものとし、それぞれ起
動ボタンが押圧されることにより自動運転を開始する。
自動運転が開始されるとユニツトが前進するとともにス
ピンドル駆動モータが回転してワークの加工を行いユニ
ツトが前進端へ達するとドウエリングを行い、ドウエリ
ング終了後ユニツトを後退させ原位置に戻ると自動運転
を終了して停止する。また、機械の動作中に非常停止ス
イツチが押圧されると油圧回路をプロツクして機械の運
転を停止させるとともに自動運転を解除する。上記のよ
うな動作をサイクル線図で表わすと第9図のようになる
These two units are exactly the same, and each starts automatic operation when a start button is pressed.
When automatic operation starts, the unit moves forward and the spindle drive motor rotates to process the workpiece. When the unit reaches the forward end, it performs doweling. After the doweling is completed, the unit retreats and returns to its original position, and automatic operation begins. Finish and stop. Furthermore, when the emergency stop switch is pressed while the machine is in operation, the hydraulic circuit is blocked to stop the machine and cancel automatic operation. The above operation can be expressed in a cycle diagram as shown in FIG. 9.

第9図において、各ステツプごとにステツプを移行させ
る入力条件が土側へ、ステツプを移行させるための実行
命令と次に行うステツプ番号が下側へ各動作ステツプご
とに書かれている。このステツプ番号は同時に並行して
行われるシーケンス匍卿が複数ある場合には各シーケン
ス制御の各ステツプごとにそれぞれ異つたステツプ番号
を付ける。また、それぞれのステツプ動作中における外
の機械とのインタロツク条件もしくは非常停止信号など
の停止条件がステツプの節と節の間に書かれており、こ
の場合は下側には機械を停止させるべき実行命令が書か
れている。このサイクル線図を基にシーケンスプログラ
ムを作成するが、その一部を第2表に示す。また、シー
ケンスプログラムに使用される命令語は第3表に示すよ
うにテスト命令5種類と出力命令3種類とNOP命令に
よつて構成されている。このようにしてプログラムされ
たシーケンスプログラムは図示しないプログラム書込み
装置にて、コンピユータ13の記憶装置に第10図に示
すような形式で書込まれる。
In FIG. 9, the input conditions for moving each step are written on the bottom side, and the execution command for moving the step and the number of the next step are written on the bottom side for each operation step. If there are a plurality of sequence controls that are executed in parallel at the same time, a different step number is assigned to each step of each sequence control. In addition, interlock conditions with external machines or stop conditions such as emergency stop signals during each step operation are written between the step nodes. The instructions are written. A sequence program is created based on this cycle diagram, part of which is shown in Table 2. Further, the instruction words used in the sequence program are composed of five types of test instructions, three types of output instructions, and a NOP instruction, as shown in Table 3. The sequence program programmed in this way is written into the storage device of the computer 13 in the format shown in FIG. 10 by a program writing device (not shown).

第10図においてシーケンステーブルは、現在実行され
ているステツプ番号を記憶する部分で、複数のステツプ
よりなる一連のシーケンス動作ごとにステツプ番号が記
憶されており、ステツプ番号の内、例えば上2桁は複数
並行して行われているシーケンス動作の内のどのシーケ
ンス動作であるかを表わし、下2桁は各シーケンス動作
における現在行われているステツプを表わしている。ま
た、シーケンスポインタSPは複数のシーケンス動作の
内の1つを指定するもので、指定されたシーケンス動作
の現在行われているステツプに対応したシーケンスプロ
グラムのみが実行される。なお、このシーケンスポイン
タSPは1ステツプのシーケンスプログラムが実行され
るごとに切換えられ、他のシーケンス動作を順次指定す
る。インデツクステーブルは各動作ステツプに対応した
シーケンスプログラムが記憶装置のどこに書込まれてい
るかを記憶しておくもので、シーケンスプログラムの記
憶されている始めと終りのメモリアドレスであるスター
トアドレスとエンドアドレスがインデツクスデータとし
て記憶されている。このインデツクステーブルの中でイ
ンデツクスポインタIPで指定されたインデツクスデー
タのステツプ番号と前記シーケンスポインタSPで指定
されているステツプ番号が同じである場合には読出され
たプログラムデータにて指定されるシーケンスプログラ
ムが実行され、異なる場合にはインデツクスポインタP
は他のプログラムを指定し、シーケンスポインタSPで
指定されたステツプ番号と同一のインデツクスデータを
サーチする。シーケンスプログラムテーブルは各動作ス
テツプごとにプログラムさわたシーケンスプログラムを
記憶しておくもので、この各ステツプごとのシーケンス
プログラムにはステツプを移行させるための入力条件の
テストおよびテスト条件を満足したときに次に行うステ
ツプの番号とステツプを移行させるべく出力要素を付勢
または無勢する出力命令がプログラムされている。この
シーケンスプログラムテーブルの内前記のシーケンスポ
」ンタSPで指定されたステツプ番号に対応したシーケ
ンスプログラムのみが読出され、実行されるわけである
が、シーケンスポインタSPの設定と、インデツクステ
ーブルからの同−ステツプ番号のプログラムのサーチと
、ステツプ番号で指定されたシーケンスプログラムの実
行の一連の動作を行なう実行プログラムを第11図のフ
ローチヤートにより説明する。
In FIG. 10, the sequence table is a part that stores the step number currently being executed. A step number is stored for each sequence operation consisting of a plurality of steps. For example, the first two digits of the step number are It represents which sequence operation is being performed among a plurality of sequence operations that are being performed in parallel, and the last two digits represent the step that is currently being performed in each sequence operation. Further, the sequence pointer SP specifies one of a plurality of sequence operations, and only the sequence program corresponding to the currently executed step of the specified sequence operation is executed. Note that this sequence pointer SP is switched each time a one-step sequence program is executed, and sequentially specifies other sequence operations. The index table stores where in the storage device the sequence program corresponding to each operation step is written.The index table stores the start address and end address, which are the beginning and end memory addresses of the sequence program. is stored as index data. If the step number of the index data specified by the index pointer IP in this index table is the same as the step number specified by the sequence pointer SP, the step number specified by the read program data is specified. The sequence program is executed, and if different, the index pointer P
specifies another program and searches for the same index data as the step number specified by the sequence pointer SP. The sequence program table stores the program touch sequence program for each operation step, and the sequence program for each step includes a test of input conditions for transitioning the step and a test for the next step when the test conditions are satisfied. The number of steps to be performed and the output instructions to energize or de-energize the output elements to transition the steps are programmed. Of this sequence program table, only the sequence program corresponding to the step number specified by the sequence pointer SP is read and executed, but the setting of the sequence pointer SP and the synchronization from the index table are - An execution program that performs a series of operations of searching for a program with a step number and executing a sequence program specified by the step number will be explained with reference to the flowchart of FIG.

この実行プログラムにおいては複数のシーケンス動作の
内の1つを指定するシーケンスポインタSPと、ステツ
プ番号と同一ステツプ番号のプログラムをインデツクス
テーブルからサーチするインデツクスポインタIPと、
シーケンスプログラムの記憶されているメモリアドレス
を指定するプログラムカウンタPCと、テスト命令がア
ンド命令であるかオア命令であるかを記憶するアンドフ
ラツグANDFLGと、テスト結果を記憶するテストフ
ラツグTESTFLGがプログラム上で構成される。実
行プログラムが開始されると、(2)ステージでシーケ
ンスポインタSPはりセツトされ、シーケンスポインタ
SPの内容はOとなる。(3)ステージはシーケンステ
ーブルよりシーケンスポインタで指定されたステツプ番
号を読出すルーチンであり、第1回目の読出しはシーケ
ンスポインタSPが0となつているので、シーケンステ
ーブルの最初に記憶されているステツプ番号が読出され
る。(4)ステージでは読出されたステツプ番号がシー
ケンステーブルエンドを表わす番号であるかどうかが判
別される。第1回目の読出しではシーケンステーブルエ
ンドではないが、もしシーケンステーブルエンドである
ことが判別された場合には(2)ステージの前へリター
ンしシーケンスポインタSPを再びりセツトする。ステ
ツプ番号の読出しが終了すると(5)ステージでインデ
ツクステーブルにジアップし、インデツクステーブルの
最初のデータが3ワード単位で読出される。(6)ステ
ージでは読出されたデータによりインデツクステーブル
のエンドであるかどうかが判別される。最初のデータ読
出しではエンドではないが、読出されたデータがエンド
を表わすデータであれば(6−1)ステージに移る。(
6−1)ステージではシーケンスポインタに+1し、(
3)ステージの前へリターンし、次のシーケンス番号の
ステツプ番号が読出される。(7)ステージでは読出さ
れたデータに書込まれているステツプ番号と(3)ステ
ージで読出されたステツプ番号の比較がなされる。一致
している場合には次のステージへ進むが、一致しない場
合は(7一1)ステージでインデツクスポインタIPを
+1し次のデータを読出す。(8)ステージでは次に行
われるシーケンスプログラムの実行に先立つてテストフ
ラツグTESTFLGをりセツトしておく。(9)スチ
ージでは(7)ステージで読出されたデ゛一タのスター
トアドレスがプログラムカウンタPCにプリセツトされ
、AIステージではプログラムカウンタPCの値と(7
)ステージで読出されたエンドアドレスとを比較し、指
定されたシーケンスプログラムが全て実行されてプログ
ラムPCの値がエンドアドレスと等しくなることを検出
してプログラムエンドであることを判別する。そして、
プログラムエンドであることが判別されると(7一1)
ステージでインデツクスポインタ+1し、同一ステツプ
番号のプログラムが他にないかをサーチする。プログラ
ムエンドでない場合にはプログラムカウンタPCで指定
されたシーケンスプログラムが01)ステージで読出さ
れる。(自)ステージでは読出されたシーケンスプログ
ラムが入力条件をテストする命令であるかどうかが判別
される。読出されたシーケンスプログラムがテスト命令
である場合には(16)ステージへ移行する。(16)
ステージではテスト命令がアンド命令で行われるかオア
論理で行われるかが判別され、アンド論理で行われる場
合には(17−1)ステージでアンドフラツグをセツト
し、オア論理で行われる場合には(17−2)ステージ
でアンドフラツグをりセツトする。(18)ステージで
はシーケンスプログラムの入出力アドレスデータにて指
定される入出力要素のオンオフ状態のチエツクおよび指
定されたステツプ番号が現在実行されているかどうかの
チエツクがなされ、(19)ステージでテスト条件を満
足しているかどうかが判別される。そして、テスト条件
を満足している場合には(18−1)ステージでテスト
フラツグTESTFLGをセツトして、(9−1)ステ
ージでプログラムカウンタPCを+1した後、(代)ス
テージの前へリターンし、次のシーケンスプログラムの
読出しを行う。もしテスト条件を満足していない場合に
は(20)ステージへ移行する。(20)ステージでは
アンドフラツグANDFLGがセツトしているかどうか
、すなわちテスト命令がアンド論理で行われているかど
うかを判別する。アン曜理で行われている場合にはテス
ト条件を満足していなければこれ以後のプログラムを実
行する必要はないので、この時点で指定されたシーケン
スプログラムの実行は終了し、(7一1)ステージへ移
行以プログラムエンドの場合と同株に同一ステツプ番号
のシーケンスプログラムが他にあるかどうかをサーチす
る。しかし、オア論理である場合には入力条件を全てテ
ストする必要があるので、(9〜1)ステージでプログ
ラムカウンタを+1して次のプログラムの読出しを行う
。このようにして入力条件が順次テストされ、続いて出
力命令のプログラムが読出されると、(代)ステつ−ジ
で入力条件でないことが判定され、(自)ステージに移
行する。
This execution program includes a sequence pointer SP that specifies one of a plurality of sequence operations, an index pointer IP that searches the index table for a program with the same step number as the step number,
The program includes a program counter PC that specifies the memory address where the sequence program is stored, an AND flag ANDFLG that stores whether the test instruction is an AND instruction or an OR instruction, and a test flag TESTFLG that stores the test result. Ru. When the execution program is started, the sequence pointer SP is reset in stage (2), and the content of the sequence pointer SP becomes O. (3) Stage is a routine that reads the step number specified by the sequence pointer from the sequence table.In the first read, the sequence pointer SP is 0, so the step number stored at the beginning of the sequence table is read. The number is read out. At the (4) stage, it is determined whether the read step number is a number representing the end of the sequence table. Although it is not the sequence table end in the first read, if it is determined that it is the sequence table end, (2) return to the front of the stage and reset the sequence pointer SP again. When the reading of the step number is completed, the data is updated to the index table at stage (5), and the first data of the index table is read out in units of 3 words. In the (6) stage, it is determined based on the read data whether the index table is at the end or not. Although it is not the end in the first data read, if the read data represents the end, the process moves to stage (6-1). (
6-1) At the stage, add 1 to the sequence pointer and (
3) Return to the front of the stage and read the step number of the next sequence number. At the (7) stage, the step number written in the read data is compared with the step number read at the (3) stage. If they match, the process advances to the next stage, but if they do not match, the index pointer IP is incremented by 1 at stage (7-1) and the next data is read. In the (8) stage, the test flag TESTFLG is reset before the next sequence program is executed. (9) In the stage, the start address of the data read out in the stage (7) is preset in the program counter PC, and in the AI stage, the value of the program counter PC and (7) are preset in the program counter PC.
) is compared with the end address read in the stage 2, and it is determined that the program end is reached by detecting that all the designated sequence programs have been executed and the value of the program PC becomes equal to the end address. and,
When it is determined that the program is at the end (7-1)
The index pointer is incremented by 1 at the stage and a search is made to see if there is another program with the same step number. If it is not the program end, the sequence program designated by the program counter PC is read out at stage 01). In the (self) stage, it is determined whether the read sequence program is an instruction for testing input conditions. If the read sequence program is a test instruction, the process moves to stage (16). (16)
At the stage, it is determined whether the test instruction is executed using AND instruction or OR logic. If the test instruction is executed using AND logic, the AND flag is set at stage (17-1), and when it is executed using OR logic, the AND flag is set. 17-2) Reset the AND flag on the stage. At the (18) stage, the on/off state of the input/output element specified by the input/output address data of the sequence program is checked, and whether the specified step number is currently being executed is checked, and at the (19) stage, the test conditions are checked. It is determined whether the conditions are satisfied. Then, if the test conditions are satisfied, the test flag TESTFLG is set in the (18-1) stage, the program counter PC is incremented by 1 in the (9-1) stage, and then the process returns to the front of the (sub)stage. , reads the next sequence program. If the test conditions are not satisfied, the process moves to stage (20). At the (20) stage, it is determined whether the AND flag ANDFLG is set, that is, whether the test instruction is executed using AND logic. In the case of an unyori method, there is no need to execute any subsequent programs unless the test conditions are satisfied, so the execution of the specified sequence program ends at this point, and (7-1) After moving to the stage, search to see if there is another sequence program with the same step number for the same stock as at the end of the program. However, in the case of OR logic, it is necessary to test all input conditions, so the program counter is incremented by 1 at stage (9-1) and the next program is read. When the input conditions are sequentially tested in this way and the output instruction program is subsequently read out, it is determined in the (sub) stage that the input conditions are not the input conditions, and the process moves to the (self) stage.

この(自)ステージにて読出された命令が出力命令であ
るかどうかが判別される。読出された命令が出力命令で
ない場合すなわち入力条件でも出力命令でもない場合(
NOP命令の時)には(9−1)ステージでプログラム
カウンタを+1して次のプログラムを読出しを行う。読
出された命令が出力命令である場合には、(自)ステー
ジへ移行し、テストフラツグTESTFLGがセツトし
てあるかどうかが判別される。テスト命令がアンド論理
、オア論理のいづれで行われている場合も条件満足の場
合は(18−1)ステージでテストフラツグTESTF
LGがセツトされており、この場合には(15)ステー
ジにて、入出力アドレスで指定された出力要素を付勢ま
たは無勢する。さらに出力命令がステツプ番号であると
きはそのステツプ番号をシーケンステーブルのシーケン
スポインタSPで指定されている所へ書き込む。このよ
うにして(15)ステージで出力命令の実行がなされる
と、(9−1)ステージでプログラムカウンタを+1し
て次のシーケンスプログラムを読出す。なお、A4)ス
テージでテストフラツグがセツトしていないことが判定
された場合にはそれ以後の出力命令のプログラムを行う
必要はないので、(7一1)ステージへ移行し、次のシ
ーケンスプログラムをサーチする。次に第8図に示すよ
うな2台の機械を同時に制御する場合を例にとつて、実
行プログラムおよびシーケンスプログラムの処理過程を
説明する。
It is determined whether the instruction read at this (self) stage is an output instruction. If the read instruction is not an output instruction, that is, neither an input condition nor an output instruction (
(NOP instruction), the program counter is incremented by 1 at stage (9-1) and the next program is read. If the read instruction is an output instruction, the process moves to the (self) stage and it is determined whether the test flag TESTFLG is set. Regardless of whether the test instruction is executed using AND logic or OR logic, if the condition is satisfied, the test flag TESTF is set at stage (18-1).
LG is set, and in this case, at stage (15), the output element specified by the input/output address is activated or deactivated. Further, when the output instruction is a step number, that step number is written to the location specified by the sequence pointer SP in the sequence table. When the output command is thus executed at stage (15), the program counter is incremented by 1 at stage (9-1) and the next sequence program is read. Note that if it is determined in the A4) stage that the test flag is not set, there is no need to program the subsequent output commands, so the program moves to the (7-1) stage and searches for the next sequence program. do. Next, the processing steps of the execution program and the sequence program will be explained by taking as an example the case where two machines as shown in FIG. 8 are controlled simultaneously.

今、第8図に示すように2台の機械20,30のユニツ
トが共に原位置に位置しており、それぞれ原位置確認用
リミツトスイツチLSlO,LS2Oが押圧されている
状態でシーケンス制御動作が開始されたものとする。シ
ーケンス制御が開始されると、第11図の(2)ステー
ジでシーケンスポインタSPがりセツトされ、第10図
に示すシーケンステーブルの最初に記憶されているステ
ツプ番号0000が指定される。一方、機械20のユニ
ツトは原位置に位置しているからステツプ番号は0であ
るため、機械の動作ステツプ番号とコントローラ内部の
ステツプ番号は一致している。実際には、シーケンス制
御の開始に先立つて図示していない原点復帰用押ボタン
スイツチを押圧することにより機械を原点に戻すととも
にステツプ番号もOとするようになつている。そして、
(3)ステージでステツプ番号0000が読出される。
このステツプ番号が読出されると(4)ステージでシー
ケンステーブルエンドかどうかの判定がなされるが、ス
テツプ番号0000はシーケンステーブルエンドではな
いから、次のステージへ移行する。(5)ステージにて
インデツクステーブルヘジヤンプするとともにインデツ
クスポインタPがりセツトされるためインデツクステー
ブルの最初であるメモリアドレス2000〜2003に
記憶されているデータが指定される。この指定されたデ
ータは(5−1)ステージで読出され、(6)ステージ
にてインデツクステーブルエンドかどうかが判別される
。このデータはシーケンステーブルエンドではないから
、次の(7)ステージへ移行する。(7)ステージでは
読出されたデータのステツプ番号0000とシーケンス
ポインターで指定されているインデツクスデータのステ
ツプ番号0000とを比較する。この場合両者のステツ
プ番号は一致しているため次のステージへ移行し、ステ
ツプ番号で指定されたシーケンスプログラムの実行が開
始される。(8)ステージでテストフラツグをりセツト
した後、(9)ステージでプログラムカウンタPCへ読
出さねたデータのスタートアドレス4000をプリセツ
トする。これによりメモリアドレス4000のシーケン
スプログラムが指定される。続いて(自)ステージでプ
ログラムカウンタの値4000と読出されたデータのエ
ンドアドレス4006が比較されるが、一致していない
ため次のステージの動作が行われる。a1)ステージで
プログラムカウンタPCにて指定されたメモリアドレス
4000に記憶されているシーケンスプログラムSTO
が読出される。この読出されたシーケンスプログラムは
(自)ステージで入力条件であるかどうかが判別される
が、このSTIOは現在行われているステツプ番号がO
であるかどうかをアンド論理でテストする命令であり人
力条件であるから、(16)ステージの動作へ移行する
。(16)ステージにてテスト命令がアンド論理で行わ
れることが判定され、(17−1)ステージでアンドフ
ラツグがセツトされる。そして(18)ステージで現在
行われているステツプ番号がOであるかがチエツクされ
るが、現在行われているステツブ番号はOであるため、
(19)ステージで条件満足と判定され、(18−1)
ステージでテストフラツグTESTFLGをセツトする
。なお、ステツプ番号が異つている場合には(20)ス
テージにてアンドフラツグANDFLGがセツトされて
いることが判定されるため、このシーケンスプログラム
は終了し、(7一1)ステージの動作へ移行する。この
ようにして、SPIOのテストがなされると、(9−1
)ステージでプログラムカウンタを+1し、メモリアド
レス4001のシーケンスプログラムを指定する。する
とメモリアドレス4001に記憶されているYOFSO
LlOの命令が読出されるが、この命令はテスト結果が
満足している場合にはソレノイドSOLlOを無勢する
出力命令であるので、(自)ステージで出力命令である
ことが判別される。出力命令であることが判別されると
、A4)ステージでテストフラツグTESTFLGがセ
ツトしているかどうかが判別されるが、この場合にはテ
スト結果を満足しておりテストフラツグTESTFLG
がセツトされているため、次の(15)ステージへ移行
し出力命令が実行され、ソレノイドSOLlOを無勢す
る。このようにしてYOFSOLlOの命令が実行され
ると前記の場合と同様にPCを+1して次の命令を読出
して実行する。そして、YONSOLll,YOFTR
l,YOFMl,YOFRUNlの命令がプログラムカ
ウンタPCを+1するごとに次々と行われる。
Now, as shown in Fig. 8, the units of the two machines 20 and 30 are both located at their home positions, and the sequence control operation is started with their home position confirmation limit switches LSLO and LS2O being pressed. shall be When sequence control is started, the sequence pointer SP is reset in stage (2) of FIG. 11, and the step number 0000 stored at the beginning of the sequence table shown in FIG. 10 is designated. On the other hand, since the unit of the machine 20 is located at the original position, the step number is 0, so the operation step number of the machine and the step number inside the controller match. In reality, the machine is returned to the origin and the step number is set to O by pressing a pushbutton switch for returning to the origin (not shown) prior to the start of sequence control. and,
(3) Step number 0000 is read at the stage.
When this step number is read out, it is determined in stage (4) whether or not it is the end of the sequence table, but since step number 0000 is not the end of the sequence table, the process moves to the next stage. (5) At the stage, the index table is jumped and the index pointer P is reset, so that the data stored in the first memory addresses 2000 to 2003 of the index table is specified. This designated data is read at stage (5-1), and it is determined at stage (6) whether it is the end of the index table. Since this data is not the sequence table end, the process moves to the next stage (7). In the (7) stage, the step number 0000 of the read data is compared with the step number 0000 of the index data specified by the sequence pointer. In this case, since both step numbers match, the process moves to the next stage and starts executing the sequence program specified by the step number. After resetting the test flag in the (8) stage, the start address 4000 of the data that could not be read to the program counter PC is preset in the (9) stage. This specifies the sequence program at memory address 4000. Subsequently, in the (self) stage, the value 4000 of the program counter and the end address 4006 of the read data are compared, but since they do not match, the operation of the next stage is performed. a1) Sequence program STO stored at memory address 4000 specified by program counter PC at stage
is read out. This read sequence program is judged at the (self) stage as to whether it meets the input condition or not.
Since this is an instruction to test whether or not , using AND logic, and is a manual condition, the process moves to the operation of stage (16). At the (16) stage, it is determined that the test instruction is executed using AND logic, and at the (17-1) stage, the AND flag is set. Then (18) it is checked whether the step number currently being performed in the stage is O, but since the step number currently being performed is O,
(19) It is determined that the condition is satisfied at the stage, (18-1)
Set the test flag TESTFLG on the stage. If the step numbers are different, it is determined at stage (20) that the AND flag ANDFLG is set, so this sequence program ends and the process moves to the operation at stage (7-1). When SPIO is tested in this way, (9-1
) stage, increments the program counter by 1 and specifies the sequence program at memory address 4001. Then, the YOFSO stored at memory address 4001
The instruction of LIO is read, but since this instruction is an output instruction that disables the solenoid SOLIO if the test result is satisfied, it is determined at the (self) stage that it is an output instruction. When it is determined that it is an output command, it is determined in stage A4 whether or not the test flag TESTFLG is set. In this case, the test result is satisfied and the test flag TESTFLG is set.
is set, the process moves to the next stage (15), the output command is executed, and the solenoid SOLIO is deenergized. When the YOFSOLIO instruction is executed in this way, the PC is increased by 1 and the next instruction is read out and executed, as in the previous case. And YONSOLll, YOFTR
The instructions 1, YOFM1, and YOFRUN1 are executed one after another every time the program counter PC is incremented by 1.

これにより、ソレノイドSOLllの付勢、ドウエリン
グ用タイマTRlの無勢、スピンドル駆動用モータM1
の無勢、自動運転フラツグRUNlのりセツトが行われ
、ユニツトを原位置に保持するとともにモータM1は停
止させ、自動運転可能な状態とする。そして、インデツ
クスデータで指定されたシーケンスプログラムの最後の
命令であるYOFRUNlの実行が終りプログラムカウ
ンタPCが+1され4006となると、インデ゛ツクス
テーブルから読出されたエンドアドレスと一致するため
0Dステージでプログラムエンドであることが判定され
る。これにより、(7一1)のステージへ移行してイン
デツクスポインタIPを+1してインデツタステーブル
のメモリアドレス2003〜2004に記憶されている
インデツクスデータが指定される。インデツクステーブ
ルのゼータは前記したように3ワードずつ読出されるた
め、インデツクスポインタIPを+1するごとに次の3
ワードが指定される。指定されたデータは(5−1)ス
テージで読出され、(7)ステージでシーケンスポイン
タで指定されているステツプ番号0と読出されたデータ
のステツプ番号とが比較される。この場合は読出された
ステツプ番号がOであり両者が一致するため、次のステ
ージ動作へ移行し、前記の場合と同様にして、メモリア
ドレス4007〜4009に記憶されているシーケンス
プログラムが実行される。このシーケンスプログラムは
自動運転フラツグRUNlがりセツトしているかどうか
をアンド論理でテストするとともに起動スイツチSTA
RTlが押圧されたかどうかをアンド論理でテストし、
これらの条件を満足している場合には自動運転フラツグ
RUNIをセツトするとともに、ステツプ番号を1とす
るものである。このシーケンスプログラムの実行が終る
と、再び(7一1)ステージにてインデツクスポインタ
を+1してメモリアドレス2006〜2008に記憶さ
れている次のインデツクスデータが読み出される。そし
て、(7)ステージでステツプ番号の比較がなされるが
、前記のシーケンスプログラムの実行の結果、ステツプ
を移行させるべき入力条件が満足しており、ステツプ番
号を1に書替える出力命令が実行された場合には、シー
ケンスボインタで指定されたステツプ番号と、読出され
たインデツクスデータのステツプ番号が共に1となつて
いるため両者が一致し、メモリアドレス4010〜40
16に記憶されているシーケンスプログラムが実行きれ
る。しかし、前記のシーケンスプログラムの実行の結果
、入力条件を満足しておらず、ステツプ番号が書替えら
れない場合には、シーケンスポインタSPで指定された
ステツプ番号と読出されたステツプ番号とが一致しない
ため、再びインデツクスポインタを+1して次のインデ
ツクスデータのステツプ番号との比較がなされる。
As a result, the solenoid SOLll is energized, the dwell timer TRl is deenergized, and the spindle drive motor M1 is energized.
When the automatic operation flag RUNl is set, the unit is held in its original position and the motor M1 is stopped, thereby enabling automatic operation. Then, when the execution of YOFRUNl, which is the last instruction of the sequence program specified by the index data, is completed and the program counter PC increases by 1 and reaches 4006, the program counter PC is started at the 0D stage because it matches the end address read from the index table. It is determined that it is the end. As a result, the process moves to stage (7-1), the index pointer IP is incremented by 1, and the index data stored in memory addresses 2003 to 2004 of the index table is specified. Since the zeta of the index table is read out three words at a time as described above, each time the index pointer IP is increased by 1, the next three words are read out.
word is specified. The specified data is read out at stage (5-1), and step number 0 specified by the sequence pointer is compared with the step number of the read data at stage (7). In this case, the read step number is O and they match, so the process moves to the next stage operation and the sequence program stored in memory addresses 4007 to 4009 is executed in the same way as in the previous case. . This sequence program uses AND logic to test whether the automatic operation flag RUN1 is set and also sets the start switch STA.
Test whether RTl is pressed with AND logic,
If these conditions are satisfied, the automatic operation flag RUNI is set and the step number is set to 1. When the execution of this sequence program is completed, the index pointer is increased by 1 again at the (7-1) stage, and the next index data stored in memory addresses 2006 to 2008 is read out. Then, in stage (7), the step numbers are compared, and as a result of executing the sequence program, the input conditions for moving the step are satisfied, and the output command to rewrite the step number to 1 is executed. In this case, the step number specified by the sequence pointer and the step number of the read index data are both 1, so they match, and memory addresses 4010 to 40
The sequence program stored in 16 can be executed. However, as a result of executing the sequence program, if the input conditions are not satisfied and the step number is not rewritten, the step number specified by the sequence pointer SP and the read step number do not match. Then, the index pointer is incremented by 1 again and compared with the step number of the next index data.

このようにして順次インデツクスデータを読出し、同一
ステツプ番号のインデツクスデータがないかをサーチす
る。そして、インデツクステーブルエンドのデータが読
出されると、(6)ステージでインデツクステーブルエ
ンドであることが判定され、(6−1)ステージにてシ
ーケンスポインタSPに+1する。これにより、シーケ
ンスポインタSPはシーケンステーブルの2番目に記憶
されているステツプ番号を指定する。したがつて、この
時点からシーケンス番号1の制御が開始される。シーケ
ンスポインタSPにてシーケンス番号1のステツプ番号
が指定されると、(3)ステージにてシーケンステーブ
ルよりステツプ番号0100が読出され、前記の場合と
同様にして、ステツプ番号0100にて指定されるメモ
リアドレス5000〜5009に記憶されているシーケ
ンスプログラムの読出し、実行が行われる。
In this way, the index data is read out sequentially, and a search is made for index data having the same step number. When the data at the index table end is read, it is determined that the data is at the index table end at stage (6), and the sequence pointer SP is incremented by 1 at stage (6-1). Thereby, the sequence pointer SP specifies the second stored step number in the sequence table. Therefore, control of sequence number 1 is started from this point. When the step number of sequence number 1 is specified by the sequence pointer SP, the step number 0100 is read from the sequence table in the (3) stage, and the memory specified by the step number 0100 is read out in the same way as in the previous case. The sequence programs stored at addresses 5000 to 5009 are read and executed.

今、起動スイツチSTARTl,START2のいずれ
もが押圧されないとすると、ステツプ100にて指定さ
れるシーケンスプログラムを実行した後、(7一1)ス
テージでインデツクスポインタを+1することにより、
シーケンスポインタSPで指定されているステツプ番号
と、読出されたインデツクスプログラムのステツプ番号
とが一致しなくなるため、インデツクスポインタIPは
残りのインデツクステーブルをサーチし、インデツクス
ポインタPがインデツクステーブルのエンドを指定する
と、(6)ステージでインデツクステーブルエンドであ
ることが判定され、(6−1)ステージの動作へ移行す
る。(6−1)ステージではシーケンスポインタSPを
再び+1しシーケンステーブルの次のメモリアドレスの
ステツプ番号を指定する。並行して行われているシーケ
ンス動作がシーケンス番号0,1の他にある場合はその
シーケンス動作の内の1つを指定するが、本実施例にお
いては、並行動作しているシーケンス動作を2つのみと
したので、次のメモリアドレスにはシーケンステーブル
エンドを表わす7JカモVが記憶されている。このため(
3)ステージでステツプ番号として7JカモVが読出され
る。これにより(4)ステージでシーケンステーブルエ
ンドであることが判別され、(2)ステージの前へリタ
ーンする。このようにしてステツプOと100に対応し
たシーケンスプログラムが1通り行われたことになるが
、シーケンスポインタSPがりセツトされたことにより
、再びステツプ番号0が指定され、ステツプ番号0に対
応したシーケンスプログラムが実行され、このシーケン
スプログラムの実行の後、ステツプ番号100に対応し
たシーケンスプログラムが実行され再びシーケンスポイ
ンタSPがりセツトされる。以下この動作がサイクリツ
クに繰り返されステツプ番号0と100に対応したシー
ケンスプログラムが交互に実有される。そして、起動ス
イツチSTARTlが押圧されるとステツプを移行させ
るべき入力条件を満足するため、出力命令が実行される
。これにより、シーケンス番号0のステツプ番号は1に
書替えられ、ステツプ番号1の動作に移行する。そして
、これ以後はメモリアドレス4010〜4015に記憶
されているステツプ番号1に対応したシーケンスプログ
ラムとステツプ番号100のシーケンスプログラムのス
キヤンが繰返し行われる。さらに起動スイツチSTAR
T2も押圧されると、シーケンス番号1のステツプ番号
も101となり、ステツプ番号1と101のシーケンス
プログラムが交互に実行される。以下同様にして、シー
ケンス番号0と1のステツプ番号で指定されたシーケン
スプログラムが交互に繰返し実行され、それぞれ独立に
ステツプ動作を移行させることによりシーケンス匍脚が
行われる。そしてユニツト前進、ワーク加工、ユニツト
後退の一連の動作が終了して、再びユニツトが原位置に
戻ると、それぞれSTOO,STOlOOの命令が実行
され、ステツプ番号を初期値に書替えて自動運転を完了
する。なお、本実施例では全く別々の動きをする2台の
機械を匍脚する場合を例にして説明を行つたが入力条件
として、基準となるシーケンス動作の入力条件またはシ
ーケンス番号をプログラムすることにより、並行して行
われている複数のシーケンス動作のタイミングを合せる
ことも簡単に出来る。
Now, assuming that neither start switch STARTl nor START2 is pressed, after executing the sequence program specified in step 100, by incrementing the index pointer by +1 in stage (7-1),
Since the step number specified by the sequence pointer SP does not match the step number of the read index program, the index pointer IP searches the remaining index tables, and the index pointer P searches the index table. When the end is specified, it is determined in stage (6) that it is an index table end, and the process moves to stage (6-1). At the (6-1) stage, the sequence pointer SP is increased by 1 again to designate the step number of the next memory address in the sequence table. If there are sequence operations running in parallel other than sequence numbers 0 and 1, specify one of the sequence operations, but in this example, two sequence operations are running in parallel. Therefore, 7J Camo V, which represents the sequence table end, is stored in the next memory address. For this reason(
3) 7J Camo V is read out as the step number on the stage. As a result, it is determined in stage (4) that the sequence table is at the end, and the process returns to the front of stage (2). In this way, one sequence program corresponding to steps O and 100 is executed, but as the sequence pointer SP is reset, step number 0 is designated again, and the sequence program corresponding to step number 0 is executed. After the execution of this sequence program, the sequence program corresponding to step number 100 is executed and the sequence pointer SP is reset again. Thereafter, this operation is repeated cyclically, and the sequence programs corresponding to step numbers 0 and 100 are executed alternately. Then, when the start switch STARTl is pressed, the output command is executed in order to satisfy the input condition for moving the step. As a result, the step number of sequence number 0 is rewritten to 1, and the operation shifts to step number 1. Thereafter, scanning of the sequence program corresponding to step number 1 and the sequence program having step number 100 stored in memory addresses 4010 to 4015 is repeated. Furthermore, start switch STAR
When T2 is also pressed, the step number of sequence number 1 also becomes 101, and the sequence programs of step numbers 1 and 101 are executed alternately. Thereafter, in the same manner, the sequence programs designated by the step numbers 0 and 1 are alternately and repeatedly executed, and the sequence protrusion is performed by independently transitioning the step operations. When the series of operations of advancing the unit, machining the workpiece, and retracting the unit is completed and the unit returns to its original position, the STOO and STOlOO commands are executed, respectively, and the step number is rewritten to the initial value to complete automatic operation. . In addition, in this embodiment, the case where two machines that move completely differently are used as an example to explain the case, but by programming the input conditions or sequence numbers of the reference sequence operation as the input conditions, it is possible to It is also possible to easily synchronize the timing of multiple sequence operations that are being performed in parallel.

ミニコンピユータ等のコンピユータでシーケンス制御を
行う場合には前述したように、シーケンスポインタSP
lインデツクスポインタIPlプログラムカウンタPC
等を実行プログラムで形成し、ソフトウエアでシーケン
ス機能を持たせていたが、これらの機能はハードウエア
の回路でも当然実現することができる。以下この実施例
を第12図により説明する。第12図において、シーケ
ンスメモリ100、インデツクスメモリ101、プログ
ラムメモリ102はそれぞれシーケンステーブル、イン
デツクステーブル、シーケンスプログラムテーブルに対
応するものである。シーケンスメモリ100は並行して
行われるシーケンス動作のそれぞれのステツプ番号を記
憶するようになつており、シーケンスポインタに相当す
るプログラムカウンタPClにてその内の1つが順次指
定され、指定されたステツプ番号が読出される。また、
指定されたステツプ番号は新しいステツプ番号に書替え
ることが出来る。インデツクスメモリ101は各ステツ
プ番号に対応したシーケンスプログラムのスタートアド
レスとエンドアドレスが記憶されているが、この場合に
はインデツクスポインタ1Pに相当するものはなく、シ
ーケンスメモリから読出されたステツプ番号とインデツ
クスメモリのインデツクスデータの間には1対1の対応
関係になつており、プログラムカウンタPClにてステ
ツプ番号が指定されるとこのステツプ番号に対応したイ
ンデツクスデータが読出されるようになつている。この
ため同一ステツプ番号のインデツクスデータが2つ以上
あることはなく、第13図に示すように同一ステツプ番
号のシーケンスプログラムは1ケ所にまとめ、同一ステ
ツプのシーケンスプログラムごとにインデツクスデータ
で指定する。読出されたインデツクスデータの内、スタ
ートアドレスはプログラムカウンタPC2にプリセツト
され、エンドアドレスは比較器103へ与えられる。こ
のプログラムカウンタPC2は与えられたスタートアド
レスによりプログラムメモリに記憶されているシーケン
スプログラムの1つを指定する。そして、指定されたシ
ーケンスプログラムが実行されるごとに1づつ歩進して
ゆき、次々とシーケンスプログラムを指定してゆく。こ
のプログラムカウンタPC2の計数値は比較器103に
て常時比較されており、プログラムカウンタPC2の計
数値がエンドアドレスと一致すると、シーケンスメモリ
100から読出されたステツプ番号のシーケンスプログ
ラムが終了したと判断し、比較器100はプログラムカ
ウンタに加算パルスを与える。これにより、プログラム
カウンタPC2は次のシーケンス番号のステツプ番号を
指定する。プログラムカウンタPC2で順次指定された
シーケンスプログラムは、アドレスレジスタ104、イ
ンストラクシヨンレジスタ105、デコーダ106、テ
ストフラツグ107にて構成されるシーケンスプログラ
ムの実行回路にて実行される。アドレスレジスタ104
はシーケンスプログラムの入出力アドレスデータを一時
記憶し、入出力要素の1つを選択する。インストラクシ
ヨンレジスタ105はシーケンスプログラムの命令部を
一時記憶するもので、この記憶された命令データはデコ
ーダ106にて解読される。テストフラツグ107はデ
コーダ106で解読された命令に基づき、その命令がテ
スト命令である場合には入出力アドレスデータにて指定
された入出力要素のオンオフ状態をテストし、出力命令
であれば指定された出力要素を付勢または無勢する信号
を出力する。また、デコーダ106にて解読された命令
がステツプ番号を書替える命令であつて、ステツプを移
行させるべき入力条件が満足していることがテストフラ
ツグ107にて判定され、条件満足の信号FTが出力さ
れたときはアンドゲート111が開かれることによりゲ
ー口10が開かれ、シーケンスプログラムの次に行うべ
きステツプ番号のデータがシーケンスメモI川00に書
込まれるようになつている。さらに、テストフラツグ1
07にて行なわれたテストの結果、入力条件不満足のも
のがあれば、その時点で指定されたステツプ番号のシー
ケンスプログラムの実行を終了し条件不満足の信号FT
を出力して、プログラムカウンタPC2をカウントアツ
プさせる。これにより次のシーケンス動作のステツプ番
号に対応したシーケンスプログラムが実行される。なお
、制御ク田ンク発生回路113は一連の制御クロツクを
出力し、シーケンスコントローラの動作のタイミングを
とるものである。以上のような構成によるシーケンスコ
ントローラのシーケンスプログラム実行動作を以下説明
する。
When performing sequence control with a computer such as a minicomputer, as described above, the sequence pointer SP
l Index pointer IP l Program counter PC
etc. were formed using an executable program and provided with a sequence function using software, but these functions can of course also be realized using a hardware circuit. This embodiment will be explained below with reference to FIG. In FIG. 12, sequence memory 100, index memory 101, and program memory 102 correspond to a sequence table, an index table, and a sequence program table, respectively. The sequence memory 100 is designed to store step numbers of sequence operations performed in parallel, one of which is sequentially designated by a program counter PCl corresponding to a sequence pointer, and the designated step number is Read out. Also,
The specified step number can be rewritten with a new step number. The index memory 101 stores the start address and end address of the sequence program corresponding to each step number, but in this case there is no equivalent to the index pointer 1P, and the step number read from the sequence memory There is a one-to-one correspondence between index data in the index memory, and when a step number is specified by the program counter PCl, the index data corresponding to this step number is read out. ing. Therefore, there will never be two or more pieces of index data with the same step number, and as shown in Figure 13, sequence programs with the same step number are grouped together in one place, and each sequence program with the same step is specified by index data. . Among the read index data, the start address is preset in the program counter PC2, and the end address is given to the comparator 103. This program counter PC2 specifies one of the sequence programs stored in the program memory by the given start address. Then, each time a designated sequence program is executed, it increments by 1, and the sequence programs are designated one after another. The count value of the program counter PC2 is constantly compared by the comparator 103, and when the count value of the program counter PC2 matches the end address, it is determined that the sequence program of the step number read from the sequence memory 100 has ended. , comparator 100 provides an addition pulse to the program counter. As a result, the program counter PC2 specifies the step number of the next sequence number. The sequence programs sequentially designated by the program counter PC2 are executed by a sequence program execution circuit composed of an address register 104, an instruction register 105, a decoder 106, and a test flag 107. address register 104
temporarily stores the input/output address data of the sequence program and selects one of the input/output elements. The instruction register 105 temporarily stores the instruction part of the sequence program, and the stored instruction data is decoded by the decoder 106. Based on the instruction decoded by the decoder 106, the test flag 107 tests the on/off state of the input/output element specified by the input/output address data if the instruction is a test instruction, and if the instruction is an output instruction, the specified Outputs a signal that energizes or deenergizes the output element. Further, the test flag 107 determines that the instruction decoded by the decoder 106 is an instruction to rewrite the step number and that the input conditions for moving the step are satisfied, and a signal FT indicating that the conditions are satisfied is output. When this occurs, the game gate 10 is opened by opening the AND gate 111, and the data of the step number to be performed next in the sequence program is written into the sequence memo I river 00. Furthermore, test flag 1
As a result of the test conducted in step 07, if there is any input condition that is unsatisfactory, the execution of the sequence program of the step number specified at that point is terminated, and a signal indicating that the conditions are unsatisfied is sent.
is output, causing the program counter PC2 to count up. As a result, the sequence program corresponding to the step number of the next sequence operation is executed. The control clock generation circuit 113 outputs a series of control clocks to determine the timing of the operation of the sequence controller. The sequence program execution operation of the sequence controller configured as above will be described below.

今、プログラムカウンタPClがりセツトしている状態
でシーケンスコントローラの運転が開始されたものとす
ると、このプログラムカウンタPC2の内容はOとなつ
ているのでシーケンスメモリのO番地に記憶されている
ステツプ番号0000が読出される。これにより、イン
デツクスメモリよりスタートアドレス1000およびエ
ンドアドレス1010が読出されるため、プログラムカ
ウンタPC2に1000がプリセツトされる。すると、
プログラムメモリの1000番地に記憶されている入力
条件のテストであるTNASPOが実行される。この命
令はソフトウエアでシーケンス制御を行う場合と異つて
おり、ステツプOがオンかどうかをアンド論理でテスト
する命令である。したがつて、本実施例のシーケンスコ
ントローラにおいては、現在実行中のステツプ番号に対
応した外部ダミーまたはプログラムメモリ内のダミーを
セツトしておき、このダミーをテストすることにより、
ステツプ番号を入力条件としてテストするようになつて
いる。このプログラムの実行が終了するとプログラムカ
ウンタPC2を+1して次のプログラムを実行する。こ
のようにして、順次プログラムの実行がなされステツプ
を移行させる入力条件が満足された場合には次に行うス
テツプ番号がゲート110を介してシーケンスメモリの
番地に書込まれる。そして、プログラムカウンタPC2
の計数値が1010となつて比較器にてステツプ番号0
のシーケンスプログラムの実行が終了したことが判別さ
れると、プログラムカウンタPC2はカウントアツプさ
れ、シーケンスメモリ1番地に記憶されているステツプ
番号0100が指定される。また、入力条件が不満足で
あり、テストフラツグ107より信号FTが出力された
場合にも同様にプログラムカウンタPC2を+1するこ
とにより、ステツプ番号0100が指定される。これに
よりインデツクスメモリ101の0100番地に記憶さ
れているインデツクスデータが読出され、前記の場合と
同様にステツプ番号0100に対応したシーケンスプロ
グラムが実行される。このシーケンスプログラムの実行
が終了すると再びプログラムカウンタPClは+1され
るが、このプログラムカウンタPClは並行して行われ
るシーケンス動作の数だけ計数できる必要があり、この
場合は2進のカウンタとなつているので、再びシーケン
スメモリ0番地に記憶されているステツプ番号0000
が指定される。このようにして、ステツプ0000(5
0100のシーケンスプログラムのみが交互に繰返えし
実行される。そしてステツプ移行条件が満足されるとそ
れぞれステツプ番号が書替えられ、そのステツプに対応
したシーケンスプログラムのみが実行され、ステツプが
進行してゆく。このようにして、並列して行われる複数
のシーケンス動作を1台のシーケンスコントローラで制
御できる。また、この場合もソントウエアでシーケンス
制御を行う場合と同様に並行して行われる複数のシーケ
ンスコントローラの動作のタイミングを合せることが可
能である。上記のように本発明によるシーケンスコント
ローラにおいては、現在行われている動作ステツプを記
憶する手段と、この動作ステツプを順次指定する手段と
、指定された動作ステツプに対応したシーケンスプログ
ラムを指定する手段と、ステツプを移行させる条件を満
足した場合に、次に行うべき動作ステツプを前記記憶手
段に書込む手段とを設けたことにより、サイクル線図か
ら直接プログラムできる簡単なシーケンスプログラムを
用いることが出来、さらに、現在実行されている動作ス
テツプに対応したシーケンスプログラムのみが実行され
るため、複雑なシーケンス制御でもスキヤンニングタイ
ムが長くなることはなく、大容量のシーケンス制御プロ
グラムにおいても全くシーケンス匍脚に影響を与えるこ
となくプログラムの実行を行うことが出来る利点を有し
ている。
Now, assuming that the sequence controller starts operating with the program counter PC1 reset, the content of the program counter PC2 is O, so the step number stored at address O in the sequence memory is 0000. is read out. As a result, the start address 1000 and the end address 1010 are read from the index memory, so that the program counter PC2 is preset to 1000. Then,
TNASPO, which is a test of the input conditions stored at address 1000 in the program memory, is executed. This instruction is different from the case where sequence control is performed by software, and is an instruction to test whether step O is on or not using AND logic. Therefore, in the sequence controller of this embodiment, by setting an external dummy or a dummy in the program memory corresponding to the step number currently being executed, and testing this dummy,
It is designed to test using the step number as an input condition. When the execution of this program is completed, the program counter PC2 is incremented by 1 and the next program is executed. In this way, when the program is executed sequentially and the input condition for moving the step is satisfied, the number of the next step to be performed is written to the address of the sequence memory via the gate 110. And program counter PC2
When the count value becomes 1010, step number 0 is determined by the comparator.
When it is determined that the execution of the sequence program has ended, the program counter PC2 is incremented and step number 0100 stored at address 1 of the sequence memory is designated. Furthermore, even if the input conditions are unsatisfactory and the signal FT is output from the test flag 107, step number 0100 is designated by incrementing the program counter PC2 by 1. As a result, the index data stored at address 0100 of index memory 101 is read out, and the sequence program corresponding to step number 0100 is executed in the same way as in the previous case. When the execution of this sequence program is finished, the program counter PCl is incremented by 1 again, but this program counter PCl needs to be able to count the number of sequence operations that are performed in parallel, and in this case it is a binary counter. Therefore, step number 0000 stored in sequence memory address 0 is returned.
is specified. In this way, step 0000 (5
Only the sequence program 0100 is repeatedly executed alternately. When the step transition condition is satisfied, each step number is rewritten, only the sequence program corresponding to that step is executed, and the steps progress. In this way, a plurality of sequence operations performed in parallel can be controlled by one sequence controller. Furthermore, in this case as well, it is possible to synchronize the timing of the operations of a plurality of sequence controllers that are performed in parallel, as in the case where sequence control is performed using software. As described above, the sequence controller according to the present invention includes means for storing the operation step currently being performed, means for sequentially specifying the operation step, and means for specifying a sequence program corresponding to the specified operation step. By providing means for writing the next operation step to be performed in the storage means when the conditions for transitioning the step are satisfied, it is possible to use a simple sequence program that can be programmed directly from the cycle diagram. Furthermore, since only the sequence program that corresponds to the currently executed operation step is executed, scanning time will not increase even with complex sequence control, and even large-volume sequence control programs will not affect the sequence control at all. This has the advantage that the program can be executed without giving any

また、本発明によるシーケンスコントローラにおいては
、複数のステツプのそれぞれに対応して形成されたプロ
グラムプロツクをプロツク単位で選択して、繰返し実行
するシーケンスプログラムを順次変更して行くようにし
たので、歩進条件となる複数の入出力要素の全てが歩進
条件を満足したことを確実に検出できる上、各プログラ
ムプロツク内に、非常停止ボタンが押されたか否かをテ
ストして可動体の移動を停止させるといつたインタロツ
クのプログラムも書いておくことができ、安全性の高い
シーケンス制御を達成できる利点も有る。
Furthermore, in the sequence controller according to the present invention, program blocks formed corresponding to each of a plurality of steps are selected for each block, and the sequence program to be repeatedly executed is sequentially changed. In addition to reliably detecting that all of the multiple input/output elements that serve as advance conditions satisfy the advance conditions, it is also possible to test whether or not the emergency stop button has been pressed in each program block to prevent movement of the movable object. It is also possible to write an interlock program to stop the system, which has the advantage of achieving highly safe sequence control.

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

第1図はシーケンス制御の対象となる機械の構成を示す
図、第2図は第1図に示す機械の動作を示すサイクル線
図、第3図は第2図のサイクル線図を基に作成したリレ
ーマトリクス図、第4図は第3図のリレーマトリクス図
を基にプログラムしたシーケンスプログラムの従来例を
示す図、第5図は本発明シーケンスコントローラのシー
ケンスプログラムの作成の基礎となるサイクル線図、第
6図は第5図に示すサイクル線図を基にプログラムした
シーケンスプログラム、第7図は本発明によるシーケン
スコントローラの第1実施例を示すプロツク図、第8図
は本発明シーケンスコントローラの動作を説明するため
の制御対象の一例を示す図、第9図は第8図に示す機械
の動作を表わすサイクル線図、第10図は、記憶装置に
記憶されているシーケンスプログラムを示す図、第11
図は第7図におけるコンピユータの実行プログラムを表
わすフローチヤート、第12図は本発明によるシーケン
スコントローラの第2実施例を示すプロツク図、第13
図は第12図におけるシーケンスメモリ、インデツクス
メモI八プログラムメモリのデータ記憶状態を示す図で
ある。 10,108・・・・・・入力回路、11・・・・・・
インタフエイス、12,109・・・・・・出力回路、
13・・・・・・コンピユータ、100・・・・・・シ
ーケンスメモ1八101・・・・・・インデ゛ツクスメ
モl八 102・・・・・・プログラムメモリ、103
・・・・・・比較器、104・・・・・・アドレスレジ
スタ、105・・・・・・インストラクシヨンレジスタ
、106・・・・・・デコーダ、107・・・・・・テ
ストフラツグ、110・・・・・・ゲート、111・・
・・・・アンドゲート、112・・・・・・オアゲート
、113・・・・・・制御クロツク発生回路。
Figure 1 is a diagram showing the configuration of the machine subject to sequence control, Figure 2 is a cycle diagram showing the operation of the machine shown in Figure 1, and Figure 3 is created based on the cycle diagram in Figure 2. 4 is a diagram showing a conventional example of a sequence program programmed based on the relay matrix diagram of FIG. 3, and FIG. 5 is a cycle diagram that is the basis for creating a sequence program for the sequence controller of the present invention. , FIG. 6 is a sequence program programmed based on the cycle diagram shown in FIG. 5, FIG. 7 is a block diagram showing the first embodiment of the sequence controller according to the present invention, and FIG. 8 is the operation of the sequence controller according to the present invention. 9 is a cycle diagram showing the operation of the machine shown in FIG. 8. FIG. 10 is a diagram showing a sequence program stored in a storage device. 11
12 is a flowchart showing the execution program of the computer in FIG. 7, FIG. 12 is a block diagram showing a second embodiment of the sequence controller according to the present invention, and FIG.
This figure shows the data storage state of the sequence memory and index memory I8 program memory in FIG. 12. 10,108...Input circuit, 11...
Interface, 12, 109...Output circuit,
13... Computer, 100... Sequence memo 18 101... Index memory 18 102... Program memory, 103
... Comparator, 104 ... Address register, 105 ... Instruction register, 106 ... Decoder, 107 ... Test flag, 110・・・・・・Gate, 111...
. . . AND gate, 112 . . . OR gate, 113 . . . Control clock generation circuit.

Claims (1)

【特許請求の範囲】[Claims] 1 複数のステップ動作よりなる一連のシーケンス動作
を制御するために、予めプログラムされたシーケンスプ
ログラムにしたがつて入出力要素のオンオフ状態をテス
トし、その結果により出力要素を付勢、無勢して被制御
対象を制御するシーケンスコントローラにおいて、前記
ステップ動作のそれぞれに対応して、ステップ歩進条件
となる複数の入出力要素をテストするための複数のテス
トプログラムとこのテストプログラムによるテスト結果
に基づいて所定の出力要素を付勢もしくは無勢するため
の出力プログラムとステップ歩進条件が満足している場
合にステップの歩進を指令する特別出力命令とを少なく
とも記憶可能な記憶手段と、前記各ステップに対応する
プログラムブロックの読出開始番地を記憶するインデッ
クステーブルと、前記記憶手段の読出アドレスを指定す
るプログラムカウンタと、テストプログラムによるテス
ト結果に基づいて操作されるテストフラッグと、前記特
別出力命令が読出されたことに応答して前テストフラッ
グが条件満足の状態にあるか否かを判別し、条件満足の
状態にある場合には次ステップの読出開始番地を前記プ
ログラムカウンタにロードし、条件不満足の場合には現
在実行中のステップの読出し開始番地を前記プログラム
カウンタにロードする制御手段とを備えたことを特徴と
するシーケンスコントローラ。
1. In order to control a series of sequence operations consisting of multiple step operations, the on/off states of input/output elements are tested according to a preprogrammed sequence program, and output elements are energized or deenergized based on the test results. In a sequence controller that controls a controlled object, a plurality of test programs for testing a plurality of input/output elements serving as step step conditions correspond to each of the step operations, and a predetermined test program is performed based on the test results of the test program. storage means capable of storing at least an output program for energizing or deenergizing the output element of the step and a special output command for instructing the step to advance when the step advance condition is satisfied, and corresponding to each of the steps. an index table for storing a reading start address of a program block to be read; a program counter for specifying a read address of the storage means; a test flag operated based on a test result by a test program; In response to this, it is determined whether or not the previous test flag satisfies the condition, and if the condition is satisfied, the read start address of the next step is loaded into the program counter, and if the condition is not satisfied, A sequence controller comprising control means for loading a read start address of a step currently being executed into the program counter.
JP4833376A 1976-04-27 1976-04-27 sequence controller Expired JPS5927928B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4833376A JPS5927928B2 (en) 1976-04-27 1976-04-27 sequence controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4833376A JPS5927928B2 (en) 1976-04-27 1976-04-27 sequence controller

Publications (2)

Publication Number Publication Date
JPS52131082A JPS52131082A (en) 1977-11-02
JPS5927928B2 true JPS5927928B2 (en) 1984-07-09

Family

ID=12800475

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4833376A Expired JPS5927928B2 (en) 1976-04-27 1976-04-27 sequence controller

Country Status (1)

Country Link
JP (1) JPS5927928B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01145731U (en) * 1988-03-30 1989-10-06

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56129906A (en) * 1980-03-14 1981-10-12 Komatsu Ltd Control system for numerical controller
JPS5875212A (en) * 1981-10-27 1983-05-06 Idec Izumi Corp Stepping arithmetic system of stage stepping type sequence controller
JPS58158709A (en) * 1982-03-15 1983-09-21 Kensuke Hasegawa Programmable controller
JPS5916006A (en) * 1982-07-16 1984-01-27 Ckd Corp Control method of high input responsibility sequencer
JPS59140508A (en) * 1983-01-31 1984-08-11 Fuji Electric Co Ltd Executing method of programmable controller
JPS59205605A (en) * 1983-05-07 1984-11-21 Hitachi Ltd Sequence controller
JPS60160439A (en) * 1984-01-31 1985-08-22 Nippon Electric Ind Co Ltd Address deciding method for jump with no designation of destination
JPH0619652B2 (en) * 1985-02-13 1994-03-16 株式会社タイテツク Sequence control device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01145731U (en) * 1988-03-30 1989-10-06

Also Published As

Publication number Publication date
JPS52131082A (en) 1977-11-02

Similar Documents

Publication Publication Date Title
US4564913A (en) Flexible transfer machine
JPS6363921B2 (en)
JPS5927928B2 (en) sequence controller
US4751652A (en) Numerical control drilling restart control system
US4748552A (en) Sequence control system
US8989891B2 (en) Machining tool control system and control method
JPH03290707A (en) Numerical controller
JPH02151908A (en) Numerical controller with simulation function
JP2708983B2 (en) Program display device
JPS6232802B2 (en)
KR950011050A (en) Automatic setting of Z axis origin offset amount
JPH064214B2 (en) Machining sequence control method for numerically controlled machine tools
JPH07113851B2 (en) Numerical control machine tool
JP2642451B2 (en) Numerical control unit
JP3331357B2 (en) Programmable controller
JP2767817B2 (en) Simulated operation method of sequencer contacts
JPH02108106A (en) Numerical controller
JPH0969007A (en) Multi-robot reproduction control system
JPH0682291B2 (en) Numerical control device
JP2581019B2 (en) How to debug sequence programs
JPH05150813A (en) Programmable controller
JPH06309026A (en) Manual operation teaching device for programmable controller
JPH01292401A (en) Method for controlling sequence
JPS63250705A (en) Numerical controller
JPH0314105A (en) Re-forward motion method for numerical controller