JP3692990B2 - Numerical controller - Google Patents
Numerical controller Download PDFInfo
- Publication number
- JP3692990B2 JP3692990B2 JP2001298185A JP2001298185A JP3692990B2 JP 3692990 B2 JP3692990 B2 JP 3692990B2 JP 2001298185 A JP2001298185 A JP 2001298185A JP 2001298185 A JP2001298185 A JP 2001298185A JP 3692990 B2 JP3692990 B2 JP 3692990B2
- Authority
- JP
- Japan
- Prior art keywords
- processing
- execution
- condition
- block
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P80/00—Climate change mitigation technologies for sector-wide applications
- Y02P80/10—Efficient use of energy, e.g. using compressed air or pressurized fluid as energy carrier
- Y02P80/15—On-site combined power, heat or cool generation or distribution, e.g. combined heat and power [CHP] supply
Description
【0001】
【発明の属する技術分野】
本発明は複数ブロックから構成されるNCプログラムをブロックごとに順次解析して実行する数値制御装置に関する。
【従来の技術】
複数ブロックから構成されるNCプログラムをブロックごとに順次解析して実行する数値制御装置において、複数の軸を制御するシステムでは、これら複数の軸の間で同期をとって軸移動をしなければならない場合がある。また、一つの軸のみを制御するものであっても、外部から入力される信号がオン又はオフするのを待って軸移動を開始する等の処理が必要となる場合がある。このような場合には以下に例示するように、NCプログラムの実行を進めるための実行条件(この例ではSB277=1)が満足されるまで無限ループして実行条件が成立するのを待ち、実行条件が成立すれば次以降のブロックに処理を移すようにすることができる。
[WHILE(SB277=1) DO](*定寸上昇端オン待ち*)
[ENDWHILE;]
【0002】
しかし、このようなNCプログラムを実行すると以下のような問題が発生する。即ち、WHILEコマンドのブロックとENDWHILEコマンドは別個のブロックであるため、毎回それぞれのブロックのデータを読み出し、解析して実行しなければならない。このため、数値制御装置のマイクロプロセッサのNCプログラム処理にかかる負荷が大きくなる。NCプログラム処理がマイクロプロセッサの処理能力の大部分を占有してしまうと、NCプログラム処理と並行して行われるプログラマブルコントローラやモニタ装置との通信処理や、数値制御状態の状態を表示する表示処理等の周辺処理を実行する時間が限られてしまう。この結果、数値制御装置の動作状況をモニタして表示するモニタ装置の表示内容あるいは数値制御装置のLED等による表示内容にリアルタイム性がなくなったり、他の制御機器とのデータ交換に要する時間が通常よりも長く掛かる等の障害が発生する。
【0003】
この現象を説明するため、上記NCプログラムを実行する際のタイムチャートを図8に示す。図8において▲1▼はWHILEコマンドブロックの処理、▲2▼はENDWHILEコマンドブロックの処理を表す。NCプログラムの解析及び実行処理は一定周期で発生するトリガにより起動され、1ブロックの処理を実行する。トリガが発生する周期はWHILEコマンドブロックやENDWHILEコマンドブロック等の1ブロックの解析処理及び実行処理に要する時間に、ある程度の余裕を持たせた時間となっている。トリガ発生周期が必要以上に長いとNCプログラムの実行が遅くなり、短いと1回の周期内で1ブロックの処理を終えることができない。トリガ発生周期は装置のハードウェアの処理能力に応じて適当な値が設定されている。一般的には一定時間毎に発生するタイマ割り込み信号がトリガとして用いられる。
【0004】
周辺処理はこれらNCプログラムの処理が行われていない時に実行される。図8に示されるように、NCプログラムの解析・実行処理に時間を要するため、WHILEコマンドブロック・ENDWHILEコマンドブロックの処理中は周辺処理を行う時間が少なくなっている。このために数値制御装置の動作状況をモニタして表示するモニタ装置の表示内容にリアルタイム性がなくなったり、他の制御機器とのデータ交換に要する時間が通常よりも長く掛かる等の障害が発生するのである。
【0005】
この障害の発生を防ぐため、従来はWHILEコマンドの次にドウェルコマンド(指定された時間だけNCプログラムの実行をアイドルするコマンド)を挿入し、このドゥエル時間中に周辺処理が実行されるようにしていた。このドゥエル時間は通常、数百msである。ドゥエルコマンド追加後のNCプログラムは次のようになる。
[WHILE(SB277=1) DO](*定寸上昇端オン待ち*)
G04P0.2 (*200msドゥエル*)
[ENDWHILE;]
【0006】
このNCプログラムを実行する際のタイムチャートを図9に示す。図9において、▲1▼はWHILEコマンドブロックの処理、▲2▼はENDWHILEコマンドブロックの処理を表し、○はドゥエルコマンドブロックの処理を表す。ドゥエルコマンドブロックの処理は最初に一度解析(デコード)処理をし、その後は割り込み信号発生時にドゥエル時間が経過したかの確認のみを行う。指定時間が経過すれば次のブロック(ENDWHILEコマンドブロック)の処理を行う。これにより、割り込み信号発生の度に解析処理を行わないので、周辺処理を行う時間が確保できる。
【0007】
【発明が解決しようとする課題】
従って、このようなNCプログラムによればドゥエル時間中に周辺処理を実行することができ、先に述べたような障害は発生しないが、半面、ドゥエルコマンドで指定された時間中は実行条件が成立しているかの判定を行わないので、実行条件成立を検知するタイミングが遅れてしまうという問題がある。
【0008】
例えば、特願2001−210323に示すような、2つの砥石台がX軸方向とZ軸方向にそれぞれ独立して動作する研削盤の場合には、砥石台同士の干渉を防ぐ為、又は各砥石台におけるX軸方向への動作とZ軸方向への動作を協調して行う為に、1サイクル中に何度も軸同士で同期をとって軸の動作をしなければならない。また、工作物般入出信号等ともインタロックをとって軸移動を開始するなどの処理が必要となる。これらの場合において、実行条件が成立しても、最大でドゥエルコマンドにより指定された時間の間は実行条件成立を検知することができないので、加工サイクル全体のサイクルタイムが数秒間延びてしまうという問題が発生する。
【0009】
また、この問題とは別に、何らかのトラブルにより実行条件が長時間成立しない場合には、NCプログラムの処理が先に進まず、サイクルタイムオーバーによって警報が出力されるまでオペレータに異常が報知されないため、異常発生から復旧作業に取り掛かるまでの時間が長くなってしまうという問題があった。
【0010】
この問題の対策として、実行条件ごとのI/O信号をプログラマブルコントローラに出力し、各実行条件が成立する待ち時間をプログラマブルコントローラにて監視すれば、制限時間を超えた際には直ちに警報を出力するようにすることができる。しかし、この対策を行うには、時間監視の対象となる実行条件ごとにシーケンスプログラムを組まなければならないため設計者の負担が大きく、また、シーケンスプログラムのスキャンタイムも伸びてしまう。さらに、I/O信号の多くを占有してしまうため数値制御装置とプログラマブルコントローラ間のI/O信号点数が足りなくなるという新たな問題が発生する。
【0011】
本発明はこれらの問題点に鑑み、実行条件の成立を早期に検知するとともに、実行条件ごとのI/O信号をプログラマブルコントローラに出力しなくても、実行条件が成立するまでの待ち時間が指定したタイムアウト時間を超えた際には直ちにオペレータに異常を知らせる等の必要な異常処理を行うことが可能な数値制御装置を提供することを目的とする。
【0012】
【課題を解決するための手段】
請求項1記載の発明では、一連のブロックからなるNCプログラムの中の1ブロックである条件待ちブロックに関連して、該条件待ちブロック以降のブロックの処理実行を可能にするための実行条件と該実行条件成立待ち時間のタイムアウト時間とを記憶する。条件待ちブロックの処理時には実行条件とタイムアウト時間とから条件待ちブロックの処理内容を解析して解析結果を記憶する。所定のトリガ発生に起因して条件待ちブロックの実行処理を行う際には、毎回前記解析処理を行うことなく、前記記憶した解析結果に基づいて実行処理を行う。これにより周辺処理を行うための処理時間を確保する。
この実行処理は以下の手順(a)〜(d)により行われる。
(a)前記実行条件が成立しているか否かを判定する。
(b)前記判定の結果が肯定判定である場合には前記条件待ちブロック以降のブロックの処理実行を可能にする。
(c)前記判定の結果が否定判定である場合には次回のトリガ発生時までの間に周辺処理を行う。
(d)前記実行条件の成立待ち時間が前記タイムアウト時間を超えればタイムアウトエラーと判定する。
【0013】
これにより、周辺処理を行うための処理時間を確保しながら、実行条件不成立の場合には実行条件が成立したか否かの再判定をトリガ発生毎に行い、且つ、条件成立の待ち時間がタイムアウト時間を超えれば直ちに異常と判断する。
【0014】
請求項2記載の発明では、実行条件の成立を待つ時間がタイムアウト時間を超えた場合にはタイムアウト時間を超えたことを表す情報を条件待ちブロックに続くブロックで参照可能な領域に記憶するとともにNCプログラムの処理を前記条件待ちブロックに続くブロックに進める。前記条件待ちブロックに続くブロックでは、前記記憶されたタイムアウト時間を超えたことを表す情報に基づいて必要な異常処理を行う。これにより、オペレータによる復旧作業が速やかに行える。
【0015】
請求項3記載の発明では、実行条件及びタイムアウト時間を条件待ちブロックの中に記述することとした。これにより、実行条件の成立時に実行されるブロックの内容と、実行条件及びタイムアウト時間との関係がNCプログラム上で明確に把握できる。
【0016】
請求項4記載の発明では、実行条件及び前記タイムアウト時間の少なくとも一方はパラメータとして記憶されることとした。これにより、実行条件、タイムアウト時間の設定及び変更が容易に行える。
【0017】
【発明の実施の形態】
以下、本発明の実施の形態を図面を参照しながら説明する。図1は本発明の数値制御装置1及びこれと接続された装置からなる設備制御システムの構成図である。
【0018】
数値制御装置1は、モニタ装置2やプログラマブルコントローラ3との通信を行いながら、ユーザーが作成したNCプログラムに従って設備5の制御をすべく、サーボアンプ4に指令を送るものである。モニタ装置2は数値制御装置1の状態を通信により読み出し、ディスプレイに表示するものである。プログラマブルコントローラ3は数値制御装置1や、制御対象である設備5に組みつけられたリミットスイッチ51や近接スイッチ52等とのデータ交換を行いながら設備制御全体を統括するコントローラである。サーボアンプ4は数値制御装置1の指令に基づき、設備5に組みつけられたサーボモータ53を駆動するものである。一台の数値制御装置1に接続されるサーボアンプは一つのみの場合もあり、複数の場合もある。
【0019】
図2は本発明の数値制御装置1の機能を示すブロック図である。この図はソフトウェアの処理過程を1つのブロックで表現したものである。
【0020】
本発明の数値制御装置1は、プログラムメモリ10、プログラムメモリ10と接続された解析処理部11、解析処理部11に一定周期で発生する割り込み信号出力する割り込み信号発生部12、解析処理部11と接続された実行処理部13、実行処理部13と接続された駆動処理部14及びデータメモリ15、データメモリ15と接続された通信処理部16とから構成される。
【0021】
数値制御装置1の稼動時には、プログラムメモリ10に記憶されたNCプログラムがブロック毎に解析処理部11に読み出される。解析処理部11では読み出したブロックのデータを解析し、この解析結果に基づいて実行処理部13で実行処理を行う。該ブロックが軸移動指示を伴うブロックであれば駆動処理部14に位置決め座標や速度、移動時間等の指定を伴う駆動指示を行う。駆動処理部14ではこの駆動指示に従ってサーボアンプ4に指令を送り、サーボモータ53の動作を制御する。モニタ装置2及びプログラマブルコントローラ3との通信は通信処理部16により行われる。この通信処理は解析処理部11での解析処理、実行処理部13での実行処理、又は、駆動処理部14での駆動処理の何れもが実行されていない時に実行される。解析処理部11、実行処理部13、駆動処理部14、及び通信処理部16で行われる処理で使用する変数等のデータはデータメモリ15に記憶される。
【0022】
NCプログラムにおいて、他の軸との同期をとって軸移動を開始するブロックや、外部からの入力信号の変化を待って何らかの処理を行うブロックの前には条件待ちブロックが記述される。条件待ちブロックにはNCプログラムの実行を、条件待ちブロック以降のブロックに進める条件である実行条件と、該実行条件が成立するのを待つ時間の制限値であるタイムアウト時間とが記述されている。条件待ちブロックのフォーマットは以下に示すものである。
G31G04P_K_
【0023】
ここで、「G04」はこのブロックが条件待ちブロックであることを表している。「K」は実行条件を指定することを示す識別子であり、「K」に続けてデータのビットアドレスを指定する。「P」はタイムアウト時間を指定することを示す識別子であり、「P」に続けて秒単位の時間を指定する。「G31」は前記「K」で指定されたビットアドレスのデータが1であるときに実行条件が成立したとみなすことを示すものである。「G31」に変えて「G32」が指定された場合は該ビットアドレスのデータが0であるときに実行条件が成立したとみなす。
【0024】
例えば、「SB227」という信号が0である場合に当該コマンドブロックの次以降のNCプログラムを実行し、「SB227」信号が0でない場合には最大1秒まで「SB227」信号の監視をするためのコマンドは、
G31G04P1K[SB227]
となる。
【0025】
実行条件が成立しているか否かの監視を開始してから「P」で指定されたタイムアウト時間(上記の例では1秒)を経過しても実行条件が成立しない場合は異常と判断する。
【0026】
NCプログラムの各ブロックの解析処理部11による処理は、割り込み信号発生部12により一定周期で出力される割り込み信号をトリガとして起動され、解析した結果に基づいて実行処理部13にて実行処理をする。処理に長時間を要するブロックの場合は初回の割り込み信号発生時に解析した結果に基づいて2回目以降の割り込み信号発生時の処理を実行する。NCプログラム中のどのブロックを処理すべきかは各ブロックの先頭に付されているシーケンス番号により、プログラムカウンタと呼ばれるレジスタで管理される。
【0027】
NCプログラムの1ブロックの処理手順の概要を図3に示すフローチャートにより説明する。割り込み信号発生部12で割り込み信号が発生すると、解析処理部11の処理により、プログラムカウンタで指定されるシーケンス番号のブロックが初回の処理を行うものであるかを判断する(ステップ10)。ステップ10の判断の結果がYesであれば、プログラムメモリ10から当該ブロックのコマンドデータを読み込み(ステップ11)、該コマンドデータに含まれる実行条件とタイムアウト時間とから実行処理部13で実行すべき処理内容を記憶する(ステップ12)。次に、該解析した結果を記憶する(ステップ13)。実行処理部13ではステップ13にて記憶した解析結果に基づいて実行処理を行う(ステップ14)。ステップ10の判断の結果がNoであれば、前回以前の割り込み信号による解析処理の起動時に既に解析結果を記憶したブロックの処理を継続するものであるので、ステップ11から13の処理を再度行うことなく、ステップ13で記憶された解析結果に基づく処理(ステップ14)を実行処理部13により行う。
【0028】
次に実行処理部13がステップ14にて条件待ちブロックの処理を行う場合の処理手順を図4に示す。コマンドデータの解析結果から実行条件を抽出し、実行条件が成立しているか否かを判定する(ステップ20)。判定結果が肯定判定であれば、条件待ちブロックの次のブロックのシーケンス番号をプログラムカウンタに書き込み(ステップ21)、ステップ14の処理を終了する。一方、ステップ20での判定結果が否定判定であれば、現在実行している処理が初回の処理か否かを判断する(ステップ22)。初回の処理であれば時間計測を開始し(ステップ23)、ステップ14の処理を終了する。2回目以降の処理であれば、ステップ23で時間計測を開始した時点からの経過時間とコマンドデータの解析結果から抽出したタイムアウト時間とを比較する(ステップ24)。比較の結果、経過時間がタイムアウト時間を超えていなければそのままステップ14の処理を終了し、超えていればタイムアウトエラーが発生したことを示すエラー情報をデータメモリ13に記憶する(ステップ25)。このエラー情報はNCプログラムのコマンドにより参照することができる。この後、条件待ちブロックの次のブロックのシーケンス番号をプログラムカウンタに書き込み(ステップ26)ステップ14の処理を終了する。ステップ14の処理終了後、次の割り込み信号が発生するまでは周辺処理を実行する。
【0029】
ステップ21又はステップ26でプログラムカウンタの値が書き換えられた場合には、次回の割り込み信号発生時に当該条件待ちブロックの次のブロックの処理が行われる。プログラムカウンタの値が書き換えられなかった場合には次回の割り込み信号発生時に再度条件待ちブロックのブロックの処理が行われる。
【0030】
条件待ちブロック以降のブロックでの設備制御処理を、図5のフローチャートに例示する。ステップ30ではデータメモリ13に記憶されたエラー情報を参照し、ステップ20において実行条件が成立したことにより条件待ちブロックの処理を終了したのか、又はステップ24でタイムアウトエラー発生により終了したのかを判断して処理を分岐する。実行条件の成立により終了したのであれば設備制御を継続する(ステップ31)。タイムアウトエラーが発生したのであれば軸を原位置に戻す等の異常処理をし(ステップ32)、アラームを出力してオペレータに異常発生を報知する(ステップ33)。
【0031】
以上、説明した手順により、条件待ちブロックが実行された際に、該コマンドブロックで指定される実行条件が成立していれば直ちに次のブロックに実行処理を移行する。実行条件が成立していなければ、タイムアウト時間が経過するまで実行条件が成立しているかを繰り返しチェックし、タイムアウト時間を経過すれば異常と判断する。
【0032】
これにより、割り込み信号が発生する度に実行条件の成立をチェックするので、実行条件の成立を早期に検知することができるとともに、実行条件が成立するまでの待ち時間がタイムアウト時間を超えた際には、直ちにオペレータに異常を知らせる等の必要な異常処理を行うことができる。
【0033】
また、条件待ちブロックの解析処理は、割り込み信号による初回の解析・実行処理の起動時にのみ行うため、実行条件不成立により何度も繰り返して該コマンドブロックの解析・実行処理が起動される場合には実行処理のみが行われる。このため、通信処理部14でモニタ装置2やプログラマブルコントローラ3との通信処理等の周辺処理を行う時間が確保され、表示内容の更新が遅くなったり、通信速度が遅くなる等の障害が発生することがない。
【0034】
本発明の条件待ちブロックの処理におけるタイムチャートを図6に示す。この図において、●は条件待ちブロックに係る処理であり、※は条件待ちブロックの次のブロックに係る処理であることを表す。この図からも明らかなように、毎回解析処理を行わないため、一回の割り込み信号発生時におけるプログラム解析・実行処理に要する時間が短く、周辺処理を行う時間が十分に確保されている。
【0035】
なお、ステップ24でタイムアウトエラーを検知した場合には、異常を報知した後に以降のブロックに実行処理を進めることなくNCプログラムの実行を停止するようにしてもよい。あるいは、条件待ちブロックの記述内容によりNCプログラムの実行を停止するか又は継続するかを区別するようにしてもよい。
【0036】
また、実行条件やタイムアウト時間の指定は、NCプログラムのコマンドによるものでなく、パラメータの設定によるものでもよい。パラメータ設定による場合は図7に例示するように、実行条件やタイムアウト時間の設定をNCプログラム中に複数存在する条件待ちブロックの何れに対応するものかを識別する識別コードとともに設定する。この場合、NCプログラムに記述するコマンドブロックのフォーマットは以下に示すようなものになる。
G31G04I_
ここで「I」は図7中のマトリックスにおける参照すべき識別コードを指定する識別子である。例えば、識別コードが20の場合は「G31G04I20」となる。この場合、上記のNCプログラムのコマンドとは異なり、ブロック一つ一つに実行条件、タイムアウト時間を指定する必要はない。即ち、図7のマトリックスのように一括して設定ができる。
【0037】
また、本実施の形態においては一定の周期で発生する割り込み信号を解析・実行処理を開始するトリガとしたが、ソフトウェアの処理により解析・実行処理を開始するトリガを生成するものでもよい。
【0038】
【発明の効果】
以上、述べたように本発明においては、実行条件が成立しているかの判定と、実行条件不成立の場合に再判定を繰り返し行う処理と、実行条件成立待ちタイムアウトエラーの検出とを一回の条件待ちブロックの実行処理の中で行うこととした。これにより、始めに条件待ちブロックの処理内容を解析した結果を記憶し、これに基づいて所定のトリガ発生毎に実行処理が行えるので、高い頻度で実行条件が成立しているか否かの判定を行いながら、NCプログラム処理よりも周辺処理行う時間が確保できる。また、実行条件が成立するまでの待ち時間がタイムアウト時間を超えた際には、直ちにオペレータに異常を知らせる等の必要な異常処理を行うことができる。ここで、実行条件成立の時間を監視するためにI/O信号をプログラマブルコントローラへ送り、プログラマブルコントローラでのシーケンスプログラム処理によりタイムアウトエラーを検出する必要もない。従って、シーケンスプログラムのスキャンタイムが伸びたり、多数のI/O点数を占有してしまう等の問題も発生しない。
【図面の簡単な説明】
【図1】本発明の実施の形態における設備制御システムの構成図である。
【図2】本発明の実施の形態における数値制御装置の機能を示すブロック図である。
【図3】NCプログラムの1ブロックの処理手順の概要を示すフローチャートである。
【図4】条件待ちブロックの処理手順を示すフローチャートである。
【図5】条件待ちブロック以降の処理手順を示すフローチャートである。
【図6】本発明の条件待ちブロックの処理におけるタイムチャートである。
【図7】実行条件及びタイムアウト時間をパラメータ設定する場合の設定例を示す図である。
【図8】従来技術における条件待ち処理のタイムチャートである。
【図9】従来技術における条件待ち処理のタイムチャートである。
【符号の説明】
1 数値制御装置
2 モニタ装置
3 プログラマブルコントローラ
4 サーボアンプ
5 制御対象設備
10 プログラムメモリ
11 解析処理部
12 割り込み信号発生部
13 実行処理部
14 駆動処理部
15 データメモリ
16 通信処理部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a numerical controller that sequentially analyzes and executes an NC program composed of a plurality of blocks for each block.
[Prior art]
In a numerical control apparatus that sequentially analyzes and executes an NC program composed of a plurality of blocks for each block, in a system that controls a plurality of axes, the axes must be moved in synchronization between the plurality of axes. There is a case. Even if only one axis is controlled, it may be necessary to wait for the signal input from the outside to turn on or off and to start the axis movement. In such a case, as illustrated below, the execution of the NC program is continued in an infinite loop until the execution condition (SB277 = 1 in this example) is satisfied, and the execution condition is satisfied. If the condition is satisfied, the processing can be moved to the next and subsequent blocks.
[WHILE (SB277 = 1) DO] (* Waiting for fixed-size rising edge ON *)
[ENDWHILE;]
[0002]
However, when such an NC program is executed, the following problems occur. That is, since the WHILE command block and the ENDWHILE command are separate blocks, the data of each block must be read, analyzed, and executed each time. This increases the load on the NC program processing of the microprocessor of the numerical controller. When NC program processing occupies most of the processing capacity of the microprocessor, communication processing with a programmable controller or monitor device that is performed in parallel with NC program processing, display processing for displaying the state of numerical control status, etc. The time for executing the peripheral processing is limited. As a result, the display content of the monitor device that monitors and displays the operation status of the numerical control device or the display content by the LED of the numerical control device is lost in real time, or the time required for data exchange with other control devices is normal. Failures such as taking longer than that occur.
[0003]
In order to explain this phenomenon, a time chart when the NC program is executed is shown in FIG. In FIG. 8, (1) represents the processing of the WHILE command block, and (2) represents the processing of the ENDWHILE command block. The analysis and execution processing of the NC program is activated by a trigger generated at a constant period, and executes one block of processing. The cycle in which the trigger is generated is a time with a certain margin in the time required for the analysis processing and execution processing of one block such as the WHILE command block and the ENDWHILE command block. If the trigger generation cycle is longer than necessary, the execution of the NC program is delayed. If the trigger generation cycle is short, one block of processing cannot be completed within one cycle. The trigger generation period is set to an appropriate value according to the hardware processing capability of the apparatus. In general, a timer interrupt signal generated at regular intervals is used as a trigger.
[0004]
Peripheral processing is executed when these NC programs are not being processed. As shown in FIG. 8, since time is required for the analysis and execution processing of the NC program, the time for performing the peripheral processing is reduced during the processing of the WHILE command block and the ENDWHILE command block. For this reason, the display content of the monitor device that monitors and displays the operation status of the numerical control device is lost in real time, and troubles such as longer time than usual for data exchange with other control devices occur. It is.
[0005]
In order to prevent the occurrence of this failure, conventionally, a dwell command (a command that idles execution of the NC program for a specified time) is inserted after the WHILE command, and peripheral processing is executed during this dwell time. It was. This dwell time is typically a few hundred ms. The NC program after adding a dwell command is as follows.
[WHILE (SB277 = 1) DO] (* Waiting for fixed-size rising edge ON *)
G04P0.2 (* 200ms duel *)
[ENDWHILE;]
[0006]
A time chart for executing this NC program is shown in FIG. In FIG. 9, (1) represents the processing of the WHILE command block, (2) represents the processing of the ENDWHILE command block, and (circle) represents the processing of the dwell command block. In the dwell command block processing, analysis (decoding) processing is first performed once, and thereafter, it is only confirmed whether or not the dwell time has elapsed when an interrupt signal is generated. If the specified time elapses, the next block (ENDWHILE command block) is processed. As a result, analysis processing is not performed each time an interrupt signal is generated, so that time for performing peripheral processing can be secured.
[0007]
[Problems to be solved by the invention]
Therefore, according to such an NC program, peripheral processing can be executed during the dwell time, and the failure described above does not occur, but on the other hand, the execution condition is satisfied during the time specified by the dwell command. Since it is not determined whether the execution condition is satisfied, there is a problem that the timing for detecting the execution condition is delayed.
[0008]
For example, as shown in Japanese Patent Application No. 2001-210323, in the case of two grinders that operate independently in the X-axis direction and the Z-axis direction, respectively, in order to prevent the grinders from interfering with each other, In order to coordinately perform the movement in the X-axis direction and the movement in the Z-axis direction on the table, the axes must be operated by synchronizing the axes many times during one cycle. Further, it is necessary to perform processing such as interlocking the workpiece general input / output signal and the like to start the axis movement. In these cases, even if the execution condition is satisfied, since the execution condition cannot be detected for the time specified by the dwell command at the maximum, the cycle time of the entire machining cycle is extended by several seconds. appear.
[0009]
In addition to this problem, if the execution condition is not satisfied for a long time due to some trouble, the NC program processing does not proceed first, and the operator is not notified of the abnormality until the alarm is output due to the cycle time over. There was a problem that it took a long time to start the recovery work after the occurrence.
[0010]
As a countermeasure to this problem, if an I / O signal for each execution condition is output to the programmable controller and the wait time for each execution condition is monitored by the programmable controller, an alarm is immediately output when the time limit is exceeded. To be able to. However, in order to implement this measure, a sequence program must be set up for each execution condition to be monitored, so that the burden on the designer is great, and the scan time of the sequence program also increases. Furthermore, since most of the I / O signals are occupied, there is a new problem that the number of I / O signals between the numerical controller and the programmable controller is insufficient.
[0011]
In view of these problems, the present invention detects the establishment of an execution condition early and specifies the waiting time until the execution condition is established without outputting an I / O signal for each execution condition to the programmable controller. It is an object of the present invention to provide a numerical control device capable of performing necessary abnormality processing such as notifying an operator of an abnormality immediately when the time-out time exceeded.
[0012]
[Means for Solving the Problems]
According to the first aspect of the present invention, in relation to a condition waiting block that is one block in an NC program consisting of a series of blocks, an execution condition for enabling processing execution of blocks after the condition waiting block and the block The execution condition satisfaction waiting time-out time is stored. When processing a condition waiting block, the processing contents of the condition waiting block are analyzed from the execution condition and the timeout time, and the analysis result is stored. When executing the execution process of the condition waiting block due to occurrence of a predetermined trigger, the execution process is performed based on the stored analysis result without performing the analysis process every time. This ensures a processing time for performing the peripheral processing.
This execution process is performed according to the following procedures (a) to (d).
(A) It is determined whether or not the execution condition is satisfied.
(B) When the result of the determination is affirmative, processing of blocks after the condition waiting block can be executed.
(C) If the result of the determination is negative, peripheral processing is performed until the next trigger occurrence.
(D) If the waiting time for establishing the execution condition exceeds the timeout time, a timeout error is determined.
[0013]
As a result, while the processing time for performing the peripheral processing is secured, when the execution condition is not satisfied, the determination whether the execution condition is satisfied is performed every time the trigger is generated, and the waiting time for the satisfaction of the condition is timed out. If the time is exceeded, it is immediately judged as abnormal.
[0014]
According to the second aspect of the present invention, when the time for waiting for the execution condition to be satisfied exceeds the time-out time, information indicating that the time-out time has been exceeded is stored in an area that can be referred to in the block following the condition-waiting block, and NC Program processing proceeds to the block following the condition wait block. In a block following the condition waiting block, necessary abnormality processing is performed based on information indicating that the stored timeout time has been exceeded. Thereby, the recovery operation by the operator can be performed quickly.
[0015]
In the invention according to
[0016]
In the invention according to
[0017]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a configuration diagram of an equipment control system including a
[0018]
The
[0019]
FIG. 2 is a block diagram showing functions of the
[0020]
A
[0021]
When the
[0022]
In the NC program, a condition waiting block is described before a block for starting axis movement in synchronization with another axis or a block for performing some processing after waiting for a change in an input signal from the outside. In the condition waiting block, an execution condition that is a condition for causing the NC program to proceed to a block subsequent to the condition waiting block and a timeout time that is a limit value of the time for waiting for the execution condition to be satisfied are described. The format of the condition waiting block is as follows.
G31G04P_K_
[0023]
Here, “G04” indicates that this block is a condition waiting block. “K” is an identifier indicating that an execution condition is specified, and specifies a bit address of data following “K”. “P” is an identifier indicating that a timeout time is specified, and “P” is followed by a time in seconds. “G31” indicates that the execution condition is considered to be satisfied when the data of the bit address designated by “K” is “1”. When “G32” is designated instead of “G31”, it is considered that the execution condition is satisfied when the data of the bit address is 0.
[0024]
For example, when the signal “SB227” is 0, the NC program after the command block is executed, and when the “SB227” signal is not 0, the “SB227” signal is monitored for up to 1 second. The command is
G31G04P1K [SB227]
It becomes.
[0025]
If the execution condition is not satisfied even after the timeout time (1 second in the above example) specified by “P” has elapsed since the start of monitoring whether or not the execution condition is satisfied, it is determined that there is an abnormality.
[0026]
The processing by the
[0027]
The outline of the processing procedure of one block of the NC program will be described with reference to the flowchart shown in FIG. When the interrupt signal is generated by the interrupt
[0028]
Next, FIG. 4 shows a processing procedure in the case where the
[0029]
When the value of the program counter is rewritten in
[0030]
The equipment control process in the blocks after the condition waiting block is illustrated in the flowchart of FIG. In step 30, the error information stored in the
[0031]
As described above, when the condition waiting block is executed by the procedure described above, if the execution condition specified by the command block is satisfied, the execution process is immediately shifted to the next block. If the execution condition is not satisfied, it is repeatedly checked whether the execution condition is satisfied until the timeout time elapses, and if the timeout time elapses, it is determined that there is an abnormality.
[0032]
As a result, the execution condition is checked each time an interrupt signal is generated, so that the execution condition can be detected at an early stage, and the waiting time until the execution condition is satisfied exceeds the timeout time. Can immediately perform necessary abnormality processing such as notifying the operator of the abnormality.
[0033]
In addition, since the analysis process of the condition waiting block is performed only at the time of starting the first analysis / execution process by the interrupt signal, the analysis / execution process of the command block is started repeatedly when the execution condition is not satisfied. Only execution processing is performed. For this reason, the time for performing peripheral processing such as communication processing with the
[0034]
FIG. 6 shows a time chart in the processing of the condition waiting block of the present invention. In this figure, ● represents processing related to a condition waiting block, and * represents processing related to a block next to the condition waiting block. As is clear from this figure, since the analysis process is not performed every time, the time required for the program analysis / execution process when an interrupt signal is generated is short, and the time for performing the peripheral process is sufficiently secured.
[0035]
If a time-out error is detected in step 24, the NC program may be stopped without proceeding to subsequent blocks after notifying the abnormality. Or you may make it distinguish whether execution of an NC program is stopped or continued by the description content of a condition waiting block.
[0036]
Also, the execution condition and the timeout time may be specified not by NC program commands but by parameter settings. In the case of parameter setting, as illustrated in FIG. 7, the execution condition and timeout time are set together with an identification code for identifying which of a plurality of condition waiting blocks exist in the NC program. In this case, the format of the command block described in the NC program is as shown below.
G31G04I_
Here, “I” is an identifier for designating an identification code to be referred to in the matrix in FIG. For example, when the identification code is 20, it is “G31G04I20”. In this case, unlike the NC program command described above, it is not necessary to specify an execution condition and a timeout time for each block. That is, the setting can be made collectively as in the matrix of FIG.
[0037]
In this embodiment, an interrupt signal generated at a constant period is used as a trigger for starting analysis / execution processing. However, a trigger for starting analysis / execution processing may be generated by software processing.
[0038]
【The invention's effect】
As described above, in the present invention, the determination of whether or not the execution condition is satisfied, the process of repeatedly performing the re-determination when the execution condition is not satisfied, and the detection of the execution condition establishment wait timeout error are performed once. It was decided to do this during the waiting block execution process. As a result, first, the result of analyzing the processing contents of the condition waiting block is stored, and based on this, execution processing can be performed every time a predetermined trigger occurs, so it is determined whether or not the execution condition is satisfied at high frequency. While performing, peripheral processing time can be secured rather than NC program processing. Further, when the waiting time until the execution condition is satisfied exceeds the timeout time, necessary abnormality processing such as immediately informing the operator of the abnormality can be performed. Here, it is not necessary to send an I / O signal to the programmable controller in order to monitor the time when the execution condition is satisfied, and to detect a timeout error by sequence program processing in the programmable controller. Therefore, problems such as an increase in the scan time of the sequence program and occupation of a large number of I / O points do not occur.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of an equipment control system according to an embodiment of the present invention.
FIG. 2 is a block diagram showing functions of the numerical control device according to the embodiment of the present invention.
FIG. 3 is a flowchart showing an outline of a processing procedure of one block of the NC program.
FIG. 4 is a flowchart illustrating a processing procedure of a condition waiting block.
FIG. 5 is a flowchart showing a processing procedure after a condition waiting block.
FIG. 6 is a time chart in processing of a condition waiting block according to the present invention.
FIG. 7 is a diagram illustrating a setting example when parameters are set for an execution condition and a timeout time.
FIG. 8 is a time chart of a condition waiting process in the prior art.
FIG. 9 is a time chart of a condition waiting process in the prior art.
[Explanation of symbols]
DESCRIPTION OF
Claims (4)
前記一連のブロックの間に存在する単一のブロックであり、それ以降のブロックの処理実行タイミングを制御する条件待ちブロックを記憶するプログラム記憶手段と、
前記条件待ちブロック以降のブロックの処理実行を可能にするための実行条件と該実行条件の成立待ち時間のタイムアウト時間とを前記条件待ちブロックに関連付けて記憶する条件記憶手段と、
前記実行条件と前記タイムアウト時間とから前記条件待ちブロックの処理内容を解析し、解析結果を記憶する解析手段と、
前記トリガ発生毎に前記記憶した解析結果に基づいた実行処理を行い、前記周辺処理を行う処理時間を確保する実行処理手段とを備え、
前記実行処理手段は、
前記実行条件が成立しているか否かを判定する判定手段と、
前記判定手段での判定の結果が肯定判定である場合に前記条件待ちブロック以降のブロックの処理実行を可能にする手段と、
前記判定手段での判定の結果が否定判定である場合に次回のトリガ発生時までの間に前記周辺処理を行う手段と、
前記実行条件の成立待ち時間が前記タイムアウト時間を超えた場合にタイムアウトエラーと判定する手段と、
を有することを特徴とする数値制御装置。An NC program composed of a series of blocks is sequentially read and analyzed in units of blocks, and the execution processing of the block is performed due to the occurrence of a predetermined trigger based on the result of the analysis processing, and the analysis processing and the execution processing In the numerical control device that performs peripheral processing in parallel with
Program storage means for storing a condition waiting block that is a single block existing between the series of blocks and controls the processing execution timing of the subsequent blocks;
Condition storage means for storing an execution condition for enabling processing execution of blocks subsequent to the condition waiting block and a timeout period of establishment waiting time of the execution condition in association with the condition waiting block;
Analyzing the processing content of the condition waiting block from the execution condition and the timeout time, and storing an analysis result;
Execution processing based on the stored analysis results every time the trigger occurs, and execution processing means for ensuring processing time for performing the peripheral processing,
The execution processing means includes
Determining means for determining whether or not the execution condition is satisfied;
Means for enabling processing execution of blocks after the condition waiting block when the result of determination by the determination means is affirmative;
Means for performing the peripheral processing until the next trigger occurrence when the result of the determination by the determination means is a negative determination;
Means for determining a timeout error when a waiting time for establishing the execution condition exceeds the timeout time;
A numerical control device comprising:
前記条件待ちブロック以降のブロックにて、前記タイムアウトエラーが発生したことを示す情報を参照し、これに基づいて異常処理を行う異常処理手段と、
を有することを特徴とする請求項1記載の数値制御装置。Means for storing information indicating that a timeout error has occurred when the execution processing means determines that a timeout error has occurred, and enabling processing execution of blocks after the condition waiting block;
In the block after the condition waiting block, referring to information indicating that the timeout error has occurred, abnormal processing means for performing an abnormal processing based on this,
The numerical control apparatus according to claim 1, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001298185A JP3692990B2 (en) | 2001-09-27 | 2001-09-27 | Numerical controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001298185A JP3692990B2 (en) | 2001-09-27 | 2001-09-27 | Numerical controller |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2003108209A JP2003108209A (en) | 2003-04-11 |
JP3692990B2 true JP3692990B2 (en) | 2005-09-07 |
Family
ID=19119125
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2001298185A Expired - Fee Related JP3692990B2 (en) | 2001-09-27 | 2001-09-27 | Numerical controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3692990B2 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104155919B (en) * | 2014-08-11 | 2017-03-15 | 浙江陀曼精密机械有限公司 | Bearing ring processing control method |
KR101835832B1 (en) * | 2017-02-02 | 2018-03-07 | (주) 헬로팩토리 | Calling system for using local area wireless communication |
WO2022154049A1 (en) * | 2021-01-18 | 2022-07-21 | ファナック株式会社 | Numerical control device |
JP7462849B1 (en) | 2023-03-14 | 2024-04-05 | 三菱電機株式会社 | Numerical Control Device |
-
2001
- 2001-09-27 JP JP2001298185A patent/JP3692990B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2003108209A (en) | 2003-04-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3692990B2 (en) | Numerical controller | |
JP5365875B2 (en) | Industrial controller | |
JPH03105503A (en) | Programmable controller | |
JP2003022109A (en) | Numerical controller | |
JPS61813A (en) | Deciding system for faulty area of sequence controller | |
US10664274B2 (en) | Controller and editor | |
WO1990007739A1 (en) | Control method for robot | |
JP2880658B2 (en) | Runaway detection device for multitask program | |
JPH08286717A (en) | Numerical control device | |
JP2002358119A (en) | Monitoring device for sequence controller | |
JP2012228734A (en) | Industrial robot | |
JP2707031B2 (en) | Method and apparatus for checking machining program | |
JP3514168B2 (en) | Monitoring control device, monitoring control method, and recording medium storing monitoring program | |
JPS6373753A (en) | Key telephone system | |
JP2527849Y2 (en) | Programmable controller and its programming device | |
JPH06348320A (en) | Abnormality monitor system of cnc | |
JPS58186805A (en) | Restarting system for work of machine tool with numerical controller | |
JPH0736536A (en) | Programmable controller | |
JP2001282330A (en) | Monitoring device in sequential function chart type programmable controller | |
JPH07168609A (en) | Method for debugging sequence program | |
JPH10247105A (en) | Programmable controller | |
JPH08286714A (en) | Monitor device for programmable display device | |
JPH02253305A (en) | Signal tracing system for programmable controller | |
JPH02286193A (en) | Self-diagnostic device for computerized sewing machine | |
JPH01307846A (en) | Monitoring device for programmable controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050526 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20050531 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050613 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 3692990 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R371 | Transfer withdrawn |
Free format text: JAPANESE INTERMEDIATE CODE: R371 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090701 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100701 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110701 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110701 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120701 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120701 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130701 Year of fee payment: 8 |
|
LAPS | Cancellation because of no payment of annual fees |