JP2009080591A - Numerical control device, control program, and recording medium - Google Patents

Numerical control device, control program, and recording medium Download PDF

Info

Publication number
JP2009080591A
JP2009080591A JP2007248311A JP2007248311A JP2009080591A JP 2009080591 A JP2009080591 A JP 2009080591A JP 2007248311 A JP2007248311 A JP 2007248311A JP 2007248311 A JP2007248311 A JP 2007248311A JP 2009080591 A JP2009080591 A JP 2009080591A
Authority
JP
Japan
Prior art keywords
modal
command
instruction
setting
numerical control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007248311A
Other languages
Japanese (ja)
Inventor
Takeshi Irie
武志 入江
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2007248311A priority Critical patent/JP2009080591A/en
Publication of JP2009080591A publication Critical patent/JP2009080591A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a numerical control device for easily confirming whether or not a modal instruction has been correctly set, and to provide a control program and a recording medium therefor. <P>SOLUTION: A first modal information table 1321 in which a modal G code required when an axial movement instruction of a machine tool is issued is set is stored in a non-volatile memory of a numerical control device. When the modal G code related with the axial movement is set in a block read by a CPU, an instruction flag "1" is set for the modal group belonging to the modal G code. When the instruction of the axial movement is issued in the next block, and the instruction flag set in the first modal information table 1321 is "0", there is a suspicion that the modal G code whose instruction flag is "0" is not set. In this case, a warning is displayed on a display. Therefore, a user can easily confirm that the modal G code is not set. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、数値制御装置、制御プログラム及び記録媒体に関し、詳細には、NCプログラムに基づいて工作機械を制御する数値制御装置、制御プログラム及び記録媒体に関する。   The present invention relates to a numerical control device, a control program, and a recording medium, and more particularly to a numerical control device, a control program, and a recording medium that control a machine tool based on an NC program.

従来から、NCプログラムに基づいて工作機械を制御する数値制御装置が知られている。数値制御装置を自動運転させる場合、その指令モードとして、モーダルGコード(モーダル命令)が使用されることが多い。モーダルGコードは、一度指令されると、他のGコードが指令されるまで有効なGコードである。例えば、電源投入時またはリセット時にモーダルGコードをパラメータで設定する方法が知られている(例えば、特許文献1参照)。この方法によって、電源投入時もしくはリセット時から工作機械に合致したモーダル状態で動作させることができる。   Conventionally, a numerical control device for controlling a machine tool based on an NC program is known. When the numerical control apparatus is automatically operated, a modal G code (modal instruction) is often used as the command mode. A modal G code is a valid G code once commanded until another G code is commanded. For example, a method of setting a modal G code with a parameter at power-on or reset is known (see, for example, Patent Document 1). By this method, it is possible to operate in a modal state that matches the machine tool from the time of power-on or reset.

ところで、このような数値制御装置では、1つの設定による加工が終了して次の設定による加工処理を開始する際には、簡易なプログラムで工作機械を初期状態に設定することが望ましい。そこで例えば、1つの制御指令コードによってモーダルデータの指令状態を初期状態に設定することができる数値制御装置が知られている(例えば、特許文献2参照)。
特開平4−148304号公報 特開2007−26323号公報
By the way, in such a numerical control device, it is desirable to set the machine tool to an initial state with a simple program when the machining by one setting is completed and the machining process by the next setting is started. Therefore, for example, there is known a numerical control device that can set a command state of modal data to an initial state by one control command code (see, for example, Patent Document 2).
JP-A-4-148304 JP 2007-26323 A

しかしながら、特許文献2に記載の数値制御装置では、モーダルGコードを初期化する際の手間は改善されるが、モーダルGコードが正しく初期化されているか否かのチェックがなされていない。モーダルGコードの設定のチェック方法としては、工作機械に付属する表示装置に表示されたNCプログラムの目視によるチェックや、工作機械の制御軸を移動させずにプログラムを実行させるマシンロック運転によるチェック等がある。しかし自分で入力したプログラムを自分でチェックするため、プログラムミスの発見を完全に行うのは難しいという問題点があった。   However, in the numerical control device described in Patent Document 2, the effort for initializing the modal G code is improved, but it is not checked whether the modal G code is correctly initialized. Modal G code setting check methods include a visual check of the NC program displayed on the display device attached to the machine tool, a check by machine lock operation that executes the program without moving the control axis of the machine tool, etc. There is. However, there is a problem that it is difficult to completely detect a program mistake because the program entered by oneself is checked by oneself.

本発明は、上記課題を解決するためになされたものであり、モーダル命令が正しく設定されているか否かを容易に確認できる数値制御装置、制御プログラム及び記録媒体を提供することを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to provide a numerical control device, a control program, and a recording medium that can easily confirm whether or not a modal instruction is correctly set.

上記目的を達成するために、請求項1に係る発明の数値制御装置は、NCデータでブロック毎に記述されたNCプログラムに基づいて、工作機械を制御する数値制御装置において、前記NCデータをブロック毎に読み込む読込手段と、当該読込手段に読み込まれた前記NCデータの内容を解析する解析手段と、前記工作機械の動作命令に関連するモーダル命令の候補を予め記憶するモーダル候補記憶手段と、前記解析手段によって解析されたブロックに、前記モーダル命令が設定されているか否かを判断するモーダル判断手段と、当該モーダル判断手段によって、前記モーダル命令が設定されていると判断された場合に、前記モーダル命令が設定されたことを記憶するモーダル設定記憶手段と、前記解析手段によって解析された内容が、前記動作命令であった場合に、前記モーダル候補記憶手段において、前記モーダル設定記憶手段に記憶された設定に基づき、前記動作命令に関連する前記モーダル命令の候補の全てが設定されているか否かを判断するモーダル設定判断手段と、当該モーダル設定判断手段によって、前記動作命令に関連する前記モーダル命令の候補のうち少なくとも何れかが設定されていないと判断された場合に報知する報知手段とを備えている。   In order to achieve the above object, a numerical control device according to a first aspect of the present invention is a numerical control device for controlling a machine tool based on an NC program described for each block in NC data, and blocks the NC data. A reading means for reading each time; an analyzing means for analyzing the contents of the NC data read by the reading means; a modal candidate storage means for preliminarily storing modal instruction candidates related to the operation instructions of the machine tool; A modal determination means for determining whether or not the modal instruction is set in the block analyzed by the analysis means; and when the modal determination means determines that the modal instruction is set, the modal instruction The modal setting storage means for storing that the instruction is set, and the content analyzed by the analysis means are the When the command is an operation command, the modal candidate storage unit determines whether all of the modal command candidates related to the operation command are set based on the setting stored in the modal setting storage unit. Modal setting determining means for performing notification, and notifying means for notifying when it is determined by the modal setting determining means that at least one of the candidates for the modal instruction related to the operation command is not set. .

また、請求項2に係る発明の数値制御装置は、請求項1に記載の発明の構成に加え、前記モーダル設定判断手段によって、前記動作命令に関連する前記モーダル命令の候補の全てが、前記モーダル設定手段によって設定されていると判断された場合、又は前記報知手段によって報知された場合に、前記モーダル設定手段による設定を解除する設定解除手段を備えている。   According to a second aspect of the present invention, in addition to the configuration of the first aspect of the invention, the modal setting determination means causes the modal instruction candidate related to the operation instruction to be all modal instruction candidates. When it is determined that the setting means has set, or when notified by the notifying means, a setting canceling means for canceling the setting by the modal setting means is provided.

また、請求項3に係る発明の数値制御装置は、請求項1又は2に記載の発明の構成に加え、前記報知手段は、前記動作命令に関連する前記モーダル命令の候補のうち、前記モーダル設定手段によって設定されていない前記モーダル命令を表示する表示装置であることを特徴とする。   According to a third aspect of the present invention, in addition to the configuration of the first or second aspect of the invention, the notification means is configured to set the modal setting among the modal instruction candidates related to the operation instruction. The display device displays the modal command not set by the means.

また、請求項4に係る発明の数値制御装置は、請求項1乃至3の何れかに記載の発明の構成に加え、前記モーダル候補記憶手段は、複数の前記動作命令毎に、前記モーダル命令の候補を記憶していることを特徴とする。   According to a fourth aspect of the present invention, in addition to the configuration of the first aspect of the present invention, the modal candidate storage means may include the modal instruction for each of the plurality of operation instructions. The candidate is memorized.

また、請求項5に係る発明の数値制御装置は、請求項1乃至4の何れかに記載の発明の構成に加え、前記動作命令は、軸移動、補間移動、円弧補間、固定サイクルのうち少なくとも何れかに関連する命令であることを特徴とする。   According to a fifth aspect of the present invention, in addition to the configuration of the first aspect of the present invention, the operation command includes at least one of axial movement, interpolation movement, circular interpolation, and fixed cycle. It is an instruction related to any of the above.

また、請求項6に係る発明の制御プログラムは、工作機械の数値制御を行う数値制御装置を機能させる制御プログラムであって、NCデータをブロック毎に読み込む第1ステップと、当該第1ステップで読み込んだ前記NCデータの内容を解析する第2ステップと、当該第2ステップで解析されたブロックに、モーダル命令が設定されているか否かを判断する第3ステップと、当該第3ステップで、前記モーダル命令が設定されていると判断した場合に、前記モーダル命令が設定されたことをモーダル設定記憶手段に記憶する第4ステップと、前記第2ステップで解析された内容が、前記工作機械の動作命令であった場合に、前記動作命令に関連するモーダル命令の候補を予め記憶するモーダル候補記憶手段において、前記モーダル設定記憶手段に記憶された設定に基づき、前記動作命令に関連する前記モーダル命令の候補の全てが設定されているか否かを判断する第5ステップと、当該第5ステップで、前記動作命令に関連する前記モーダル命令の候補のうち何れかが設定されていないと判断された場合に報知する第6ステップとからなる。   According to a sixth aspect of the present invention, there is provided a control program for causing a numerical control device for performing numerical control of a machine tool to function. The first step reads NC data for each block, and the first step reads the NC data. The second step of analyzing the contents of the NC data, the third step of determining whether or not a modal instruction is set in the block analyzed in the second step, and the modal in the third step When it is determined that an instruction has been set, the fourth step of storing in the modal setting storage means that the modal instruction has been set, and the content analyzed in the second step is an operation instruction for the machine tool. In the modal candidate storage means for storing in advance modal instruction candidates related to the operation instruction, the modal setting storage A fifth step of determining whether all of the candidates for the modal instruction related to the operation command are set based on the setting stored in the stage, and the fifth step relates to the operation command related to the operation command. The sixth step is to notify when it is determined that one of the candidates for the modal instruction is not set.

また、請求項7に係る発明の記録媒体は、請求項6に記載の制御プログラムを記録している。   A recording medium according to a seventh aspect records the control program according to the sixth aspect.

請求項1に係る発明の数値制御装置では、読込手段がNCデータをブロック毎に読み込む。解析手段は、読み込まれたNCデータの動作命令を解析する。モーダル判断手段は、解析手段によって解析されたブロックにモーダル命令が設定されているか否かを判断する。モーダル判断手段がモーダル命令が設定されていると判断した場合、モーダル設定記憶手段には、モーダル命令が設定されたことが記憶される。またモーダル候補記憶手段には、工作機械の動作命令に関連するモーダル命令の候補が予め記憶されている。そしてモーダル設定判断手段は、解析手段によって解析された内容が動作命令であった場合に、モーダル候補記憶手段において、モーダル設定記憶手段に記憶された設定に基づき、動作命令に関連する前記モーダル命令の候補の全てが設定されているか否かを判断する。ここで動作命令に関連するモーダル命令の候補のうち何れかが設定されていないと判断された場合、モーダル命令が正常に設定されていない可能性がある。そこで報知手段はユーザに報知する。これによりユーザはモーダル命令が正しく設定されているか否かを容易かつ速やかに確認できる。   In the numerical control apparatus according to the first aspect of the present invention, the reading means reads NC data for each block. The analyzing means analyzes the operation command of the read NC data. The modal judging means judges whether or not a modal instruction is set in the block analyzed by the analyzing means. When the modal determination unit determines that a modal command is set, the modal setting storage unit stores that the modal command has been set. The modal candidate storage means stores in advance modal command candidates related to machine tool operation commands. The modal setting determining means, when the content analyzed by the analyzing means is an action command, in the modal candidate storage means, based on the setting stored in the modal setting storage means, the modal instruction related to the action command. It is determined whether all candidates are set. If it is determined that any of the modal instruction candidates related to the operation instruction is not set, the modal instruction may not be set normally. Therefore, the notification means notifies the user. Thus, the user can easily and quickly confirm whether or not the modal command is set correctly.

また、請求項2に係る発明の数値制御装置では、請求項1に記載の発明の効果に加え、モーダル設定判断手段によって、動作命令に関連するモーダル命令の候補の全てが、モーダル設定手段によって設定されていると判断された場合、又は報知手段によって報知された場合に、設定解除手段がモーダル設定手段による設定を解除する。つまり次のブロックで前回のモーダル状態と異なるモーダル状態が設定される場合に、設定解除手段による設定が解除されるので、新たなモーダル命令を設定することができる。これによりNCデータの動作指令に関連するモーダル命令が同一又は前ブロックで設定されているか否かを正確にチェックできる。   In addition, in the numerical control device of the invention according to claim 2, in addition to the effect of the invention of claim 1, all of the candidates for the modal instruction related to the operation instruction are set by the modal setting means by the modal setting judging means. When it is determined that the setting has been made, or when notified by the notification means, the setting cancellation means cancels the setting by the modal setting means. That is, when a modal state different from the previous modal state is set in the next block, the setting by the setting canceling unit is canceled, so that a new modal command can be set. As a result, it is possible to accurately check whether or not the modal command related to the operation command of the NC data is set in the same or previous block.

また、請求項3に係る発明の数値制御装置では、請求項1又は2に記載の発明の効果に加え、報知手段である表示装置には、動作命令に関連するモーダル命令の候補のうち、モーダル設定手段によって設定されていないモーダル命令が表示される。表示されたモーダル命令は設定漏れの可能性があるので、それらのモーダル命令について確認すればよい。つまりチェックすべきモーダル命令が明確となるので、短時間で効率的にチェックできる。   In addition, in the numerical control device of the invention according to claim 3, in addition to the effect of the invention of claim 1 or 2, the display device as the notification means includes a modal command candidate among modal command candidates related to the operation command. A modal command not set by the setting means is displayed. Since the displayed modal instructions may be missed, it is only necessary to confirm those modal instructions. In other words, since the modal instruction to be checked becomes clear, it can be efficiently checked in a short time.

また、請求項4に係る発明の数値制御装置では、請求項1乃至3の何れかに記載の発明の効果に加え、モーダル候補記憶手段には、複数の動作命令毎に、モーダル命令の候補が記憶されている。従って、ある特定の動作命令に関連するモーダル命令の候補を一括して設定できる。   Further, in the numerical control device according to the fourth aspect of the invention, in addition to the effect of the invention according to any one of the first to third aspects, the modal candidate storage means stores a modal instruction candidate for each of a plurality of operation instructions. It is remembered. Therefore, modal instruction candidates related to a specific operation instruction can be set collectively.

また、請求項5に係る発明の数値制御装置では、請求項1乃至4の何れかに記載の発明の効果に加え、軸移動、補間移動、円弧補間、固定サイクルのうち少なくとも何れかの動作命令関連するモーダル命令をチェックできる。   In addition, in the numerical control device according to the fifth aspect of the present invention, in addition to the effect of the first aspect of the present invention, at least one of the operation commands of the axis movement, the interpolation movement, the circular interpolation, and the fixed cycle You can check related modal instructions.

また、請求項6に係る発明の制御プログラムでは、第1ステップにて、NCデータがブロック毎に読み込まれる。第2ステップにて、第1ステップで読み込まれたNCデータの内容が解析される。第3ステップにて、第2ステップで解析されたブロックに、モーダル命令が設定されているか否かが判断される。第4ステップにて、第3ステップで、モーダル命令が設定されていると判断された場合に、モーダル命令が設定されたことがモーダル設定記憶手段に記憶される。第5ステップにて、第2ステップで解析された内容が工作機械の動作命令であった場合に、動作命令に関連するモーダル命令の候補を予め記憶するモーダル候補記憶手段において、モーダル設定記憶手段に記憶された設定に基づき、動作命令に関連するモーダル命令の候補の全てが設定されているか否かが判断される。第6ステップにて、第5ステップで、動作命令に関連する前記モーダル命令の候補のうち何れかが設定されていないと判断された場合、モーダル命令が正常に設定されていない可能性があるので、ユーザに報知される。これによりモーダル命令が正しく設定されているか否かを容易に確認できる。   In the control program of the invention according to claim 6, NC data is read for each block in the first step. In the second step, the contents of the NC data read in the first step are analyzed. In the third step, it is determined whether or not a modal instruction is set in the block analyzed in the second step. In the fourth step, when it is determined in the third step that the modal instruction is set, the setting of the modal instruction is stored in the modal setting storage means. In the fifth step, when the content analyzed in the second step is an operation command of the machine tool, the modal candidate storage unit stores in advance a modal command candidate related to the operation command. Based on the stored setting, it is determined whether all modal instruction candidates related to the operation instruction are set. In the sixth step, if it is determined in the fifth step that any of the modal instruction candidates related to the operation instruction is not set, the modal instruction may not be set normally. The user is notified. Thereby, it can be easily confirmed whether or not the modal instruction is set correctly.

また、請求項7に係る発明の記録媒体は、請求項6に記載の制御プログラムを記録しているので、その記録媒体を介すことによって請求項6に記載の制御プログラムを数値制御装置に実行させることができる。これによりモーダル命令が正しく設定されているか否かを容易に確認できる数値制御装置を提供できる。   In addition, since the recording medium of the invention according to claim 7 records the control program according to claim 6, the control program according to claim 6 is executed by the numerical controller through the recording medium. Can be made. Thus, it is possible to provide a numerical control device that can easily confirm whether or not the modal instruction is correctly set.

以下、本発明の一実施形態である数値制御装置1について、図面を参照して説明する。数値制御装置1は、ワークの切削加工を行う工作機械30(図1参照)を数値制御するものである。そして作成されたNCプログラム中にモーダルGコードが正しく設定されているか否かのモーダルチェックを容易にできる点に本発明の特徴を有する。なお、「モーダルGコード」とは、本発明の「モーダル命令」に相当するものであり、一度指令されると他のGコードが指令されるまで有効なGコードである。   Hereinafter, a numerical controller 1 according to an embodiment of the present invention will be described with reference to the drawings. The numerical control device 1 numerically controls a machine tool 30 (see FIG. 1) that performs workpiece cutting. A feature of the present invention is that a modal check as to whether or not the modal G code is correctly set in the created NC program can be facilitated. The “modal G code” corresponds to the “modal instruction” of the present invention, and is a G code that is valid until another G code is commanded once commanded.

はじめに、数値制御装置1の構成について、図1を参照して説明する。図1は、数値制御装置1の電気的構成を示すブロックである。数値制御装置1は、中央演算処理装置であるCPU10を備える。CPU10には、各種プログラムを記憶するROM11と、各種データ等を一時的に記憶するRAM12と、ワーク加工に係るNCプログラム等を記憶する不揮発メモリ13と、外部との通信を行う入出力インタフェイス14と、外部に信号を出力する出力インタフェイス15とが接続されている。   First, the configuration of the numerical controller 1 will be described with reference to FIG. FIG. 1 is a block diagram showing an electrical configuration of the numerical controller 1. The numerical control device 1 includes a CPU 10 that is a central processing unit. The CPU 10 includes a ROM 11 that stores various programs, a RAM 12 that temporarily stores various data, a nonvolatile memory 13 that stores NC programs and the like related to workpiece machining, and an input / output interface 14 that communicates with the outside. And an output interface 15 for outputting a signal to the outside.

入出力インタフェイス14には、工作機械30の操作パネル(図示外)に設けられたキーボード21と、モーダルチェックの画面に切り替えるチェックボタン22と、モーダルチェックを開始させるチェック開始ボタン23と、モーダルチェックの警告を解除する解除ボタン24と、各種画面を表示するディスプレイ25とが各々接続されている。   The input / output interface 14 includes a keyboard 21 provided on an operation panel (not shown) of the machine tool 30, a check button 22 for switching to a modal check screen, a check start button 23 for starting a modal check, and a modal check. A release button 24 for releasing the warning and a display 25 for displaying various screens are connected to each other.

出力インタフェイス15には、工作機械30の各種駆動源が接続されている。工作機械30の駆動源は、ワークを固定するテーブル(図示外)をX軸方向に移動させるX軸モータ41を駆動するX軸駆動回路31と、Y軸方向に移動させるY軸モータ42を駆動するY軸駆動回路32と、主軸ヘッド(図示外)をZ軸方向に移動させるZ軸モータ43を駆動するZ軸駆動回路33と、主軸ヘッドに回転可能に支持された主軸(図示外)を回転させる主軸モータ44を駆動する主軸駆動回路34とである。これらの駆動回路が出力インタフェイス15に接続されている。以上の構成からなる数値制御装置1では、キーボード21で作成されたNCプログラムに基づき、工作機械30の各種駆動源を制御することにより、テーブル上のワークが所望の形状に加工される。   Various output sources of the machine tool 30 are connected to the output interface 15. The drive source of the machine tool 30 drives an X-axis drive circuit 31 that drives an X-axis motor 41 that moves a table (not shown) that fixes a workpiece in the X-axis direction, and a Y-axis motor that moves in the Y-axis direction. A Y-axis drive circuit 32, a Z-axis drive circuit 33 that drives a Z-axis motor 43 that moves the spindle head (not shown) in the Z-axis direction, and a spindle (not shown) that is rotatably supported by the spindle head. And a spindle drive circuit 34 for driving the spindle motor 44 to be rotated. These drive circuits are connected to the output interface 15. In the numerical control device 1 having the above configuration, the workpiece on the table is machined into a desired shape by controlling various drive sources of the machine tool 30 based on the NC program created by the keyboard 21.

次に、ROM11の記憶領域について、図2を参照して説明する。図2は、ROM11の概念図である。ROM11には、NCプログラムを1ブロック毎に読み込んで解析し、工作機械30の各種駆動源を制御するメインの制御プログラムを記憶する制御プログラム記憶領域111と、NCプログラム中にモーダルGコードが正しく設定されているかのチェックを行うための「モーダルチェックプログラム」を記憶するモーダルチェックプログラム記憶領域112等が各々設けられている。このモーダルチェックプログラムが本発明の「制御プログラム」に相当する。   Next, the storage area of the ROM 11 will be described with reference to FIG. FIG. 2 is a conceptual diagram of the ROM 11. The ROM 11 reads and analyzes the NC program for each block, and stores a control program storage area 111 for storing a main control program for controlling various drive sources of the machine tool 30, and a modal G code is correctly set in the NC program. A modal check program storage area 112 or the like for storing a “modal check program” for checking whether or not the check has been performed is provided. This modal check program corresponds to the “control program” of the present invention.

次に、不揮発メモリ13の記憶領域について、図3を参照して説明する。図3は、不揮発メモリ13の概念図である。不揮発メモリ13には、NCプログラムを記憶するNCプログラム記憶領域131と、複数のモーダルGコードが動作命令毎に分類して設定された4つのモーダル情報テーブル(図4〜図7参照)と、NCコードの特定の動作命令が各々設定された2つの動作情報テーブル(図8,図9参照)とを記憶する情報テーブル記憶領域132等が各々設けられている。   Next, the storage area of the nonvolatile memory 13 will be described with reference to FIG. FIG. 3 is a conceptual diagram of the nonvolatile memory 13. The nonvolatile memory 13 includes an NC program storage area 131 for storing an NC program, four modal information tables (see FIGS. 4 to 7) in which a plurality of modal G codes are classified and set for each operation command, and an NC An information table storage area 132 for storing two operation information tables (see FIGS. 8 and 9) in which specific operation instructions for codes are set, respectively, is provided.

次に、情報テーブル記憶領域132に記憶された各種テーブルについて、図4〜図9を参照して説明する。図4は、第1モーダル情報テーブル1321の概念図であり、図5は、第2モーダル情報テーブル1322の概念図であり、図6は、第3モーダル情報テーブル1323の概念図であり、図7は、第4モーダル情報テーブル1324の概念図であり、図8は、工具交換情報テーブル1325の概念図であり、図9は、主軸回転情報テーブル1326の概念図である。   Next, various tables stored in the information table storage area 132 will be described with reference to FIGS. 4 is a conceptual diagram of the first modal information table 1321, FIG. 5 is a conceptual diagram of the second modal information table 1322, and FIG. 6 is a conceptual diagram of the third modal information table 1323. FIG. 8 is a conceptual diagram of a fourth modal information table 1324, FIG. 8 is a conceptual diagram of a tool change information table 1325, and FIG. 9 is a conceptual diagram of a spindle rotation information table 1326.

図3に示す情報テーブル記憶領域132には、第1モーダル情報テーブル1321(図4参照)と、第2モーダル情報テーブル1322(図5参照)と、第3モーダル情報テーブル1323(図6参照)と、第4モーダル情報テーブル1324(図7参照)と、工具交換情報テーブル1325(図8参照)と、主軸回転情報テーブル1326(図9参照)等が各々記憶されている。   The information table storage area 132 shown in FIG. 3 includes a first modal information table 1321 (see FIG. 4), a second modal information table 1322 (see FIG. 5), and a third modal information table 1323 (see FIG. 6). A fourth modal information table 1324 (see FIG. 7), a tool change information table 1325 (see FIG. 8), a spindle rotation information table 1326 (see FIG. 9), and the like are stored.

まず、第1モーダル情報テーブル1321について説明する。図4に示すように、第1モーダル情報テーブル1321には、「軸移動」の命令があった時に必要とされるモーダルGコードが6つのグループに分類されて各々設定されている。これら6つのグループは、軸移動の際に通常設定される6つの動作条件に各々対応している。具体的には、「送り」に関するモーダルGコードを集めたG0モーダルグループと、「工具径補正」に関するモーダルGコードを集めたG40モーダルグループと、「工具長補正」に関するモーダルGコードを集めたG49モーダルグループと、「ワーク座標系設定」に関するモーダルGコードを集めたG54モーダルグループと、「プログラム座標回転」に関するモーダルGコードを集めたG69モーダルグループと、「絶対値指令方式、又は相対値指令方式」に関するモーダルGコードを集めたG90モーダルグループが各々設定されている。   First, the first modal information table 1321 will be described. As shown in FIG. 4, in the first modal information table 1321, modal G codes required when an “axis movement” command is given are classified into six groups and set. These six groups correspond to the six operating conditions that are normally set during the axis movement. Specifically, a G0 modal group that collects modal G codes related to “feed”, a G40 modal group that collects modal G codes related to “tool radius correction”, and G49 that collects modal G codes related to “tool length correction”. A modal group, a G54 modal group collecting modal G codes related to “work coordinate system setting”, a G69 modal group collecting modal G codes related to “program coordinate rotation”, and an “absolute value command method or relative value command method” Each G90 modal group is a set of modal G codes related to "."

G0モーダルグループには、G0(位置決め:早送り)、G1(直線補間:切削送り)、G2(円弧補間:時計回り),G3(円弧補間:反時計回り)のモーダルGコードが各々設定されている。G40モーダルグループには、G40(工具径キャンセル)、G41(工具径補正:進行方向左)、G42(工具径補正:進行方向右)のモーダルGコードが各々設定されている。G49モーダルグループには、G49(工具長補正キャンセル)、G43,G44(工具長補正モード)のモーダルGコードが各々設定されている。   In the G0 modal group, modal G codes of G0 (positioning: fast feed), G1 (linear interpolation: cutting feed), G2 (circular interpolation: clockwise), and G3 (circular interpolation: counterclockwise) are set, respectively. . In the G40 modal group, modal G codes of G40 (tool diameter cancellation), G41 (tool diameter correction: left in the traveling direction), and G42 (tool diameter correction: right in the traveling direction) are set. In the G49 modal group, modal G codes of G49 (tool length correction cancellation), G43 and G44 (tool length correction mode) are set.

G54モーダルグループには、G54(ワーク座標系1)、G55(ワーク座標系2)、G56(ワーク座標系3)、G57(ワーク座標系4)、G58(ワーク座標系5)、G59(ワーク座標系6)のモーダルGコードが各々設定されている。ワーク座標系設定では、NC工作機械の現在位置を、同一ブロック内で指令した各制御軸の値にプリセットできる。G69モーダルグループには、G69(座標回転モード)、G68(座標回転モード)のモーダルGコードが各々設定されている。G90モーダルグループには、G90(アブソリュート:絶対値指令方式)、G91(インクレメンタル:相対値指令方式)のモーダルGコードが各々設定されている。   The G54 modal group includes G54 (work coordinate system 1), G55 (work coordinate system 2), G56 (work coordinate system 3), G57 (work coordinate system 4), G58 (work coordinate system 5), G59 (work coordinates). A modal G code of system 6) is set. In the work coordinate system setting, the current position of the NC machine tool can be preset to the value of each control axis commanded in the same block. In the G69 modal group, modal G codes of G69 (coordinate rotation mode) and G68 (coordinate rotation mode) are set. In the G90 modal group, modal G codes of G90 (absolute: absolute value command system) and G91 (incremental: relative value command system) are set.

さらに、これら6つのモーダルグループには、そのグループに属するモーダルGコードがNCプログラムの中で指令されたか否かを記憶するための指令フラグが設定される。指令有りの場合は「1」、指令無しの場合は「0」が各々設定される。そしてNCプログラムの任意のブロックに、軸移動に関する動作命令が設定された場合、第1モーダル情報テーブル1321に設定された6つのモーダルグループにそれぞれ属する6種類のモーダルGコードが、その動作命令と同一ブロック、若しくは前ブロックに記載されていれば正常である。つまり、軸移動に関する動作命令が設定された場合、6つのモーダルグループの指令フラグが全て「1」になっていれば正常である。   Further, a command flag for storing whether or not a modal G code belonging to the six modal groups is commanded in the NC program is set. “1” is set when there is a command, and “0” is set when there is no command. When an operation command related to axis movement is set in an arbitrary block of the NC program, six types of modal G codes belonging to the six modal groups set in the first modal information table 1321 are the same as the operation command. It is normal if it is written in the block or the previous block. That is, when an operation command related to axis movement is set, it is normal if the command flags of the six modal groups are all “1”.

次に、第2モーダル情報テーブル1322について説明する。図5に示すように、第2モーダル情報テーブル1322には、「補間移動」の命令があった時に必要とされるG64モーダルグループと、F指令(送り速度)とが各々設定されている。G64モーダルグループには、G64(切削モード)、G61(イグザクトストップモード)のモーダルGコードが各々設定されている。そしてG64モーダルグループ及びF指令にも、NCプログラムの中で指令されたか否かを記憶するために指令フラグが設定される。指令有りの場合は「1」、指令無しの場合は「0」が各々設定される。そしてNCプログラムの任意のブロックに、補間移動に関する動作命令が設定されている場合、第2モーダル情報テーブル1322に設定されたG64モーダルグループに属するモーダルGコードと、F指令とが、その動作命令と同一ブロック、若しくは前ブロックに記載されていれば正常である。つまり、補間移動に関する動作命令が設定された場合は、G64モーダルグループとF指令の指令フラグが何れも「1」になっていれば正常である。   Next, the second modal information table 1322 will be described. As shown in FIG. 5, in the second modal information table 1322, a G64 modal group and an F command (feed speed) required when an “interpolation movement” command is issued are set. In the G64 modal group, modal G codes of G64 (cutting mode) and G61 (exact stop mode) are set. A command flag is set in the G64 modal group and the F command in order to store whether or not the command is issued in the NC program. “1” is set when there is a command, and “0” is set when there is no command. When an operation command related to interpolation movement is set in an arbitrary block of the NC program, the modal G code belonging to the G64 modal group set in the second modal information table 1322 and the F command are It is normal if it is described in the same block or the previous block. That is, when an operation command relating to interpolation movement is set, it is normal if both the G64 modal group and the F command flag are “1”.

次に、第3モーダル情報テーブル1323について説明する。図6に示すように、第3モーダル情報テーブル1323には、「円弧補間」の命令があった時に必要とされるG17モーダルグループが設定されている。G17モーダルグループには、G17(XY平面選択)、G18(YZ平面選択)、G19(ZX平面選択)のモーダルGコードが各々設定されている。そしてG17モーダルグループにも、NCプログラムの中で指令されたか否かを記憶するために指令フラグが設定される。指令有りの場合は「1」、指令無しの場合は「0」が各々設定される。そしてNCプログラムの任意のブロックに、円弧補間に関する動作命令が設定されている場合、第3モーダル情報テーブル1323に設定されたG17モーダルグループに属するモーダルGコードが、その動作命令と同一ブロック、若しくは前ブロックに記載されていれば正常である。つまり、円弧補間に関する動作命令が設定された場合は、G17モーダルグループの指令フラグが「1」になっていれば正常である。   Next, the third modal information table 1323 will be described. As shown in FIG. 6, in the third modal information table 1323, a G17 modal group that is required when an “arc interpolation” command is set is set. In the G17 modal group, modal G codes of G17 (XY plane selection), G18 (YZ plane selection), and G19 (ZX plane selection) are set. A command flag is also set in the G17 modal group in order to store whether or not a command is issued in the NC program. “1” is set when there is a command, and “0” is set when there is no command. When an operation command related to circular interpolation is set in an arbitrary block of the NC program, the modal G code belonging to the G17 modal group set in the third modal information table 1323 is the same block as the operation command or If it is described in the block, it is normal. That is, when an operation command related to circular interpolation is set, it is normal if the command flag of the G17 modal group is “1”.

次に、第4モーダル情報テーブル1324について説明する。図7に示すように、第4モーダル情報テーブル1324には、「固定サイクル」の命令があった時に必要とされるG98モーダルグループが設定されている。G98モーダルグループには、G98(イニシャル点レベル復帰)、G99(R点レベル復帰)のモーダルGコードが各々設定されている。そしてG98モーダルグループにも、NCプログラムの中で指令されたか否かを記憶するために指令フラグが設定される。指令有りの場合は「1」、指令無しの場合は「0」が各々設定される。そしてNCプログラムの任意のブロックに、円弧補間に関する動作命令が設定されている場合、第2モーダル情報テーブル1322に設定されたG98モーダルグループに属するモーダルGコードが、その動作命令と同一ブロック、若しくは前ブロックに記載されていれば正常である。つまり、固定サイクルに関する動作命令が設定された場合は、G98モーダルグループの指令フラグが「1」になっていれば正常である。   Next, the fourth modal information table 1324 will be described. As shown in FIG. 7, in the fourth modal information table 1324, a G98 modal group required when a “fixed cycle” command is issued is set. In the G98 modal group, modal G codes of G98 (initial point level return) and G99 (R point level return) are set. A command flag is set also in the G98 modal group in order to store whether or not a command is issued in the NC program. “1” is set when there is a command, and “0” is set when there is no command. If an operation command related to circular interpolation is set in an arbitrary block of the NC program, the modal G code belonging to the G98 modal group set in the second modal information table 1322 is the same block as the operation command or If it is described in the block, it is normal. That is, when an operation command related to a fixed cycle is set, it is normal if the command flag of the G98 modal group is “1”.

次に、工具交換情報テーブル1325について説明する。図8に示すように、工具交換情報テーブル1325には、「工具交換命令」(M6)があった時に必要とされるT指令(工具番号指令)が設定されている。そしてT指令にも、NCプログラムの中で指令されたか否かを記憶するために指令フラグが設定される。指令有りの場合は「1」、指令無しの場合は「0」が各々設定される。そしてNCプログラムの任意のブロックに、工具交換命令に関する動作命令が設定されている場合、T指令が、その動作命令と同一ブロック、若しくは前ブロックに記載されていれば正常である。つまり、工具交換に関する動作命令が設定された場合は、T指令の指令フラグが「1」になっていれば正常である。   Next, the tool change information table 1325 will be described. As shown in FIG. 8, in the tool change information table 1325, a T command (tool number command) required when a “tool change command” (M6) is issued is set. In the T command, a command flag is set to store whether or not the command is issued in the NC program. “1” is set when there is a command, and “0” is set when there is no command. When an operation command related to a tool change command is set in an arbitrary block of the NC program, it is normal if the T command is written in the same block as the operation command or in the previous block. That is, when an operation command related to tool change is set, it is normal if the command flag of the T command is “1”.

次に、主軸回転情報テーブル1326について説明する。図9に示すように、主軸回転情報テーブル1326には、「主軸回転命令」(M3,M4)があった時に必要とされるS指令(回転数指令)が設定されている。そしてS指令にも、NCプログラムの中で指令されたか否かを記憶するために指令フラグが設定される。指令有りの場合は「1」、指令無しの場合は「0」が各々設定される。そしてNCプログラムの任意のブロックに、主軸回転命令に関する動作命令が設定されている場合、S指令が、その動作命令と同一ブロック、若しくは前ブロックに記載されていれば正常である。つまり、主軸回転に関する動作命令が設定された場合は、S指令の指令フラグが「1」になっていれば正常である。   Next, the spindle rotation information table 1326 will be described. As shown in FIG. 9, in the spindle rotation information table 1326, an S command (rotational speed command) required when there is a “spindle rotation command” (M3, M4) is set. In the S command, a command flag is set to store whether or not the command is issued in the NC program. “1” is set when there is a command, and “0” is set when there is no command. When an operation command related to the spindle rotation command is set in an arbitrary block of the NC program, it is normal if the S command is described in the same block as the operation command or in the previous block. That is, when an operation command related to spindle rotation is set, it is normal if the command flag of the S command is “1”.

次に、ディスプレイ25に表示されるチェック画面251と、警告画面252とについて、図10を参照して説明する。図10は、ディスプレイ25に表示されたチェック画面251と、警告画面252とを示す概念図である。工作機械30の操作パネル(図示外)に設けられたチェックボタン22(図1参照)を押下すると、ディスプレイ25の画面が左右に分割され、左側にチェック画面251が表示され、右側に警告画面252が表示される。さらにキーボード21の操作によって、チェック対象とするNCプログラムがチェック画面251に表示される。次いで、チェック開始ボタン23を押下すると、チェック画面251に表示されたNCプログラムのモーダルチェックが実行される。モーダルチェックでは、シーケンス番号の若い方から1ブロック毎に順に読み込まれ、モーダルGコードが正常に設定されているかのチェックがなされる。   Next, the check screen 251 and the warning screen 252 displayed on the display 25 will be described with reference to FIG. FIG. 10 is a conceptual diagram showing a check screen 251 and a warning screen 252 displayed on the display 25. When a check button 22 (see FIG. 1) provided on an operation panel (not shown) of the machine tool 30 is pressed, the screen of the display 25 is divided into left and right, a check screen 251 is displayed on the left side, and a warning screen 252 is displayed on the right side. Is displayed. Further, the NC program to be checked is displayed on the check screen 251 by operating the keyboard 21. Next, when the check start button 23 is pressed, a modal check of the NC program displayed on the check screen 251 is executed. In the modal check, the blocks are read in order from the lowest sequence number, and it is checked whether the modal G code is normally set.

チェック画面251において、現在チェックされているブロックは、四角い枠60に囲まれて表示される。これによりユーザは、現在チェック中のブロックを容易に認識できる。そして、NCプログラムのチェック中に、モーダルGコードの記載漏れの疑いがある場合、警告画面252に記載漏れの疑いのあるモーダルGコードの候補が全て表示され、チェックが一時停止される。これによりユーザは現在チェック中のブロックにおいて、モーダルGコードの設定ミスの疑いがあることがわかる。さらに警告画面252に表示された候補の中から記載漏れの疑いのあるモーダルGコードを確認できる。よってプログラムの修正を速やかに行うことができる。   On the check screen 251, the currently checked block is displayed surrounded by a square frame 60. As a result, the user can easily recognize the block currently being checked. If there is a modal G code description suspicion missing during the NC program check, all the modal G code candidates suspected of being omitted are displayed on the warning screen 252 and the check is suspended. As a result, the user knows that there is a suspicion of a modal G code setting error in the block currently being checked. Further, the modal G code that is suspected of omission of description can be confirmed from the candidates displayed on the warning screen 252. Therefore, the program can be corrected promptly.

次に、CPU10によるモーダルチェックの制御について、図11乃至図13のフローチャートを参照して説明する。図11は、CPU10によるモーダルチェックのフローチャートであり、図12は、図11の続きを示すフローチャートでり、図13は、図11の続きを示すフローチャートである。ここでは、図10に示すチェック画面251に表示されたNCプログラムをチェックする場合について説明する。   Next, modal check control by the CPU 10 will be described with reference to the flowcharts of FIGS. 11 to 13. 11 is a flowchart of the modal check by the CPU 10, FIG. 12 is a flowchart showing the continuation of FIG. 11, and FIG. 13 is a flowchart showing the continuation of FIG. Here, a case where the NC program displayed on the check screen 251 shown in FIG. 10 is checked will be described.

まず、工作機械30の操作パネル(図示外)に設けられたチェックボタン22(図1参照)が押下されると、ディスプレイ25にチェック画面251と、警告画面252とが各々表示される。チェック画面251には、不揮発メモリ13のNCプログラム記憶領域131(図3参照)に記憶されたNCプログラムのうち選択されたNCプログラムが読み込まれて表示される。そして、チェック開始ボタン23が押下されると、ROM11のモーダルチェックプログラム記憶領域112(図2参照)に記憶されたモーダルチェックプログラムが呼び出され、CPU10によるモーダルチェックが開始される。   First, when a check button 22 (see FIG. 1) provided on an operation panel (not shown) of the machine tool 30 is pressed, a check screen 251 and a warning screen 252 are displayed on the display 25, respectively. On the check screen 251, the selected NC program among the NC programs stored in the NC program storage area 131 (see FIG. 3) of the nonvolatile memory 13 is read and displayed. When the check start button 23 is pressed, the modal check program stored in the modal check program storage area 112 (see FIG. 2) of the ROM 11 is called, and the modal check by the CPU 10 is started.

はじめに、各種データの初期化が行われる(S1)。ここでは、不揮発メモリ13の情報テーブル記憶領域132に記憶された各種テーブル(図4〜図9参照)の指令フラグが全て「0」にされ、「設定無し」の状態に設定される。次いで、シーケンス番号N01の1ブロックが読み込まれる(S2)。続いて、その読み込まれたNCデータの内容が解析される(S3)。シーケンス番号N01のNCデータは、「G90G54」であるので、「絶対値指令方式でワーク座標系1のモーダル状態を設定せよ。」との内容の指示である。   First, various data are initialized (S1). Here, the command flags of the various tables (see FIGS. 4 to 9) stored in the information table storage area 132 of the nonvolatile memory 13 are all set to “0” and set to “not set”. Next, one block of sequence number N01 is read (S2). Subsequently, the contents of the read NC data are analyzed (S3). Since the NC data of the sequence number N01 is “G90G54”, the instruction is “set the modal state of the work coordinate system 1 by the absolute value command method”.

次いで、解析された1ブロックの中に、モーダルGコードが有るか否かが判断される(S4)。シーケンス番号N01には、「G90」と「G54」の2つのモーダルGコードが設定されている。従って、1ブロック中にモーダルGコードが有るので(S4:YES)、第1モーダル情報テーブル1321のG90モーダルグループと、G54モーダルグループとが「指令有り」に設定される(S6)。つまり、G54モーダルグループの指令フラグと、G90モーダルグループの指令フラグとに「1」が各々設定される(図4参照)。さらに、解析されたNCデータに動作命令が有るか否かが判断される(S7)。「G90」「G54」は、何れもモーダルGコードであって動作命令ではないので(S7:NO)、S2に戻る。   Next, it is determined whether or not there is a modal G code in one analyzed block (S4). Two modal G codes “G90” and “G54” are set in the sequence number N01. Accordingly, since there is a modal G code in one block (S4: YES), the G90 modal group and the G54 modal group in the first modal information table 1321 are set to “command present” (S6). That is, “1” is set in each of the G54 modal group command flag and the G90 modal group command flag (see FIG. 4). Further, it is determined whether or not there is an operation command in the analyzed NC data (S7). Since “G90” and “G54” are both modal G codes and not operation commands (S7: NO), the process returns to S2.

次いで、シーケンス番号N02が読み込まれる(S2)。シーケンス番号N02のNCデータは、「Z100」である。続いて、その読み込まれたNCデータの内容が解析される(S3)。さらに、解析された1ブロックの中に、モーダルGコードが有るか否かが判断される(S4)。シーケンス番号N02には、モーダルGコードが設定されていないので(S4:NO)、図12のフローチャートに移り、シーケンス番号N02に、工具交換命令であるM6が有るか否かが判断される(S9)。M6はないので(S9:NO)、次いで主軸回転命令であるM3,M4が有るかが判断される(S12)。M3,M4もないので(S12:NO)、次いで、M30であるか否かが判断される(S15)。M30ではないので(S15:NO)、図11のフローチャートのS7に移行する。   Next, the sequence number N02 is read (S2). The NC data of sequence number N02 is “Z100”. Subsequently, the contents of the read NC data are analyzed (S3). Further, it is determined whether or not there is a modal G code in one analyzed block (S4). Since the modal G code is not set in the sequence number N02 (S4: NO), the process proceeds to the flowchart of FIG. 12, and it is determined whether or not the sequence number N02 includes the tool change command M6 (S9). ). Since there is no M6 (S9: NO), it is then determined whether there are M3 and M4 which are spindle rotation commands (S12). Since there is no M3 or M4 (S12: NO), it is then determined whether or not it is M30 (S15). Since it is not M30 (S15: NO), it transfers to S7 of the flowchart of FIG.

次いで、解析されたNCデータに動作命令が有るか否かが判断される(S7)。「Z100」は、「Z100に軸を移動させなさい。」との内容の指示である。つまり、軸を移動させる動作命令であるので(S7:YES)、図13のフローチャートに移り、その動作命令に関連する全てのモーダルグループが「指令有り」になっているか否かが判断される(S17)。ここで、軸移動の命令があったので、第1モーダル情報テーブル1321に設定された6つのモーダルグループにそれぞれ属する6種類のモーダルGコードが、その動作命令と同一ブロック、若しくは前ブロックに記載されていれなければならない。   Next, it is determined whether or not there is an operation command in the analyzed NC data (S7). “Z100” is an instruction of the content “Move axis to Z100.” That is, since this is an operation command for moving the axis (S7: YES), the flow proceeds to the flowchart of FIG. 13 to determine whether or not all modal groups related to the operation command are “command present” ( S17). Here, since there was an axis movement command, six types of modal G codes respectively belonging to the six modal groups set in the first modal information table 1321 are described in the same block as the operation command or in the previous block. It must be kept.

従って、もし、6つのモーダルグループの指令フラグが全て「1」になっている場合(S17:YES)、6種類のモーダルGコードが、その動作命令と同一ブロック、若しくは前ブロックに記載されていることになる。この場合、軸移動命令に関するモーダルGコードは正しく設定されているので、次ブロックのチェックを継続する(S2)。   Therefore, if the command flags of the six modal groups are all “1” (S17: YES), six types of modal G codes are written in the same block as the operation command or in the previous block. It will be. In this case, since the modal G code related to the axis movement command is set correctly, the next block check is continued (S2).

ところが、本実施例では、図4に示すように、指令フラグ「1」が設定されているのは、G90モーダルグループと、G54モーダルグループとのみであって、その他のモーダルグループの指令フラグは「0」である。つまり、軸移動命令に関連する全てのモーダルグループが「指令有り」になっていないので(S17:NO)、軸移動に関するモーダルGコードの設定ミスの疑いがある。そこで、警告画面252に警告メッセージが表示されると共に、指令フラグが「0」のモーダルグループに属する全てのモーダルGコードが表示される(S18)。これにより、ユーザは現在チェック中のブロックにおいて、モーダルGコードの設定ミスの疑いがあることがわかる。さらに警告画面252に表示された候補(図10参照)の中から、記載漏れの疑いのあるモーダルGコードを確認できる。よってプログラムの修正を速やかに行うことができる。   However, in this embodiment, as shown in FIG. 4, the command flag “1” is set only for the G90 modal group and the G54 modal group, and the command flags of the other modal groups are “ 0 ". That is, since all the modal groups related to the axis movement command are not “command present” (S17: NO), there is a suspicion of a setting error of the modal G code related to the axis movement. Therefore, a warning message is displayed on the warning screen 252 and all modal G codes belonging to the modal group whose command flag is “0” are displayed (S18). As a result, the user knows that there is a suspicion of a modal G code setting error in the block currently being checked. Furthermore, a modal G code that is suspected of omission can be confirmed from the candidates (see FIG. 10) displayed on the warning screen 252. Therefore, the program can be corrected promptly.

続いて、操作パネルの解除ボタン24が押下されて、警告が解除されたか否かが判断される(S19)。解除されない間は(S19:NO)、S18に戻って、警告画面252に警告が継続して表示される。ユーザは警告を無視してチェックを再開させるために、解除ボタン24を押下する。そして解除ボタン24が押下され、警告が解除された場合(S19:YES)、警告画面252に表示されていた内容が消去される(S20)。そして、図11のフローチャートのS2に戻り、次ブロックのチェックを継続する(S2)。   Subsequently, it is determined whether the warning is released by pressing the release button 24 on the operation panel (S19). While it is not canceled (S19: NO), the process returns to S18 and the warning is continuously displayed on the warning screen 252. The user presses the release button 24 to ignore the warning and restart the check. When the release button 24 is pressed and the warning is released (S19: YES), the content displayed on the warning screen 252 is deleted (S20). Then, the process returns to S2 in the flowchart of FIG.

次に、シーケンス番号N03のNCデータが読み込まれる(S2)。シーケンス番号N03のNCデータは、「M6T1」である。続いて、その読み込まれたNCデータの内容が解析される(S3)。次いで、解析された1ブロックの中に、モーダルGコードが有るか否かが判断される(S4)。シーケンス番号N03には、モーダルGコードが無いので(S4:NO)、図12のフローチャートに移り、シーケンス番号N03に、工具交換命令であるM6が有るか(S9)か否かが判断される。シーケンス番号N03には、「M6」のコードが設定されているので(S9:YES)、同一ブロック内に工具番号指令であるT指令が有るか否かが判断される(S10)。シーケンス番号N03にはT指令が有るので(S10)、工具交換情報テーブル(図8参照)のT指令に対して、指令フラグ「1」が設定される(S11)。なお、同一ブロック内にT指令がない場合は(S10:NO)、工具交換情報テーブルのT指令の指令フラグは、そのまま変更されない。   Next, NC data of sequence number N03 is read (S2). The NC data of the sequence number N03 is “M6T1”. Subsequently, the contents of the read NC data are analyzed (S3). Next, it is determined whether or not there is a modal G code in one analyzed block (S4). Since there is no modal G code in the sequence number N03 (S4: NO), the process proceeds to the flowchart of FIG. 12, and it is determined whether or not the sequence number N03 has a tool change command M6 (S9). Since the code of “M6” is set in the sequence number N03 (S9: YES), it is determined whether or not there is a T command that is a tool number command in the same block (S10). Since the sequence number N03 has a T command (S10), a command flag “1” is set for the T command in the tool change information table (see FIG. 8) (S11). When there is no T command in the same block (S10: NO), the command flag of the T command in the tool change information table is not changed as it is.

次いで、図11のフローチャートに移り、解析されたNCデータに動作命令が有るか否かが判断される(S7)。「M6T1」は「工具番号1番の工具を工具交換せよ。」との動作命令であるので(S7:YES)、図13のフローチャートに移り、工具交換命令に必須となるT指令が、「指令有り」になっているか否かが判断される(S17)。図8に示すように、工具交換情報テーブル1325のT指令の指令フラグには「1」が設定されているので、T指令が、その動作命令と同一ブロックに記載されている。この場合、M6指令に対して、T指令が正しく設定されている。よって、S2に戻り、次ブロックのチェックを継続する(S2)。   Next, the process proceeds to the flowchart of FIG. 11, and it is determined whether or not there is an operation command in the analyzed NC data (S7). Since “M6T1” is an operation command “Please change the tool of tool number 1” (S7: YES), the process proceeds to the flowchart of FIG. It is determined whether or not “Yes” is set (S17). As shown in FIG. 8, since the command flag of the T command in the tool change information table 1325 is set to “1”, the T command is described in the same block as the operation command. In this case, the T command is correctly set with respect to the M6 command. Therefore, the process returns to S2 to continue checking the next block (S2).

次に、シーケンス番号N04のNCデータが読み込まれる(S2)。シーケンス番号N04のNCデータは「M3」である。続いて、その読み込まれたNCデータの内容が解析される(S3)。次いで、読み込まれた1ブロックの中にモーダルGコードが有るか否かが判断される(S4)。シーケンス番号N04には、モーダルGコードが無いので(S4:NO)、図12のフローチャートに移り、さらにシーケンス番号N04に、M6が有るか(S9)か否かが判断される。シーケンス番号N04には、M6が無いので(S9:NO)、シーケンス番号N04に、主軸回転命令であるM3,M4が有るか(S12)か否かが判断される。シーケンス番号N04には、「M3」のコードが設定されているので(S12:YES)、さらに同一ブロック内に回転数指令であるS指令が有るか否かが判断される(S13)。シーケンス番号N04にはS指令がないので(S13:NO)、主軸回転情報テーブル1326のS指令の指令フラグは、そのまま変更されない。なお、S指令がある場合は(S13:YES)、主軸回転情報テーブル1326のS指令の指令フラグには、「1」が設定される(S14)。   Next, NC data of sequence number N04 is read (S2). The NC data of sequence number N04 is “M3”. Subsequently, the contents of the read NC data are analyzed (S3). Next, it is determined whether or not there is a modal G code in one read block (S4). Since there is no modal G code in the sequence number N04 (S4: NO), the process proceeds to the flowchart of FIG. 12, and it is further determined whether the sequence number N04 has M6 (S9). Since there is no M6 in the sequence number N04 (S9: NO), it is determined whether the sequence number N04 has M3 and M4 which are spindle rotation commands (S12). Since the code of “M3” is set in the sequence number N04 (S12: YES), it is further determined whether or not there is an S command that is a rotational speed command in the same block (S13). Since there is no S command for the sequence number N04 (S13: NO), the command flag for the S command in the spindle rotation information table 1326 is not changed as it is. If there is an S command (S13: YES), “1” is set in the command flag of the S command in the spindle rotation information table 1326 (S14).

次いで、図11のフローチャートに移り、解析されたNCデータに動作命令が有るか否かが判断される(S7)。「M3」は「主軸を回転せよ。」との動作命令であるので(S7:YES)、図13のフローチャートに移り、主軸回転命令に必須となる回転数指令(S指令)が、「指令有り」になっているか否かが判断される(S17)。図9に示すように、主軸回転情報テーブル1326の工具交換命令の指令フラグには「0」が設定されているので、S指令は、その動作命令と同一ブロックに記載されていない。この場合、M3,M4指令に対して、S指令が正しく設定されていないので、警告画面252に警告メッセージが表示されると共に、Sコードが表示される(S18)。これによりユーザは現在チェック中のブロックにおいて、S指令の記載漏れの疑いがあることがわかるので、プログラムの修正を速やかに行うことができる。   Next, the process proceeds to the flowchart of FIG. 11, and it is determined whether or not there is an operation command in the analyzed NC data (S7). Since “M3” is an operation command “Spin the spindle” (S7: YES), the process proceeds to the flowchart of FIG. 13 and the rotation speed command (S command) that is essential for the spindle rotation command is “There is a command. Is determined (S17). As shown in FIG. 9, since the command flag of the tool change command in the spindle rotation information table 1326 is set to “0”, the S command is not written in the same block as the operation command. In this case, since the S command is not set correctly with respect to the M3 and M4 commands, a warning message is displayed on the warning screen 252 and an S code is displayed (S18). As a result, the user knows that there is a suspicion of omission of the description of the S command in the block currently being checked, so that the program can be corrected quickly.

続いて、操作パネルの解除ボタン24が押下されて、警告が解除されたか否かが判断される(S19)。解除されない間は(S19:NO)、S18に戻って、警告画面252に警告が表示される。ユーザは警告を無視してチェックを再開させるために、解除ボタン24を押下する。解除ボタン24が押下され、警告が解除された場合(S19:YES)、警告画面252に表示されていた警告メッセージと、記載漏れの疑いのあるSコードとが消去される(S20)。そして、図11のフローチャートのS2に戻り、次ブロックのチェックを継続する。   Subsequently, it is determined whether the warning is released by pressing the release button 24 on the operation panel (S19). While it is not canceled (S19: NO), the process returns to S18 and a warning is displayed on the warning screen 252. The user presses the release button 24 to ignore the warning and restart the check. When the release button 24 is pressed and the warning is released (S19: YES), the warning message displayed on the warning screen 252 and the S code suspected of being omitted are deleted (S20). Then, the process returns to S2 in the flowchart of FIG.

こうしてシーケンス番号N05以降において上記処理が繰り返され、最後のブロックが読み込まれ(S2)、内容が解析される(S3)。最後のブロックは、終了コードであるM30であるので(S4:NO、S9:NO、S12:NO、S15:YES)、チェック対象であるNCプログラムを最後までチェックしたことになるので、モーダルチェックが終了する。   Thus, the above processing is repeated after sequence number N05, the last block is read (S2), and the contents are analyzed (S3). Since the last block is M30 which is an end code (S4: NO, S9: NO, S12: NO, S15: YES), since the NC program to be checked is checked to the end, the modal check is performed. finish.

なお、以上の説明において、図11のフローチャートのS2を処理を実行するCPU10が本発明の「読込手段」に相当し、S3の処理を実行するCPU10が本発明の「解析手段」に相当し、S4の処理を実行するCPU10が本発明の「モーダル判断手段」に相当し、S17の処理を実行するCPU10が本発明の「モーダル設定判断手段」に相当する。さらに、不揮発メモリ13の情報テーブル記憶領域132が本発明の「モーダル候補記憶手段」と「モーダル設定記憶手段」に相当する。また、図10に示すディスプレイ25が本発明の「表示装置」に相当する。   In the above description, the CPU 10 that executes the process of S2 in the flowchart of FIG. 11 corresponds to the “reading unit” of the present invention, and the CPU 10 that executes the process of S3 corresponds to the “analyzing unit” of the present invention. The CPU 10 that executes the process of S4 corresponds to the “modal determination means” of the present invention, and the CPU 10 that executes the process of S17 corresponds to the “modal setting determination means” of the present invention. Further, the information table storage area 132 of the nonvolatile memory 13 corresponds to the “modal candidate storage unit” and the “modal setting storage unit” of the present invention. 10 corresponds to the “display device” of the present invention.

以上説明したように、本実施形態の数値制御装置1では、作成したNCプログラムにおいて、モーダルGコードが正しく設定されているか否かのモーダルチェックを行うことができる。不揮発メモリ13には、「軸移動」、「補間移動」等の工作機械30の動作命令があった時に必要とされるモーダルGコードが分類された各種テーブルが記憶されている。例えば、不揮発メモリ13に記憶された第1モーダル情報テーブル1321には、「軸移動」の命令があった時に必要とされるモーダルGコードが6つのグループに分類されて各々設定されている。   As described above, the numerical control device 1 according to the present embodiment can perform a modal check as to whether or not the modal G code is correctly set in the created NC program. The non-volatile memory 13 stores various tables in which modal G codes that are required when there are operation commands for the machine tool 30 such as “axis movement” and “interpolation movement” are classified. For example, in the first modal information table 1321 stored in the nonvolatile memory 13, modal G codes required when an “axis movement” command is given are classified into six groups and set.

CPU10によって読み込まれた1ブロック内に、軸移動に関連するモーダルGコードが設定されている場合、そのモーダルGコードが属するモーダルグループに対して、指令フラグ「1」が設定される。そして次ブロックにて軸移動の命令があった場合、第1モーダル情報テーブル1321に設定された6つのモーダルグループの指令フラグが全て「1」になっていれば、軸移動に関するモーダルGコードは正しく設定されている。その反対に、6つのモーダルグループのうち何れかの指令フラグが「0」になっている場合、モーダルGコードの記載漏れの疑いがある。この場合、ディスプレイ25の警告画面252に警告が表示される。これによりユーザは現在チェック中のブロックにおいて、モーダルGコードの設定漏れがあることがわかる。さらに警告画面252には、指令フラグが「0」になっているモーダルグループに属するモーダルGコードが表示されるので、その表示された候補の中から、記載漏れの疑いのあるモーダルGコードを確認できる。よってプログラムの修正を速やかに行うことができる。   When the modal G code related to the axis movement is set in one block read by the CPU 10, the command flag “1” is set for the modal group to which the modal G code belongs. If there is a command to move the axis in the next block, if all six modal group command flags set in the first modal information table 1321 are “1”, the modal G code related to the shaft movement is correct. Is set. On the other hand, if any command flag in the six modal groups is “0”, there is a suspicion that the modal G code is not written. In this case, a warning is displayed on the warning screen 252 of the display 25. As a result, the user can see that there is a modal G code setting omission in the block currently being checked. Further, since the modal G code belonging to the modal group whose command flag is “0” is displayed on the warning screen 252, the modal G code suspected of omission is confirmed from the displayed candidates. it can. Therefore, the program can be corrected promptly.

なお、本発明の数値制御装置は、上記実施形態に限らず、各種の変形が可能なことはいうまでもない。例えば、上記実施形態で示したモーダルGコードに加え、他のモーダルGコードのチェックを行うようにしてもよい。また、特定のモーダルGコードのみをチェックするようにしてもよい。また、上記実施例は、S19において、特定のモーダルを一度解除した後も、同一命令がNCプログラム上にあると、再度警告を表示してしまうため、一度警告を行ない解除操作を行なったものは、S20において、情報テーブル記憶領域132上に解除操作を1度行なったことを示す別のフラグ「2」を記憶して、次ブロック以降のチェックにおいて、警告表示および、解除操作をしないようにすると良い。   Needless to say, the numerical control device of the present invention is not limited to the above-described embodiment, and various modifications are possible. For example, in addition to the modal G code shown in the above embodiment, another modal G code may be checked. Further, only a specific modal G code may be checked. In the above embodiment, since the warning is displayed again if the same command is in the NC program even after the specific modal is canceled once in S19, the warning is once issued and the release operation is performed. In S20, another flag “2” indicating that the release operation has been performed once is stored in the information table storage area 132, and the warning display and the release operation are not performed in the check after the next block. good.

また、上記実施形態の変形例として、作成されるNCプログラムの中で、所定のパラメータに値を書き込んだり、読み出したりする際に使用されるR/Wマクロ変数について本発明を適用することもできる。例えば、R/Wマクロ変数が読み込まれる際に、そのR/Wマクロ変数に既に値が書き込まれているか否かのチェックを行うことができる。   As a modification of the above-described embodiment, the present invention can also be applied to R / W macro variables used when a value is written to or read from a predetermined parameter in a created NC program. . For example, when an R / W macro variable is read, it can be checked whether or not a value has already been written to the R / W macro variable.

そこで、上記実施形態の変形例として、R/Wマクロ変数の設定が正しく行われているか否かのチェックを行うマクロチェックについて、本発明の概念を適用した数値制御装置の変形例について、図面を参照して説明する。図14は、マクロ情報テーブル1327の概念図であり、図15は、ディスプレイ25に表示されたチェック画面253と、警告画面254とを示す概念図であり、図16は、CPU10によるマクロチェックのフローチャートである。   Therefore, as a modification of the above-described embodiment, with respect to a macro check for checking whether or not the setting of the R / W macro variable is correctly performed, a modification of the numerical control apparatus to which the concept of the present invention is applied is illustrated in the drawings. The description will be given with reference. FIG. 14 is a conceptual diagram of the macro information table 1327, FIG. 15 is a conceptual diagram showing a check screen 253 and a warning screen 254 displayed on the display 25, and FIG. It is.

なお、変形例である数値制御装置は、上記実施形態の数値制御装置1の構成(図1参照)とほぼ同じであるので、上記実施形態と同符号を付して説明を省略する。そして、不揮発メモリ13に記憶されたマクロ情報テーブル1327と、ディスプレイ25に表示されるチェック画面253、及び警告画面254と、CPU10によるマクロチェックの制御とを中心に説明する。   Since the numerical control device as a modification is substantially the same as the configuration of the numerical control device 1 of the above embodiment (see FIG. 1), the same reference numerals as those of the above embodiment are used and description thereof is omitted. The macro information table 1327 stored in the nonvolatile memory 13, the check screen 253 and warning screen 254 displayed on the display 25, and the macro check control by the CPU 10 will be mainly described.

まず、不揮発メモリ13に記憶されたマクロ情報テーブル1327について説明する。図14に示すように、マクロ情報テーブル1327には、図15に示すNCプログラム中に設定された複数のR/Wマクロ変数「♯100」、「♯101」、「♯102」、「♯103」…が記憶されている。これらR/Wマクロ変数には、NCプログラムを実行する過程において、各種設定値が各々書き込まれるようになっている。さらにこれらR/Wマクロ変数には、値が書き込み済み(以下、WRITE済みと呼ぶ。)であることを記憶するための書込フラグが設定される。あるR/Wマクロ変数がWRITE済みである場合は、書込フラグ「1」が設定され、WRITE済みでない場合は書込フラグ「0」が設定される。このようなマクロ情報テーブル1327により、どのR/Wマクロ変数がWRITE済みであるか否かを容易に判別できる。   First, the macro information table 1327 stored in the nonvolatile memory 13 will be described. As shown in FIG. 14, the macro information table 1327 includes a plurality of R / W macro variables “# 100”, “# 101”, “# 102”, “# 103” set in the NC program shown in FIG. "... is remembered. These R / W macro variables are written with various setting values in the course of executing the NC program. Further, in these R / W macro variables, a write flag for storing that a value has been written (hereinafter referred to as WRITE completed) is set. When a certain R / W macro variable has been written, the write flag “1” is set, and when it has not been written, the write flag “0” is set. With such a macro information table 1327, it is possible to easily determine which R / W macro variable has been written.

次に、ディスプレイ25に表示されるチェック画面253と、警告画面254とについて、図15を参照して説明する。工作機械30の操作パネル(図示外)に設けられたマクロチェックボタン(図示外)を押下すると、ディスプレイ25の下側を除く大部分に、チェック画面253が表示され、下側に警告画面254が表示される。チェック画面253には、チェック対象であるNCプログラムが表示される。次いで、チェック開始ボタン23を押下すると、チェック画面251に表示されたNCプログラムのマクロチェックが実行される。マクロチェックでは、シーケンス番号の若い方から1ブロック毎に順に読み込まれ、R/Wマクロ変数が正常に設定されているかのチェックがなされる。   Next, the check screen 253 and the warning screen 254 displayed on the display 25 will be described with reference to FIG. When a macro check button (not shown) provided on the operation panel (not shown) of the machine tool 30 is pressed, a check screen 253 is displayed on most of the screen 25 except the lower side, and a warning screen 254 is displayed on the lower side. Is displayed. On the check screen 253, the NC program to be checked is displayed. Next, when the check start button 23 is pressed, a macro check of the NC program displayed on the check screen 251 is executed. In the macro check, reading is performed for each block in order from the lowest sequence number, and it is checked whether the R / W macro variable is normally set.

また、現在チェックされているブロックは、四角い枠61に囲まれて表示される。これによりユーザは、現在チェック中のブロックを容易に認識できる。そしてNCプログラムのチェック中に、ある特定のR/Wマクロ変数について読み込み命令(以下、READ命令と呼ぶ)があった場合に、そのR/Wマクロ変数について既に書き込み命令(以下、WRITE命令と呼ぶ)があったか否かのチェックを行う。WRITE命令がされていないR/Wマクロ変数について値を読み込むことはできない。例えば、シーケンス番号N06番において、値が書き込まれていない♯103についてREAD命令があった場合、警告画面254に警告表示がされると共に、「♯103は、WRITEされていません。」というメッセージが表示される。これによりユーザは現在チェック中であるシーケンス番号N06番において、♯103に設定ミスがあることがわかる。よってプログラムの修正を速やかに行うことができる。   In addition, the currently checked block is displayed surrounded by a square frame 61. As a result, the user can easily recognize the block currently being checked. Then, when there is a read instruction (hereinafter referred to as a READ instruction) for a specific R / W macro variable during the NC program check, the R / W macro variable is already a write instruction (hereinafter referred to as a WRITE instruction). ) Is checked. Values cannot be read for R / W macro variables for which no WRITE instruction has been issued. For example, in sequence number N06, if there is a READ instruction for # 103 for which no value has been written, a warning message is displayed on warning screen 254 and a message “# 103 is not written” is displayed. Is displayed. As a result, the user knows that there is a setting error in # 103 in the sequence number N06 currently being checked. Therefore, the program can be corrected promptly.

次に、CPU10によるマクロチェックの制御について、図16のフローチャートを参照して説明する。ここでは、図15に示すチェック画面253に表示されたNCプログラムをチェックする場合について説明する。   Next, macro check control by the CPU 10 will be described with reference to the flowchart of FIG. Here, a case where the NC program displayed on the check screen 253 shown in FIG. 15 is checked will be described.

まず、工作機械30の操作パネル(図示外)に設けられたマクロチェックボタン(図示外)が押下されると、ディスプレイ25にチェック画面253と、警告画面254とが各々表示される。チェック画面253には、不揮発メモリ13のNCプログラム記憶領域131(図3参照)に記憶されたNCプログラムのうち特定のNCプログラムが読み込まれて表示される。そして、チェック開始ボタン23が押下されると、ROM11に記憶されたマクロチェックプログラムが呼び出され、CPU10によるマクロチェックが開始される。   First, when a macro check button (not shown) provided on the operation panel (not shown) of the machine tool 30 is pressed, a check screen 253 and a warning screen 254 are displayed on the display 25, respectively. On the check screen 253, a specific NC program among the NC programs stored in the NC program storage area 131 (see FIG. 3) of the nonvolatile memory 13 is read and displayed. When the check start button 23 is pressed, the macro check program stored in the ROM 11 is called and the macro check by the CPU 10 is started.

はじめに、各種データの初期化が行われる(S31)。ここでは、不揮発メモリ13のマクロ情報テーブル1327の各R/Wマクロ変数に書き込まれた値が全て初期化される。次いで、シーケンス番号N01の1ブロックが読み込まれる(S32)。続いて、その読み込まれたNCデータの内容が解析される(S33)。さらにその解析された内容が、R/Wマクロ変数の値を読み込むREAD命令であるか否かが判断される(S34)。シーケンス番号N01のNCデータは、「♯100=50」である。これは、「♯100に50を書き込みなさい。」という内容のWRITE命令である。従って、READ命令ではないので、(S34:NO)、続いて、R/Wマクロ変数の値を書き込むWRITE命令であるか否かが判断される(S39)。「♯100=50」は、WRITE命令であるので(S39:YES)、マクロ情報テーブル1327の♯100に対して、「50」が書き込まれる(S40)。さらに♯100がWRITE済みであることを設定するために、♯100の書き込みフラグに「1」が設定され(S41)、S32に戻る。   First, various data are initialized (S31). Here, all values written in the R / W macro variables of the macro information table 1327 of the nonvolatile memory 13 are initialized. Next, one block of sequence number N01 is read (S32). Subsequently, the contents of the read NC data are analyzed (S33). Further, it is determined whether or not the analyzed content is a READ instruction for reading the value of the R / W macro variable (S34). The NC data of sequence number N01 is “# 100 = 50”. This is a WRITE command with the content “Write 50 to # 100.” Therefore, since it is not a READ instruction (S34: NO), it is subsequently determined whether or not it is a WRITE instruction for writing the value of the R / W macro variable (S39). Since “# 100 = 50” is a WRITE instruction (S39: YES), “50” is written into # 100 of the macro information table 1327 (S40). Further, in order to set that # 100 has been written, “1” is set to the write flag of # 100 (S41), and the process returns to S32.

次いで、シーケンス番号N02が読み込まれる(S32)。続いて、その読み込まれたNCデータの内容が解析される(S33)。さらにその解析された内容が、R/Wマクロ変数の値を読み込むREAD命令であるか否かが判断される(S34)。シーケンス番号N02のNCデータは、「♯101=52」である。これは、「♯101に50を書き込みなさい。」という内容のWRITE命令である。従って、READ命令ではないので、(S34:NO)、続いて、R/Wマクロ変数の値を書き込むWRITE命令であるか否かが判断される(S39)。「♯101=52」は、WRITE命令であるので(S39:YES)、マクロ情報テーブル1327の♯101に対して、「52」が書き込まれる(S40)。さらに♯101がWRITE済みであることを設定するために、♯101の書き込みフラグに「1」が設定され(S41)、S32に戻る。   Next, the sequence number N02 is read (S32). Subsequently, the contents of the read NC data are analyzed (S33). Further, it is determined whether or not the analyzed content is a READ instruction for reading the value of the R / W macro variable (S34). The NC data of sequence number N02 is “# 101 = 52”. This is a WRITE instruction with the content “Write 50 to # 101.” Therefore, since it is not a READ instruction (S34: NO), it is subsequently determined whether or not it is a WRITE instruction for writing the value of the R / W macro variable (S39). Since “# 101 = 52” is a WRITE instruction (S39: YES), “52” is written into # 101 of the macro information table 1327 (S40). Further, in order to set that # 101 has been written, “1” is set to the write flag of # 101 (S41), and the process returns to S32.

次いで、シーケンス番号N03が読み込まれる(S32)。続いて、その読み込まれたNCデータの内容が解析される(S33)。さらにその解析された内容が、R/Wマクロ変数の値を読み込むREAD命令であるか否かが判断される(S34)。シーケンス番号N03のNCデータは、「♯102=[♯100+♯101/2]」である。これは、「♯102に[♯100+♯101/2]の値を書き込みなさい。」という内容のWRITE命令である。従って、READ命令ではないので、(S34:NO)、続いて、R/Wマクロ変数の値を書き込むWRITE命令であるか否かが判断される(S39)。「♯101=50」は、WRITE命令であるので(S39:YES)、マクロ情報テーブル1327の♯102に対して、「♯100+♯101/2」が書き込まれる(S40)。さらに♯102がWRITE済みであることを設定するために、♯102の書き込みフラグに「1」が設定され(S41)、S32に戻る。   Next, the sequence number N03 is read (S32). Subsequently, the contents of the read NC data are analyzed (S33). Further, it is determined whether or not the analyzed content is a READ instruction for reading the value of the R / W macro variable (S34). The NC data of sequence number N03 is “# 102 = [# 100 + # 101/2]”. This is a WRITE instruction with the content “Write a value of [# 100 + # 101/2] to # 102”. Therefore, since it is not a READ instruction (S34: NO), it is subsequently determined whether or not it is a WRITE instruction for writing the value of the R / W macro variable (S39). Since “# 101 = 50” is a WRITE instruction (S39: YES), “# 100 + # 101/2” is written into # 102 of the macro information table 1327 (S40). Further, in order to set that # 102 has been written, “1” is set to the write flag of # 102 (S41), and the process returns to S32.

次いで、シーケンス番号N04が上記同様に読み込まれて解析される(S32、S33)。なお、シーケンス番号N04は、「G90G0」であり、R/Wマクロ変数のREAD命令でも、WRITE命令でもないので(S34:NO、S39NO)、マクロ情報テーブル1327には何も設定されず、シーケンス番号N04のチェックが終了する。次いで、M30であるか否かが判断される(S42)。M30ではないので(S42:NO)、S32に戻る。   Next, the sequence number N04 is read and analyzed in the same manner as described above (S32, S33). Note that the sequence number N04 is “G90G0” and is not an R / W macro variable READ instruction or WRITE instruction (S34: NO, S39 NO), so nothing is set in the macro information table 1327, and the sequence number The check of N04 ends. Next, it is determined whether or not it is M30 (S42). Since it is not M30 (S42: NO), it returns to S32.

次いで、シーケンス番号N05が読み込まれる(S32)。続いて、その読み込まれたNCデータの内容が解析される(S33)。さらにその解析された内容が、R/Wマクロ変数の値を読み込むREAD命令であるか否かが判断される(S34)。シーケンス番号N05のNCデータは、「G0X[♯100]Y[♯101]」である。これは、「X[♯100]Y[♯101]に軸を位置決めしなさい。」という内容であって、♯100と♯101とを読み込むREAD命令である。従って、READ命令であるので、(S34:YES)、続いて、♯100と♯101とについて、既にWRITE済みであるか否かが判断される(S35)。ところが、図14に示すように、マクロ情報テーブル1327の♯100,♯101には、「50」、「52」が既に書き込まれており、何れも書込フラグ「1」が設定されている。従って、何れもWRITE済みであるので(S35:YES)、続いて、R/Wマクロ変数がWRITE命令であるか否かが判断される(S39)。ここでは、READ命令であるので(S39:NO)、次いで、M30であるか否かが判断される(S42)。M30ではないので(S42:NO)、S32に戻る。   Next, the sequence number N05 is read (S32). Subsequently, the contents of the read NC data are analyzed (S33). Further, it is determined whether or not the analyzed content is a READ instruction for reading the value of the R / W macro variable (S34). The NC data of sequence number N05 is “G0X [# 100] Y [# 101]”. This is a READ instruction that reads “# 100 and # 101” with the content “position the axis at X [# 100] Y [# 101]”. Therefore, since it is a READ instruction (S34: YES), it is subsequently determined whether or not WRITE has already been performed for # 100 and # 101 (S35). However, as shown in FIG. 14, “50” and “52” are already written in # 100 and # 101 of the macro information table 1327, and the write flag “1” is set for both. Accordingly, since all have been written (S35: YES), it is subsequently determined whether or not the R / W macro variable is a WRITE command (S39). Here, since it is a READ instruction (S39: NO), it is then determined whether or not it is M30 (S42). Since it is not M30 (S42: NO), it returns to S32.

次いで、シーケンス番号N06が読み込まれる(S32)。続いて、その読み込まれたNCデータの内容が解析される(S33)。さらにその解析された内容が、R/Wマクロ変数の値を読み込むREAD命令であるか否かが判断される(S34)。シーケンス番号N06のNCデータは、「G0Z[♯103]」である。これは、「Z[♯103]に軸を位置決めしなさい。」という内容である。従って、♯103を読み込むためのREAD命令であるので(S34:YES)、続いて、♯103について、既にWRITE済みであるか否かが判断される(S35)。ここで、図14に示すように、マクロ情報テーブル1327の♯103には値が書き込まれておらず、書込フラグ「0」が設定されているので、WRITE済みではない(S35:NO)。値が書き込まれていない♯103から値を読み込むことはできないので、R/Wマクロ変数の設定ミスである可能性が高い。   Next, the sequence number N06 is read (S32). Subsequently, the contents of the read NC data are analyzed (S33). Further, it is determined whether or not the analyzed content is a READ instruction for reading the value of the R / W macro variable (S34). The NC data of sequence number N06 is “G0Z [# 103]”. This is the content “position the axis to Z [# 103]”. Therefore, since it is a READ instruction for reading # 103 (S34: YES), it is subsequently determined whether # 103 has already been written (S35). Here, as shown in FIG. 14, since no value is written in # 103 of the macro information table 1327 and the write flag “0” is set, WRITE is not completed (S35: NO). Since a value cannot be read from # 103 to which no value has been written, there is a high possibility that an R / W macro variable setting error has occurred.

そこで、警告画面254に警告表示がされると共に、「♯103は、WRITEされていません。」とうメッセージが表示される(S36)。これによりユーザは現在チェック中であるシーケンス番号N06番において、♯103に設定ミスがあることがわかる。続いて、操作パネルの解除ボタン24が押下されて、警告が解除されたか否かが判断される(S37)。解除されない間は(S37:NO)、S36に戻って、警告画面254に警告が継続して表示される。ユーザは警告を無視してチェックを再開させるために、解除ボタン24を押下する。そして解除ボタン24が押下され、警告が解除された場合(S37:YES)、警告画面254に表示されていた内容が消去される(S38)。続いて、R/Wマクロ変数がWRITE命令であるか否かが判断される(S39)。ここでは、READ命令であるので(S39:NO、S42:NO)、S32に戻る。   Therefore, a warning message is displayed on the warning screen 254, and a message “# 103 is not written” is displayed (S36). As a result, the user knows that there is a setting error in # 103 in the sequence number N06 currently being checked. Subsequently, it is determined whether or not the warning is released by pressing the release button 24 on the operation panel (S37). While it is not canceled (S37: NO), the process returns to S36 and the warning is continuously displayed on the warning screen 254. The user presses the release button 24 to ignore the warning and restart the check. When the release button 24 is pressed and the warning is released (S37: YES), the contents displayed on the warning screen 254 are deleted (S38). Subsequently, it is determined whether or not the R / W macro variable is a WRITE instruction (S39). Here, since it is a READ instruction (S39: NO, S42: NO), the process returns to S32.

こうしてシーケンス番号N06以降において上記処理が繰り返され、最後のブロックが読み込まれ(S32)、内容が順次解析され(S33)、チェックが進行する。最後のブロックは、終了コードであるM30であるので(S34:NO、39:NO、S42:YES)、チェック対象であるNCプログラムを最後までチェックしたことになるので、マクロチェックが終了する。   In this way, the processing is repeated after sequence number N06, the last block is read (S32), the contents are sequentially analyzed (S33), and the check proceeds. Since the last block is M30 which is an end code (S34: NO, 39: NO, S42: YES), the NC program to be checked has been checked to the end, so the macro check ends.

なお、♯103の設定が間違いでないケースとして、♯103を操作パネルで設定している場合や、シーケンス番号N11のように運転すると、♯110が1加算されるようにカウンタとして使用している場合等がある。   As a case where setting of # 103 is not mistaken, when # 103 is set on the operation panel, or when it is operated as sequence number N11, # 110 is used as a counter so that 1 is added. Etc.

以上説明したように、数値制御装置1の変形例では、R/Wマクロ変数が読み込まれる際に、そのR/Wマクロ変数に既に値が書き込まれているか否かのマクロチェックを行うことができる。不揮発メモリ13には、マクロ情報テーブル1327が記憶されている。マクロ情報テーブル1327には、NCプログラム中に設定された複数のR/Wマクロ変数が記憶されている。これらR/Wマクロ変数には、NCプログラムを実行する過程において、各種設定値が各々書き込まれる。さらにこれらR/Wマクロ変数には、値が書き込み済みであることを記憶するための書込フラグが設定される。従って、NCプログラムを読み込む際に、あるR/Wマクロ変数のREAD命令があった場合に、そのR/Wマクロ変数の書込フラグが設定されていない場合は、値が書き込まれていないので、R/Wマクロ変数の設定ミスである可能性が高い。この場合、警告画面254に警告表示されるので、ユーザはそのR/Wマクロ変数について設定ミスがあることを容易かつ速やかに認識できる。   As described above, in the modification of the numerical controller 1, when an R / W macro variable is read, a macro check can be performed to determine whether or not a value has already been written to the R / W macro variable. . The nonvolatile memory 13 stores a macro information table 1327. The macro information table 1327 stores a plurality of R / W macro variables set in the NC program. Various setting values are written in these R / W macro variables in the course of executing the NC program. Further, a write flag for storing that the value has been written is set in these R / W macro variables. Therefore, when an NC program is read and there is a READ instruction for a certain R / W macro variable, if the write flag for that R / W macro variable is not set, the value is not written. There is a high possibility of an R / W macro variable setting error. In this case, since a warning is displayed on the warning screen 254, the user can easily and quickly recognize that there is a setting error for the R / W macro variable.

なお、上記実施形態及び変形例において、モーダルチェックプログラム、マクロチェックプログラムを記憶する記録媒体としては、ROM、RAM等の素子の他、種々の形態が考えられる。例えば、CD−ROM、フロッピー(登録商標)等でもよく、カードスロットへ挿入可能なプログラムカートリッジ等でもよく、インターネット上のファイルサーバであってもよい。   In the above-described embodiments and modifications, the recording medium for storing the modal check program and the macro check program may take various forms in addition to elements such as ROM and RAM. For example, it may be a CD-ROM, floppy (registered trademark), a program cartridge that can be inserted into a card slot, or a file server on the Internet.

本発明の数値制御装置は、NCプログラム中にモーダル命令を設定して工作機械を制御する数値制御装置に適用可能である。   The numerical control device of the present invention can be applied to a numerical control device that controls a machine tool by setting a modal command in an NC program.

数値制御装置1の電気的構成を示すブロック図である。2 is a block diagram showing an electrical configuration of the numerical control device 1. FIG. ROM11の概念図である。2 is a conceptual diagram of a ROM 11. FIG. 不揮発メモリ13の概念図である。3 is a conceptual diagram of a nonvolatile memory 13. FIG. 第1モーダル情報テーブル1321の概念図である。It is a conceptual diagram of the 1st modal information table 1321. 第2モーダル情報テーブル1322の概念図である。It is a key map of the 2nd modal information table 1322. 第3モーダル情報テーブル1323の概念図である。It is a conceptual diagram of the 3rd modal information table 1323. 第4モーダル情報テーブル1324の概念図である。It is a key map of the 4th modal information table 1324. 工具交換情報テーブル1325の概念図である。It is a conceptual diagram of the tool exchange information table 1325. 主軸回転情報テーブル1326の概念図である。FIG. 10 is a conceptual diagram of a spindle rotation information table 1326. ディスプレイ25に表示されたチェック画面251と、警告画面252とを示す概念図である。4 is a conceptual diagram showing a check screen 251 and a warning screen 252 displayed on the display 25. FIG. CPU10によるモーダルチェックのフローチャートである。It is a flowchart of the modal check by CPU10. 図11の続きのフローチャートである。FIG. 12 is a flowchart continued from FIG. 11. 図11の続きのフローチャートである。FIG. 12 is a flowchart continued from FIG. 11. マクロ情報テーブル1327の概念図である。4 is a conceptual diagram of a macro information table 1327. FIG. ディスプレイ25に表示されたチェック画面253と、警告画面254とを示す概念図である。4 is a conceptual diagram showing a check screen 253 and a warning screen 254 displayed on the display 25. FIG. CPU10によるマクロチェックのフローチャートである。It is a flowchart of the macro check by CPU10.

符号の説明Explanation of symbols

1 数値制御装置
10 CPU
11 ROM
13 不揮発メモリ
25 ディスプレイ
30 工作機械
112 モーダルチェックプログラム記憶領域
132 情報テーブル記憶領域
1321 第1モーダル情報テーブル
1322 第2モーダル情報テーブル
1323 第3モーダル情報テーブル
1324 第4モーダル情報テーブル
1 Numerical control device 10 CPU
11 ROM
13 Nonvolatile Memory 25 Display 30 Machine Tool 112 Modal Check Program Storage Area 132 Information Table Storage Area 1321 First Modal Information Table 1322 Second Modal Information Table 1323 Third Modal Information Table 1324 Fourth Modal Information Table

Claims (7)

NCデータでブロック毎に記述されたNCプログラムに基づいて、工作機械を制御する数値制御装置において、
前記NCデータをブロック毎に読み込む読込手段と、
当該読込手段に読み込まれた前記NCデータの内容を解析する解析手段と、
前記工作機械の動作命令に関連するモーダル命令の候補を予め記憶するモーダル候補記憶手段と、
前記解析手段によって解析されたブロックに、前記モーダル命令が設定されているか否かを判断するモーダル判断手段と、
当該モーダル判断手段によって、前記モーダル命令が設定されていると判断された場合に、前記モーダル命令が設定されたことを記憶するモーダル設定記憶手段と、
前記解析手段によって解析された内容が、前記動作命令であった場合に、前記モーダル候補記憶手段において、前記モーダル設定記憶手段に記憶された設定に基づき、前記動作命令に関連する前記モーダル命令の候補の全てが設定されているか否かを判断するモーダル設定判断手段と、
当該モーダル設定判断手段によって、前記動作命令に関連する前記モーダル命令の候補のうち少なくとも何れかが設定されていないと判断された場合に報知する報知手段と
を備えたことを特徴とする数値制御装置。
In a numerical control device for controlling a machine tool based on an NC program described for each block in NC data,
Reading means for reading the NC data for each block;
Analyzing means for analyzing the contents of the NC data read by the reading means;
Modal candidate storage means for storing in advance modal command candidates related to the operation command of the machine tool;
Modal judging means for judging whether or not the modal instruction is set in the block analyzed by the analyzing means;
A modal setting storage means for storing that the modal instruction is set when the modal determination means determines that the modal instruction is set;
When the content analyzed by the analyzing means is the operation command, the modal candidate storage unit is configured to store the modal instruction candidate related to the operation command based on the setting stored in the modal setting storage unit. Modal setting determination means for determining whether or not all of are set,
A numerical control apparatus comprising: notifying means for notifying when it is determined by the modal setting determining means that at least one of the modal instruction candidates related to the operation instruction is not set. .
前記モーダル設定判断手段によって、前記動作命令に関連する前記モーダル命令の候補の全てが、前記モーダル設定手段によって設定されていると判断された場合、又は前記報知手段によって報知された場合に、前記モーダル設定手段による設定を解除する設定解除手段を備えたことを特徴とする請求項1に記載の数値制御装置。   When it is determined by the modal setting determining means that all of the modal command candidates related to the operation command are set by the modal setting means, or when notified by the notifying means, the modal The numerical control apparatus according to claim 1, further comprising setting cancellation means for canceling the setting by the setting means. 前記報知手段は、前記動作命令に関連する前記モーダル命令の候補のうち、前記モーダル設定手段によって設定されていない前記モーダル命令を表示する表示装置であることを特徴とする請求項1又は2に記載の数値制御装置。   The said notification means is a display apparatus which displays the said modal command which is not set by the said modal setting means among the candidates of the said modal command relevant to the said operation command. Numerical control unit. 前記モーダル候補記憶手段は、複数の前記動作命令毎に、前記モーダル命令の候補を記憶していることを特徴とする請求項1乃至3の何れかに記載の数値制御装置。   The numerical control device according to claim 1, wherein the modal candidate storage unit stores a candidate for the modal instruction for each of the plurality of operation instructions. 前記動作命令は、軸移動、補間移動、円弧補間、固定サイクルのうち少なくとも何れかに関連する命令であることを特徴とする請求項1乃至4の何れかに記載の数値制御装置。   The numerical control device according to claim 1, wherein the operation command is a command related to at least one of axis movement, interpolation movement, circular interpolation, and fixed cycle. 工作機械の数値制御を行う数値制御装置を機能させる制御プログラムであって、
NCデータをブロック毎に読み込む第1ステップと、
当該第1ステップで読み込んだ前記NCデータの内容を解析する第2ステップと、
当該第2ステップで解析されたブロックに、モーダル命令が設定されているか否かを判断する第3ステップと、
当該第3ステップで、前記モーダル命令が設定されていると判断した場合に、前記モーダル命令が設定されたことをモーダル設定記憶手段に記憶する第4ステップと、
前記第2ステップで解析された内容が、前記工作機械の動作命令であった場合に、前記動作命令に関連するモーダル命令の候補を予め記憶するモーダル候補記憶手段において、前記モーダル設定記憶手段に記憶された設定に基づき、前記動作命令に関連する前記モーダル命令の候補の全てが設定されているか否かを判断する第5ステップと、
当該第5ステップで、前記動作命令に関連する前記モーダル命令の候補のうち何れかが設定されていないと判断された場合に報知する第6ステップと
からなることを特徴とする制御プログラム。
A control program for functioning a numerical control device that performs numerical control of a machine tool,
A first step of reading NC data for each block;
A second step of analyzing the contents of the NC data read in the first step;
A third step of determining whether a modal instruction is set in the block analyzed in the second step;
A fourth step of storing in the modal setting storage means that the modal instruction is set when it is determined in the third step that the modal instruction is set;
When the content analyzed in the second step is an operation command of the machine tool, a modal candidate storage unit that stores in advance a modal command candidate related to the operation command is stored in the modal setting storage unit. A fifth step of determining whether all of the candidates for the modal instruction related to the operation instruction are set based on the set setting;
A control program comprising: a sixth step for notifying in the fifth step that any one of the candidates for the modal command related to the operation command is not set.
請求項6に記載の制御プログラムを記録したことを特徴とする記録媒体。   A recording medium in which the control program according to claim 6 is recorded.
JP2007248311A 2007-09-26 2007-09-26 Numerical control device, control program, and recording medium Pending JP2009080591A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007248311A JP2009080591A (en) 2007-09-26 2007-09-26 Numerical control device, control program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007248311A JP2009080591A (en) 2007-09-26 2007-09-26 Numerical control device, control program, and recording medium

Publications (1)

Publication Number Publication Date
JP2009080591A true JP2009080591A (en) 2009-04-16

Family

ID=40655307

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007248311A Pending JP2009080591A (en) 2007-09-26 2007-09-26 Numerical control device, control program, and recording medium

Country Status (1)

Country Link
JP (1) JP2009080591A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104808585A (en) * 2015-04-13 2015-07-29 华中科技大学 Machine tool health state rapid checking method
CN105974886A (en) * 2016-06-28 2016-09-28 华中科技大学 Health monitoring method for numerical control machine tool
JP7000302B2 (en) 2018-12-14 2022-01-19 ファナック株式会社 Information processing equipment
WO2023084597A1 (en) * 2021-11-09 2023-05-19 ファナック株式会社 Numerical control device and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104808585A (en) * 2015-04-13 2015-07-29 华中科技大学 Machine tool health state rapid checking method
CN105974886A (en) * 2016-06-28 2016-09-28 华中科技大学 Health monitoring method for numerical control machine tool
JP7000302B2 (en) 2018-12-14 2022-01-19 ファナック株式会社 Information processing equipment
US11353844B2 (en) 2018-12-14 2022-06-07 Fanuc Corporation Information processing apparatus
WO2023084597A1 (en) * 2021-11-09 2023-05-19 ファナック株式会社 Numerical control device and storage medium

Similar Documents

Publication Publication Date Title
US5315523A (en) Numerical control apparatus having a work simulation function
KR860002004B1 (en) The processing method for numerical control
JP6538771B2 (en) Numerical control device and control method of numerical control device
JP2009080591A (en) Numerical control device, control program, and recording medium
US10437229B2 (en) Numerical controller
US6970764B2 (en) Machining program producing apparatus
JP2010015359A (en) Numerical controller with tabular data for operating arbitrary axis
JP2008234319A (en) Numerical controller capable of executing g-code command in path table operation
JP2009223615A (en) Numerical controller with machining restart function
JP6638979B2 (en) Numerical control device with machining process management function and machining process management program
US6829518B2 (en) Numerical control apparatus
JP2010044489A (en) Numerical controller with machining resumption function
JP7448377B2 (en) Processing program management device, management system, and management method
EP1724650A1 (en) Sequence program editing apparatus
JP2006227894A (en) Cut resumption method, cutting system and cutting controller
JP4654937B2 (en) Numerical control apparatus, numerical control method, and computer program
JP2004252844A (en) Numerical controller
JP2009080621A (en) Numerical control device, numerical control program and storage medium which stores numerical control program,
JPH1011120A (en) Multi-system numeric controller with inter-system axis replacement control function
WO2023084597A1 (en) Numerical control device and storage medium
JP4312047B2 (en) Machine tool controller
JP2009110223A (en) Numerical control device, numerical control program, and storage medium storing numerical control program
WO1991000557A1 (en) Nc data execution method
JP6863947B2 (en) Machining program display device
WO2024042604A1 (en) Auxiliary information setting assistance device