JP4882666B2 - Numerical controller - Google Patents

Numerical controller Download PDF

Info

Publication number
JP4882666B2
JP4882666B2 JP2006292733A JP2006292733A JP4882666B2 JP 4882666 B2 JP4882666 B2 JP 4882666B2 JP 2006292733 A JP2006292733 A JP 2006292733A JP 2006292733 A JP2006292733 A JP 2006292733A JP 4882666 B2 JP4882666 B2 JP 4882666B2
Authority
JP
Japan
Prior art keywords
program
capacity
buffer
pallet
transferred
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.)
Active
Application number
JP2006292733A
Other languages
Japanese (ja)
Other versions
JP2008108205A (en
Inventor
武志 入江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2006292733A priority Critical patent/JP4882666B2/en
Publication of JP2008108205A publication Critical patent/JP2008108205A/en
Application granted granted Critical
Publication of JP4882666B2 publication Critical patent/JP4882666B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Numerical Control (AREA)

Description

本発明は、運転するNCプログラムをハードディスク等の記憶装置から運転バッファに転送して加工運転を実行するように構成された数値制御装置に関する。   The present invention relates to a numerical controller configured to execute a machining operation by transferring an operating NC program from a storage device such as a hard disk to an operation buffer.

近年の数値制御装置においては、ハードディスク等の記憶装置を備え、これに多数のNCプログラムを記憶させている。しかし、ハードディスクにアクセスしてNCプログラムを実行する方式では、アクセスに要する時間が長くなり、時間的なロスの発生が大きい。そこで、ハードディスクへのアクセスをできるだけ少なくする対策が考えられており、その対策の1つの方式として、運転の実行時には、高速にアクセス可能なRAM(以下、運転バッファと称す)に実行するNCプログラムをすべて転送し、該運転バッファからNCプログラムをブロック(1つの制御命令)単位毎に読み出して、工作機械及び周辺装置を制御するようにしている。このような運転方式を、「内部メモリ運転」と呼んでいる。   In recent numerical control devices, a storage device such as a hard disk is provided, and a number of NC programs are stored in the storage device. However, in the system in which the NC program is executed by accessing the hard disk, the time required for access becomes long, and time loss is large. Therefore, measures to minimize access to the hard disk have been considered. As one of the measures, an NC program to be executed in a RAM (hereinafter referred to as an operation buffer) that can be accessed at high speed during operation is provided. All are transferred, and the NC program is read from the operation buffer for each block (one control command) to control the machine tool and peripheral devices. Such an operation method is called “internal memory operation”.

また、NCプログラムのサイズが運転バッファよりも大きい場合には、運転バッファをリングバッファのように使用し、予め先頭から可能な限りNCプログラムを転送しておき、運転が進行するにつれ、運転が終了したプログラム部分を消去し、転送できなかった部分のプログラム部分を順次書き込んで(転送して)いくような方式が実現されている。このような運転方式を、「テープ運転」と呼んでいる。このように呼ぶ理由は、かって、紙テープに記憶されたNCプログラムを、数値制御装置に通信を介して入力させながら運転した際に、現在のような大容量のRAMがなかったため、同様の運転方式を採用していたためである。尚、上記した2つの運転方式は、例えば特許文献1に記載されている。
特開平8−249040号公報
Also, if the NC program size is larger than the operation buffer, use the operation buffer like a ring buffer, transfer the NC program as much as possible from the beginning, and the operation will end as the operation proceeds A method has been realized in which the program part is erased and the program part of the part that could not be transferred is sequentially written (transferred). Such an operation method is called “tape operation”. The reason why it is called in this way is that when there is no large-capacity RAM like the present when the NC program stored in the paper tape is operated while being input to the numerical controller via communication, the same operation method is used. This is because of adopting The above two operation methods are described in, for example, Patent Document 1.
JP-A-8-249040

上記した内部メモリ運転においては、予めNCプログラムを運転バッファに転送する際、そのNCプログラムを解析し、運転するプログラム(親プログラム)から呼び出されるサブプログラム(子プログラム)や、サブプログラム(子プログラム)から呼び出されるさらなるサブプログラム(孫プログラム)などをすべて予め運転バッファに転送する。更に、それら個々のNCプログラム(親、子、孫プログラム)の運転バッファ上の先頭番地などを、RAM上に設けたプログラム管理データに記憶させる。これにより、NCプログラム上に、サブプログラムへのサブルーチン呼び出しがあっても、呼び出し先は、運転バッファ内に存在しており、しかも、飛び先の番地もプログラム管理データを参照することにより、時間的遅延なく、次の読み込み番地を決定できる。   In the above-mentioned internal memory operation, when the NC program is transferred to the operation buffer in advance, the NC program is analyzed and the subprogram (child program) called from the operating program (parent program) or subprogram (child program) All further subprograms (grandchild programs) called from are transferred to the operation buffer in advance. Further, the head address on the operation buffer of each of the NC programs (parent, child, grandchild program) is stored in the program management data provided on the RAM. As a result, even if there is a subroutine call to the sub program on the NC program, the call destination exists in the operation buffer, and the jump destination address is also temporally referenced by referring to the program management data. The next reading address can be determined without delay.

しかし、解析した結果、即ち、呼び出されるサブプログラムを含めたNCプログラムの総容量が運転バッファを超えている場合には、運転中に運転バッファの全部ないし一部を、テープ運転のように、消去、上書きしながら、運転を実行するようにしている。この場合には、運転中に少なからずハードディスクへアクセスを行なう必要がある。   However, as a result of analysis, that is, when the total capacity of the NC program including the called subprogram exceeds the operation buffer, all or part of the operation buffer is erased during operation as in tape operation. The operation is executed while overwriting. In this case, it is necessary to access the hard disk during operation.

このため、運転バッファ、即ち、RAMの容量を大容量化して、可能な限り内部メモリ運転を実行できるようにしている。
しかし、運転バッファを大容量化すると、サブプログラム等の解析処理や運転バッファへの転送処理に要する時間がかなり長くなるという問題点が発生してきている。特に、運転するNCプログラムが頻繁に変わるような場合には、運転するNCプログラムを切り替えるときに、かなり長い時間がかかり、時間のロスが大きくなるという問題点が発生している。
For this reason, the capacity of the operation buffer, that is, the RAM is increased so that the internal memory operation can be executed as much as possible.
However, when the capacity of the operation buffer is increased, there is a problem that the time required for the analysis processing of the subprogram and the transfer processing to the operation buffer becomes considerably long. In particular, when the operating NC program changes frequently, there is a problem in that it takes a considerably long time to switch the operating NC program, resulting in a large time loss.

尚、運転するNCプログラムが頻繁に変わるような場合としては、例えば、回転テーブル機において、両側パレットのNCプログラムが異なるときに、両方のNCプログラムを足したサイズが運転バッファを超えている場合があり、この場合、運転開始時(パレット旋回時)に、毎回、運転するNCプログラムを運転バッファに転送(ロード)していた。また、鍵の生産等の加工作業で、1回1回の加工内容が異なる場合も、NCプログラムの選択が外部プログラム選択を使用し、起動時に運転するNCプログラムを運転バッファに転送していた。上述した2つの加工作業の場合、NCプログラムの転送にかなりの時間がかかっていた。   In addition, as a case where the NC program to be operated frequently changes, for example, in a rotary table machine, when the NC programs of both pallets are different, the size obtained by adding both NC programs may exceed the operation buffer. In this case, the NC program to be operated is transferred (loaded) to the operation buffer every time the operation is started (when the pallet is turned). In addition, even when machining contents such as key production differ in one machining operation, the NC program selection uses the external program selection, and the NC program that is operated at the time of activation is transferred to the operation buffer. In the case of the two machining operations described above, it took a considerable time to transfer the NC program.

そこで、本発明の目的は、運転するNCプログラムを切り替えるときに、NCプログラムを運転バッファに転送する際に要する時間を短縮することができる数値制御装置を提供することにある。   Therefore, an object of the present invention is to provide a numerical control device that can reduce the time required to transfer an NC program to an operation buffer when switching the NC program to be operated.

本発明の数値制御装置は、工作機械で運転するNCプログラムをハードディスク等の記憶装置から運転バッファに転送して加工運転を実行するように構成されたものにおいて、次に運転するNCプログラム番号を入力する入力手段と、前記入力手段によってNCプログラム番号の入力が完了したことを検出する完了信号検出手段と、前記運転バッファの空き容量を算出する空き容量算出手段と、前記完了信号検出手段によって次に運転するNCプログラム番号の入力の完了を検出したときに、現在実行中の加工と並列動作で、次に運転するNCプログラムの容量を算出するプログラム容量算出手段と、前記空き容量算出手段によって算出される前記運転バッファの空き容量よりも、前記プログラム容量算出手段によって算出されるNCプログラムの容量が大きい場合に、該NCプログラムの先頭から前記運転バッファの空き容量分、該運転バッファに転送する第1転送手段と、前記転送手段によって転送されたNCプログラムの最後のアドレスまたは転送されなかった最初のアドレスを記憶するアドレス記憶手段と、現在実行中のNCプログラムの運転が終了したときに、次に運転するNCプログラムを前記アドレス記憶手段に記憶されたアドレスに基づいて前記運転バッファに転送する第2転送手段とを備えたところに特徴を有する。   The numerical control device of the present invention is configured to execute a machining operation by transferring an NC program operated by a machine tool from a storage device such as a hard disk to an operation buffer, and inputs an NC program number to be operated next. The input means, a completion signal detection means for detecting that the input of the NC program number has been completed by the input means, a free capacity calculation means for calculating the free capacity of the operation buffer, and the completion signal detection means. When the completion of the input of the NC program number to be operated is detected, it is calculated by the program capacity calculating means for calculating the capacity of the NC program to be operated next in parallel with the machining currently being executed, and the free capacity calculating means. NC program calculated by the program capacity calculation means rather than the free capacity of the operation buffer When the capacity of the NC program is large, the first transfer means for transferring the empty capacity of the operation buffer from the beginning of the NC program to the operation buffer and the last address of the NC program transferred by the transfer means or the transfer The address storage means for storing the first address that did not exist, and the NC program to be operated next when the operation of the NC program currently being executed ends in the operation buffer based on the address stored in the address storage means. It is characterized in that it is provided with a second transfer means for transferring.

また、上記構成の場合、前記NCプログラムは、メインプログラムとメインプログラムから呼び出されるサブプログラムとから構成されるものであって、前記プログラム容量算出手段は、前記メインプログラムの容量と前記サブプログラムの容量との総和を算出するように構成されていることが好ましい。   Further, in the case of the above configuration, the NC program is composed of a main program and a subprogram called from the main program, and the program capacity calculation means is configured such that the capacity of the main program and the capacity of the subprogram It is preferable that the sum is calculated.

更に、前記NCプログラムのプログラム番号とサブプログラム番号とを記憶する記憶手段と、前記第1転送手段によってNCプログラムを運転バッファに転送する際、前記サブプログラムのプログラム番号と、該サブプログラム番号の先頭アドレスを対応付けたプログラム管理データを前記記憶手段に記憶させるプログラム管理データ作成手段とを備えることがより一層好ましい構成である。   Furthermore, when the NC program is transferred to the operation buffer by the first transfer means, the storage means for storing the program number and the subprogram number of the NC program, and the head of the subprogram number It is a more preferable configuration that includes program management data creating means for storing program management data associated with an address in the storage means.

本発明の他の数値制御装置は、運転するNCプログラムをハードディスク等の記憶装置から運転バッファに転送して加工運転を実行するように構成されると共に、パレットの旋回動作と工具交換動作を並列動作で実行するように構成されたものにおいて、次パレットのNCプログラム番号を入力する入力手段と、前記入力手段によってNCプログラム番号の入力が完了したことを検出する完了信号検出手段と、前記運転バッファの空き容量を算出する空き容量算出手段と、前記完了信号検出手段によって次に運転するNCプログラム番号の入力の完了を検出したときに、現在実行中の加工パレットの加工と並列動作で、次に運転するNCプログラムの容量を算出するプログラム容量算出手段と、前記空き容量算出手段によって算出される前記運転バッファの空き容量よりも、前記プログラム容量算出手段によって算出されるNCプログラムの容量が大きい場合に、該NCプログラムの先頭から前記運転バッファの空き容量分、該運転バッファに転送する第1転送手段と、前記転送手段によって転送されたNCプログラムの最後のアドレスまたは転送されなかった最初のアドレスを記憶するアドレス記憶手段と、最初の工具交換動作に対応するNCプログラムが転送されたか否かを判断する転送判断手段と、最初の工具交換動作に対応するNCプログラムが転送されている場合には、現在の加工パレットの加工が終了したときに、パレットの旋回動作と最初の工具交換動作を並列動作で実行する実行手段と、現在の加工パレットの加工が終了したときに、最初の工具交換動作に対応するNCプログラムが転送されている場合には、パレットの旋回動作並びに最初の工具交換動作と並列動作で、次に運転するNCプログラムを前記アドレス記憶手段に記憶されたアドレスに基づいて前記運転バッファに転送する第2転送手段とを備えたところに特徴を有する。   Another numerical control device according to the present invention is configured to execute a machining operation by transferring an NC program to be operated from a storage device such as a hard disk to an operation buffer, and performs a pallet turning operation and a tool changing operation in parallel. The input means for inputting the NC program number of the next pallet, the completion signal detecting means for detecting the completion of the input of the NC program number by the input means, the operation buffer When the completion of the input of the NC program number to be operated next is detected by the free capacity calculating means for calculating the free capacity and the completion signal detecting means, the next operation is performed in parallel with the processing of the machining pallet currently being executed. Program capacity calculating means for calculating the capacity of the NC program to be performed, and the free capacity calculating means When the capacity of the NC program calculated by the program capacity calculation means is larger than the free capacity of the transfer buffer, first transfer means for transferring the free capacity of the operation buffer from the head of the NC program to the operation buffer And determining whether or not the address storage means for storing the last address of the NC program transferred by the transfer means or the first address not transferred and the NC program corresponding to the first tool change operation have been transferred. When the transfer judgment means and the NC program corresponding to the first tool change operation have been transferred, the pallet turning operation and the first tool change operation can be performed in parallel when the machining of the current machining pallet is completed. Execution means to be executed and when the current machining pallet has been machined, it corresponds to the first tool change operation. When the NC program is transferred, the NC program to be operated next is transferred to the operation buffer based on the address stored in the address storage means in parallel operation with the pallet turning operation and the first tool change operation. And a second transfer means.

本発明は、完了信号検出手段によって次に運転するNCプログラム番号の入力の完了を検出したときに、プログラム容量算出手段により、現在実行中の加工と並列動作で、次に運転するNCプログラムの容量を算出し、空き容量算出手段によって算出される運転バッファの空き容量よりも、プログラム容量算出手段によって算出されるNCプログラムの容量が大きい場合に、第1転送手段により、該NCプログラムの先頭から前記運転バッファの空き容量分、該運転バッファに転送するように構成したので、運転するNCプログラムを切り替えるときに、NCプログラムを運転バッファに転送する際に要する時間を短縮することができるという効果を奏する。   In the present invention, when the completion of the input of the NC program number to be operated next is detected by the completion signal detecting means, the capacity of the NC program to be operated next is executed by the program capacity calculating means in parallel operation with the machining currently being executed. When the capacity of the NC program calculated by the program capacity calculation means is larger than the free capacity of the operation buffer calculated by the free capacity calculation means, the first transfer means starts from the head of the NC program. Since it is configured to transfer to the operation buffer for the free capacity of the operation buffer, when switching the NC program to be operated, the time required to transfer the NC program to the operation buffer can be shortened. .

以下、本発明の一実施例である数値制御装置について、図面を参照しながら説明する。本実施例の数値制御装置(NC装置)1は、図2に示す工作機械2に接続されて、該工作機械2を数値制御するものである。この工作機械2は、パレットに取り付けられたワークを主軸3に取り付けられたドリルやタップ等の工具4で加工するものである。   Hereinafter, a numerical control apparatus according to an embodiment of the present invention will be described with reference to the drawings. A numerical control device (NC device) 1 according to this embodiment is connected to a machine tool 2 shown in FIG. 2 and numerically controls the machine tool 2. The machine tool 2 processes a workpiece attached to a pallet with a tool 4 such as a drill or a tap attached to a main shaft 3.

上記工作機械2は、XY軸移動装置5,Z軸移動装置6,主軸回転装置7,工具交換装置8,パレット交換装置9等から構成されている。XY軸移動装置5は、X軸モータ10とY軸モータ11とをそれぞれ駆動源とし、工具4をワークに対して主軸の方向(以下、Z軸方向という。図2中において、上下方向と一致する)に直角なX軸方向とY軸方向とにそれぞれ相対的に移動させる。Z軸移動装置6は、Z軸モータ12を駆動源とし、工具4をワークに対してZ軸方向に相対的に移動させる。   The machine tool 2 includes an XY axis moving device 5, a Z axis moving device 6, a spindle rotating device 7, a tool changing device 8, a pallet changing device 9, and the like. The XY-axis moving device 5 uses the X-axis motor 10 and the Y-axis motor 11 as drive sources, respectively, and the tool 4 is in the direction of the main axis with respect to the workpiece (hereinafter referred to as the Z-axis direction. Are relatively moved in the X-axis direction and the Y-axis direction perpendicular to each other. The Z-axis moving device 6 uses the Z-axis motor 12 as a drive source and moves the tool 4 relative to the workpiece in the Z-axis direction.

主軸回転装置7は、主軸モータ13を駆動源として主軸3を回転させ、これにより工具4を回転させる。工具交換装置8は、マガジンモータ14により旋回させられる工具マガジン15を有し、多数の工具4を工具マガジン15の複数の工具ポットにおいて着脱自在に収納保持し、それら工具4の一つを主軸3に装着するための工具交換可能な位置への割出しを行う。更に、工具交換装置8は、主軸3から工具4を外して工具マガジン15に戻した後、上記割り出された工具4を主軸3に装着する。   The main spindle rotating device 7 rotates the main spindle 3 by using the main spindle motor 13 as a drive source, and thereby rotates the tool 4. The tool changer 8 includes a tool magazine 15 that is rotated by a magazine motor 14, and stores and holds a large number of tools 4 in a plurality of tool pots of the tool magazine 15, and one of the tools 4 is held in the spindle 3. The tool is indexed to the position where the tool can be changed. Further, the tool changer 8 removes the tool 4 from the spindle 3 and returns it to the tool magazine 15, and then attaches the indexed tool 4 to the spindle 3.

パレット交換装置9は、パレット交換モータ(以下、単にC軸モータという)16を駆動源として水平なテーブル17をZ軸に平行な軸線の回りに間欠的に回転させるものであり、テーブル17を180度ずつ回転させることにより、そのテーブル17の、回転軸線に関して対称な2部分のうち図2において左側の部分である第1パレット(加工パレット)18と右側の部分である第2パレット(加工パレット)19とのそれぞれの位置を交互に交換するものである。   The pallet exchanging device 9 rotates a horizontal table 17 intermittently around an axis parallel to the Z axis by using a pallet exchanging motor (hereinafter simply referred to as a C-axis motor) 16 as a drive source. By rotating the table 17 at a time, the first pallet (processing pallet) 18 which is the left part in FIG. 2 and the second pallet (processing pallet) which is the right part of FIG. Each position with 19 is exchanged alternately.

図2に示す状態の場合、第1パレット18は、作業者により開閉可能な扉20を経て作業者によるワークの着脱が行われる着脱位置にあり(以降、着脱位置にあるパレットを、外側パレットと称す)、第2パレット19は、工具4によるワークの加工が行われる加工位置にある(以降、加工位置にあるパレットを、内側パレットと称す)。この状態で、テーブル17が180度だけ回転させられることにより、第1パレット18は加工位置に、第2パレット19は着脱位置にそれぞれ移動させられることになる。   In the state shown in FIG. 2, the first pallet 18 is in an attachment / detachment position where the worker attaches / detaches the workpiece via the door 20 that can be opened and closed by the operator (hereinafter, the pallet in the attachment / detachment position is referred to as an outer pallet). The second pallet 19 is at a processing position where the workpiece is processed by the tool 4 (hereinafter, the pallet at the processing position is referred to as an inner pallet). In this state, when the table 17 is rotated by 180 degrees, the first pallet 18 is moved to the machining position and the second pallet 19 is moved to the attachment / detachment position.

上記構成の場合、パレット交換装置9をワーク交換装置と称しても良く、また、工作機械2のうちのパレット交換装置9を除く部分をワーク加工装置と称しても良い。
さて、数値制御装置1は、図2に示すように、工作機械2の後部に取り付けられている。この数値制御装置1について、図1に示すブロック図を参照して説明する。数値制御装置1は、コンピュータを主体として構成されており、図1に示すように、複数のCPU、即ち、第1のCPU21と第2のCPU22を備えている。
In the case of the above configuration, the pallet exchanging device 9 may be referred to as a work exchanging device, and a portion of the machine tool 2 excluding the pallet exchanging device 9 may be referred to as a work processing device.
Now, the numerical controller 1 is attached to the rear part of the machine tool 2 as shown in FIG. The numerical controller 1 will be described with reference to the block diagram shown in FIG. The numerical control apparatus 1 is mainly configured by a computer, and includes a plurality of CPUs, that is, a first CPU 21 and a second CPU 22, as shown in FIG.

第1のCPU21は、数値制御のNCプログラムを管理する制御を実行するものであり、この第1のCPU21には、RAM23と、不揮発メモリ24と、RAM25と、リムーバブルディスク26とが接続されている。RAM23には、一時的な演算の中間データを保持(記憶)させる。不揮発メモリ24は、フラッシュメモリ等で構成された記憶装置であり、これには、第1のCPU21の制御プログラム(制御コード)と大量のNCプログラムを記憶(保有)させている。   The first CPU 21 executes control for managing numerically controlled NC programs, and a RAM 23, a nonvolatile memory 24, a RAM 25, and a removable disk 26 are connected to the first CPU 21. . The RAM 23 holds (stores) intermediate data for temporary calculations. The nonvolatile memory 24 is a storage device configured by a flash memory or the like, and stores (holds) a control program (control code) of the first CPU 21 and a large number of NC programs.

リムーバブルディスク26は、着脱可能なハードディスクであり、記憶装置を構成しており、これには、ユーザーが新たに作成した大量のNCプログラムを記憶させておくことができる。第1のCPU21の転送処理によって、リムーバブルディスク26内のユーザーのNCプログラムを不揮発メモリ24へ転送する。   The removable disk 26 is a detachable hard disk and constitutes a storage device, which can store a large amount of NC programs newly created by the user. The user's NC program in the removable disk 26 is transferred to the nonvolatile memory 24 by the transfer process of the first CPU 21.

また、RAM25は、第1のCPU21と第2のCPU22との双方からリード・ライト可能なRAMであり、このRAM25は、第1のCPU21と第2のCPU22のデータのやり取りに使用される。特に、上記RAM25内には、運転するNCプログラムを転送して記憶させておく領域、即ち、運転バッファの領域が確保されている。上記RAM25が、記憶手段及びアドレス記憶手段を構成している。   The RAM 25 is a readable / writable RAM from both the first CPU 21 and the second CPU 22, and the RAM 25 is used for data exchange between the first CPU 21 and the second CPU 22. In particular, in the RAM 25, an area for transferring and storing the NC program to be operated, that is, an area for an operation buffer is secured. The RAM 25 constitutes storage means and address storage means.

第1のCPU21は、不揮発メモリ24内のNCプログラムの中から、運転するNCプログラムを選び出しRAM25内の運転バッファへ転送する機能を有している。上記第1のCPU21が、空き容量算出手段、プログラム容量算出手段、第1転送手段及び第2転送手段としての各機能を有している。   The first CPU 21 has a function of selecting an NC program to be operated from the NC programs in the nonvolatile memory 24 and transferring it to the operation buffer in the RAM 25. The first CPU 21 has functions as free capacity calculation means, program capacity calculation means, first transfer means, and second transfer means.

一方、第2のCPU22は、数値制御装置1の運転全般を制御する機能を有しており、RAM25の運転バッファ内のNCプログラムを解析し、動力系の信号へ変換し出力する制御を実行する。この第2のCPU22が、転送判断手段及び実行手段としての各機能を有している。上記第2のCPU22には、上記RAM25の他に、RAM27と、ROM28と、動力系IF29と、外部入出力IF30とが接続されている。   On the other hand, the second CPU 22 has a function of controlling the overall operation of the numerical controller 1, and executes control to analyze the NC program in the operation buffer of the RAM 25, convert it to a power system signal, and output it. . The second CPU 22 has functions as transfer determination means and execution means. In addition to the RAM 25, the second CPU 22 is connected to a RAM 27, a ROM 28, a power system IF 29, and an external input / output IF 30.

RAM27には、一時的な演算の中間データが記憶(保持)され、ROM28には、第2のCPU22の制御プログラム(制御コード)が記憶されている。動力系IF29には、XYZ軸の各モータ10、11、12や、主軸モータ13や、工具交換用のマガジンモータ14や、パレット交換モータ16等が接続されている(図1にはこれらのモータを図示していない)。   The RAM 27 stores (holds) intermediate data for temporary calculation, and the ROM 28 stores a control program (control code) for the second CPU 22. Connected to the power system IF 29 are the motors 10, 11, 12 of the XYZ axes, the spindle motor 13, the magazine motor 14 for tool change, the pallet change motor 16, and the like (FIG. 1 shows these motors). Is not shown).

外部入出力IF30には、ワーク交換機構35と、NCプログラムスケジュール装置36とが接続されている。そして、外部入出力IF30は、外側起動スイッチ31と、次プログラム番号入力端子32と、次プログラムready端子33と、次プログラム要求端子34とを有している。上記外部入出力IF30が、入力手段及び完了信号検出手段としての各機能を有している。   A work exchanging mechanism 35 and an NC program schedule device 36 are connected to the external input / output IF 30. The external input / output IF 30 includes an outer activation switch 31, a next program number input terminal 32, a next program ready terminal 33, and a next program request terminal 34. The external input / output IF 30 has functions as input means and completion signal detection means.

外側起動スイッチ31は、ワーク交換機構35により、外側パレットにおいて加工済のワークの取り外し作業と新しいワークの取り付け作業が終了すると、その旨を示すために、例えばONされるようになっている。尚、ワーク交換機構35は、作業者またはロボット等で構成されている。   The outer start switch 31 is turned on, for example, to indicate that when the work exchanging mechanism 35 finishes the work of removing the processed work and the work of attaching a new work on the outer pallet. The workpiece exchange mechanism 35 is configured by an operator or a robot.

次プログラム番号入力端子32には、NCプログラムスケジュール装置36から、次に運転するNCプログラムのNCプログラム番号を示すデータ(NCプログラム番号を入力可能なbit数のデータ)が入力可能なように構成されている。次プログラムready端子33は、NCプログラムスケジュール装置36から、次に運転するNCプログラムのNCプログラム番号を示すデータの上記次プログラム番号入力端子32への入力が完了したとき、そのことを示すために、例えばONされる(ON信号が入力される)ようになっている。   The next program number input terminal 32 is configured so that data indicating the NC program number of the NC program to be operated next (data of the number of bits capable of inputting the NC program number) can be input from the NC program schedule device 36. ing. The next program ready terminal 33, when the input to the next program number input terminal 32 of the data indicating the NC program number of the NC program to be operated next from the NC program schedule device 36 is completed, For example, it is turned ON (ON signal is input).

また、次プログラム要求端子34は、NCプログラムスケジュール装置36に対して、次プログラム番号入力端子32へ次に運転するプログラム番号の入力と、次プログラムready端子33のセット(ON)を要求するときに、例えばONされる(ON信号が出力される)ように構成されている。尚、NCプログラムスケジュール装置36は、外部のシーケンサ等の機器で構成しても良いし、数値制御装置1の内部に設けるように構成しても良い。   The next program request terminal 34 requests the NC program schedule device 36 to input the next program number to be operated next to the next program number input terminal 32 and to set (ON) the next program ready terminal 33. For example, it is configured to be turned on (output an ON signal). The NC program schedule device 36 may be configured by an external device such as a sequencer, or may be configured to be provided inside the numerical control device 1.

次に、上記した構成の数値制御装置1の動作について、図3ないし図16を参照しながら説明する。
図3及び図4のフローチャートは、第2のCPU22の運転の制御内容を示しており、最初に、運転するNCプログラムの取得、及び、運転するNCプログラム番号の取得についての制御を行なう。
Next, the operation of the numerical control apparatus 1 configured as described above will be described with reference to FIGS.
The flowcharts of FIGS. 3 and 4 show the control contents of the operation of the second CPU 22. First, control is performed regarding acquisition of the operating NC program and acquisition of the operating NC program number.

まず、図3のステップS201において、始めに運転するべきNCプログラムを求めるため、後述する図5の制御動作(第2のCPU22の制御のうち、図3、4の内の「“次プログラム要求”の出力」が発生してから、並列処理する制御)を起動(稼動)させる。尚、このステップS201は、電源を入れてから1回目の運転の前に実行されるだけである。   First, in step S201 of FIG. 3, in order to obtain an NC program to be operated first, a control operation of FIG. 5 described later (in the control of the second CPU 22, ““ Next program request ”in FIGS. After the occurrence of “output”, the control for parallel processing) is started (operated). This step S201 is only executed before the first operation after turning on the power.

この後、「プログラム番号取得」フラグがON(図5のステップS308参照)するまで待つ(ステップS202)。
そして、「プログラム番号取得」のフラグがONしたら(ステップS202にてYES)、「プログラム転送完了」フラグがOFFのときだけ(ステップS202にてNO)、運転するNCプログラム番号と共に、「プログラム転送」フラグをONしたことを、RAM25を介して第1のCPU21へ伝達する(ステップS204)。
Thereafter, the process waits until the “program number acquisition” flag is turned ON (see step S308 in FIG. 5) (step S202).
If the “program number acquisition” flag is ON (YES in step S202), only when the “program transfer completion” flag is OFF (NO in step S202), together with the NC program number to be operated, “program transfer” The fact that the flag is turned on is transmitted to the first CPU 21 via the RAM 25 (step S204).

その後、外側起動スィッチ31がONするまで待つ(ステップS205)。通常の加工サイクル(加工を連続して行う)では、内側パレットで加工している間に、ワーク交換機構35により、ワークの取替えが行われ、外側起動スィッチ31がONとなるように工程が実行されるので、ここでの待ち時間は無い。   Thereafter, the process waits until the outer start switch 31 is turned on (step S205). In a normal processing cycle (processing is performed continuously), while the inner pallet is being processed, the workpiece is replaced by the workpiece replacement mechanism 35, and the process is executed so that the outer start switch 31 is turned on. So there is no waiting time here.

次に、外側起動スィッチ31がONしていれば(ステップS205にてYES)、並列動作命令(特開平5−313719号公報参照)が設定されているかを判断する(ステップS206)。ここで、並列動作命令の設定が無い場合(ステップS206にてNO)には、準備された外側パレットを加工装置へ移動させるため、パレット交換装置9の旋回要求を、図示しないパレットの制御動作へ出力する(ステップS213)。   Next, if the outer activation switch 31 is ON (YES in step S205), it is determined whether a parallel operation command (see Japanese Patent Laid-Open No. 5-313719) is set (step S206). If no parallel operation command is set (NO in step S206), the rotation request of the pallet changer 9 is changed to a control operation of a pallet (not shown) in order to move the prepared outer pallet to the processing device. Output (step S213).

これに対して、並列動作命令の設定が有る場合(ステップS206にてYES)、「並列動作転送完了」フラグがON(図5のステップS306、図7のステップS507、図11のステップS906参照)されるのを待つ(ステップS207)。尚、並列動作命令とは、NCプログラム内にある、パレット交換装置9の旋回と同時動作を行う命令のことで、予め数値制御装置1に登録しておく。多くは、NCプログラムの先頭から最初に行われる工具交換命令(NCプログラム上の“M6”コード)を登録することが多い。   On the other hand, when a parallel operation instruction is set (YES in step S206), the “parallel operation transfer completion” flag is ON (see step S306 in FIG. 5, step S507 in FIG. 7, and step S906 in FIG. 11). It is waited for (step S207). The parallel operation command is a command in the NC program for simultaneous operation with the turning of the pallet exchanging device 9, and is registered in the numerical control device 1 in advance. In many cases, the tool change command (“M6” code on the NC program) that is first performed from the beginning of the NC program is often registered.

上記「並列動作転送完了」フラグがONしたら、NCプログラムを1ブロック読み込み、運転バッファ上のNCプログラムの<読み込み位置>を、読み込んだブロックの終端の次アドレスへ設定する(ステップS208)。   When the “parallel operation transfer completion” flag is turned on, one block of the NC program is read, and the <read position> of the NC program on the operation buffer is set to the next address at the end of the read block (step S208).

尚、<読み込み位置>とは、第2のCPU22が運転バッファから1ブロック読み込むとき(図3のステップS208、図4のステップS218参照)、読むべきブロックの先頭アドレスのことである。ステップS205を実行開始してから、最初のブロックを読む際には、図12に示すプログラム管理データの一番上のNCプログラムの親プログラムのアドレス(図12のA0(A列0行))を参照し、そこが初期の<読み込み位置>となる。プログラム管理データは、RAM25内に設けられており、図12に示すような形態に構成されている。   The <reading position> is the head address of the block to be read when the second CPU 22 reads one block from the operation buffer (see step S208 in FIG. 3 and step S218 in FIG. 4). When reading the first block after starting execution of step S205, the address of the parent program of the NC program at the top of the program management data shown in FIG. 12 (A0 (A column 0 line 0) in FIG. 12) is used. This is the initial <read position>. The program management data is provided in the RAM 25 and is configured as shown in FIG.

プログラム管理データのAの列には、運転するNCプログラム番号が入っている。また、一番上の行(0行)には、運転するNCプログラムの親プログラムが入り、Bの列には、運転バッファ内の親プログラムの絶対位置のアドレスが入る。2番目の行以降は、運転するNCプログラムのサブプログラムが入り、Aの列には、サブプログラムの番号、Bの列には運転バッファ内の親プログラム先頭からみて、おのおののサブプログラムの先頭への相対アドレスが入る。また、最後の行(T行)のA列には、サブプログラムも含めたNCプログラム全ての総文字数が、B列には、最初の並列動作命令があるブロックの先頭アドレスが入っている。   In the column A of the program management data, the NC program number to be operated is entered. The top row (0th row) contains the parent program of the NC program to be operated, and the B column contains the address of the absolute position of the parent program in the operation buffer. In the second and subsequent rows, the subprogram of the NC program to be operated is entered. The subprogram number is entered in the A column, and the subprogram is viewed in the B column from the top of the parent program in the operation buffer. The relative address of is entered. Further, the A column of the last row (T row) contains the total number of characters of all NC programs including subprograms, and the B column contains the head address of the block having the first parallel operation instruction.

次に、前ブロックの動作完了を得る(S211の動作が終了する、ただし、S205を開始して1回目は動作完了とする)まで待つ(ステップS209)。前ブロックの動作が完了した場合(ステップS209にてYES)、ステップS208にて読んだブロックが並列動作命令であるか否かを判断する(ステップS210)。ここで、並列動作命令でない場合(ステップS210にてNO)には、ブロックの命令に従った動作の開始を、即ち、図示しない、おのおのの制御動作の実行を指示する(ステップS211)。   Next, it waits until the operation completion of the previous block is obtained (the operation of S211 ends, but S205 is started and the first operation is completed) (step S209). When the operation of the previous block is completed (YES in step S209), it is determined whether or not the block read in step S208 is a parallel operation command (step S210). If the instruction is not a parallel operation instruction (NO in step S210), the start of the operation in accordance with the block instruction, that is, the execution of each control operation (not shown) is instructed (step S211).

一方、ステップS208で読んだブロックが並列動作命令であるならば(ステップS210にてYES)、パレット交換装置9の旋回の開始と、並列動作命令の開始を指示する、即ち、おのおのの制御動作の実行を指示する(ステップS212)。   On the other hand, if the block read in step S208 is a parallel operation command (YES in step S210), the start of turning of the pallet changer 9 and the start of the parallel operation command are instructed, that is, each control operation is performed. Execution is instructed (step S212).

続いて、図4のステップS214へ進み、ステップS204で要求した「プログラム転送」の要求の完了信号である「プログラム転送完了」フラグがON(図5のステップS306、図7のステップS507、図11のステップS908参照)するまで待つ。つまり、第2のCPU22がステップS203からステップS212の処理を行っている間に、第1のCPU21が「プログラム転送」の要求に応える処理を実行することとなる。   Subsequently, the process proceeds to step S214 in FIG. 4, and the “program transfer completion” flag, which is a completion signal of the “program transfer” request requested in step S204, is ON (step S306 in FIG. 5, step S507 in FIG. 7, FIG. 11). Step S908). That is, while the second CPU 22 is performing the processing from step S203 to step S212, the first CPU 21 executes processing that responds to the “program transfer” request.

そして、「並列動作転送完了」フラグ、「プログラム番号の取得」フラグ、「プログラム転送完了」フラグをすべてOFFし、次のパレット(ステップS212、S213で外側へ搬出した外側パレット)用のNCプログラムの取得状態を初期化する(ステップS215)。   Then, the “parallel operation transfer complete” flag, the “program number acquisition” flag, and the “program transfer complete” flag are all turned OFF, and the NC program for the next pallet (the outer pallet carried out outside in steps S212 and S213) The acquisition state is initialized (step S215).

続いて、外側パレットが加工位置に移動して、ワークを加工するときに運転するNCプログラムを求めるために、後述する図5の制御動作を起動させる(ステップS216)。
そして、NCプログラムの次の<読み込み位置>が運転バッファ内にあるか否かを判断する(ステップS217)。ここで、次の<読み込み位置>が運転バッファ内にある場合(ステップS217にてYES)、NCプログラムを1ブロック読み込み、<読み込み位置>をブロックの終端の次アドレスへ設定する(ステップS218)。尚、ステップS205を実行開始してからステップS213までを実行した後、最初のブロックを読む際には、プログラム管理データ(図12参照)の一番上の親プログラムのアドレスを参照し、そこが<読み込み位置>となる。
Subsequently, in order to obtain an NC program to be operated when the outer pallet is moved to the machining position and the workpiece is machined, a control operation of FIG. 5 described later is started (step S216).
Then, it is determined whether or not the next <read position> of the NC program is in the operation buffer (step S217). If the next <read position> is in the operation buffer (YES in step S217), one block of NC program is read and <read position> is set to the next address at the end of the block (step S218). When the first block is read after executing step S205 to step S213, the address of the parent program at the top of the program management data (see FIG. 12) is referred to. <Reading position>.

次に、前ブロック(指示された1つ前の制御動作、S213、S212ないしS221で指示された動作)が動作完了(動作終了)するまで待つ(ステップS219)。前ブロックの動作が完了した場合(ステップS219にてYES)、ステップS218で読んだブロックがプログラムエンド命令であるか否かを判断する(ステップS220)。ここで、プログラムエンド命令の場合(ステップS220にてYES)には、次のパレットの運転を開始する、即ち、図3のステップS202へ戻る(遷移する)。   Next, the process waits until the previous block (the instructed control operation immediately before, the operation instructed in S213, S212 to S221) is completed (operation end) (step S219). When the operation of the previous block is completed (YES in step S219), it is determined whether or not the block read in step S218 is a program end instruction (step S220). Here, in the case of a program end command (YES in step S220), the operation of the next pallet is started, that is, the process returns to step S202 in FIG. 3 (transitions).

また、ステップS218で読んだブロックの命令が、プログラムエンド命令以外である場合(ステップS220にてNO)、ブロックの命令に従った動作の開始をおのおのの制御動作へ指示し、ワークに加工を施す(ステップS221)。この後、現在運転をしているNCプログラムがテープ運転であるか否かを判断し、テープ運転でなければ(ステップS222にてNO)、ステップS217へ戻り、処理を繰り返し実行する。   If the block instruction read in step S218 is other than the program end instruction (NO in step S220), the control operation is instructed to start the operation according to the block instruction, and the workpiece is processed. (Step S221). Thereafter, it is determined whether or not the NC program currently being operated is a tape operation. If the NC program is not a tape operation (NO in step S222), the process returns to step S217 and the process is repeatedly executed.

また、上記ステップS220において、ステップS218で読んだブロックの命令が、サブプログラムへの遷移命令の場合、プログラム管理データ上のプログラム番号に対応する、アドレス(図12のB列)を読み込み、親プログラムのアドレス(図12の0行A列の値)から加算した位置(リングバッファを加味した位置)に<読み込み位置>を更新する。   In step S220, if the block instruction read in step S218 is a transition instruction to a subprogram, the address (column B in FIG. 12) corresponding to the program number on the program management data is read and the parent program <Read position> is updated to the position (position including the ring buffer) added from the address (value of row 0, column A in FIG. 12).

また、サブプログラムへの遷移命令のとき、その元の<読み込み位置>をRAM25へスタックしておき、その後、親プログラムに戻る指令の場合には、スタックしたものを<読み込み位置>に戻す。ここにおいて、サブプログラムが、プログラム管理データ上に無い場合には、<読み込み位置>が領域内にないとし、ステップS217へ戻った際、<読み込み位置>が運転バッファ内に無い(ステップS217にてNO)となる。   In the case of a transition instruction to a subprogram, the original <read position> is stacked on the RAM 25, and then, in the case of a command to return to the parent program, the stacked one is returned to <read position>. Here, if the subprogram is not in the program management data, it is assumed that <reading position> is not in the area, and when returning to step S217, <reading position> is not in the operation buffer (in step S217). NO).

そして、読み込むブロックが運転バッファ内に無い場合(ステップS217にてNO)、及び、テープ運転の場合(ステップS222にてYES)、ステップS223へ進み、「プログラム領域」フラグをONして、第1のCPU21に対して、サブプログラムの要求の場合には、サブプログラムの要求と共に、転送して欲しいサブプログラム番号を、RAM25を介して伝達し、テープ運転の場合には、転送されていない部分の転送の要求と共に、開放してよい運転バッファの領域を、RAM25を介して伝達する。   If there is no block to be read in the operation buffer (NO in step S217) and tape operation (YES in step S222), the process proceeds to step S223, the “program area” flag is turned on, and the first In the case of a subprogram request, the subprogram number to be transferred is transmitted through the RAM 25 together with the subprogram request in the case of a tape operation. Along with the transfer request, the area of the operation buffer that can be released is transmitted via the RAM 25.

次に、図5のフローチャートは、図3及び図4の制御とは別に第2のCPU22で並列稼動(処理)する制御の内容を示している。ここでの並列処理とは、第2のCPU22の処理資源を、リアルタイムOSなどにより、図3及び図4の制御と図5の処理とを短い時間間隔で分割して行い実現すれば良い。この図5の制御は、図3のステップS201及び図4のステップS216を開始トリガとして、起動されて実行される。   Next, the flowchart of FIG. 5 shows the content of control that is operated in parallel (processed) by the second CPU 22 separately from the control of FIG. 3 and FIG. The parallel processing here may be realized by dividing the processing resources of the second CPU 22 by the real-time OS or the like by dividing the control of FIGS. 3 and 4 and the processing of FIG. 5 at short time intervals. The control in FIG. 5 is started and executed with step S201 in FIG. 3 and step S216 in FIG. 4 as start triggers.

即ち、図3のステップS201及び図4のステップS216から起動された直後、NCプログラムスケジュール装置36に対して、次プログラム要求端子34をONする(ステップS301)。続いて、“次プログラムready”端子33がONされる(ON信号あり)まで待つ(ステップS302)。これに対して、NCプログラムスケジュール装置36は、次プログラム要求端子34のONを受けて、次に運転するべきNCプログラムのNCプログラム番号を次プログラム番号入力端子32に出力する共に、次プログラムready端子33をONする。   That is, immediately after being started from step S201 in FIG. 3 and step S216 in FIG. 4, the next program request terminal 34 is turned on for the NC program schedule device 36 (step S301). Subsequently, the process waits until the “next program ready” terminal 33 is turned on (there is an ON signal) (step S302). On the other hand, the NC program schedule device 36 receives the ON of the next program request terminal 34, outputs the NC program number of the NC program to be operated next to the next program number input terminal 32, and also receives the next program ready terminal. Turn ON 33.

すると、第2のCPU22においては、上記次プログラムready端子33のONを受けて、ステップS302にてYESへ進み、次プログラム番号入力端子32を読み取り(ステップS303)、次プログラム要求端子34をOFFする(ステップS304)。これに対して、NCプログラムスケジュール装置36は、次プログラム要求端子34のOFFを受けて、次プログラムready端子33をOFFする。   Then, the second CPU 22 receives ON of the next program ready terminal 33, proceeds to YES in step S302, reads the next program number input terminal 32 (step S303), and turns off the next program request terminal 34. (Step S304). In response to this, the NC program schedule device 36 turns OFF the next program ready terminal 33 in response to the OFF of the next program request terminal 34.

この後、第2のCPU22においては、ステップS303で得たプログラム番号が、既に親プログラムとして、運転バッファに登録(転送)されているかどうか判断する(ステップS305)。ここで、プログラム管理データは、RAM25上にパレットの数(2つ)だけ存在し、テープ運転の場合を除き、運転バッファのプログラム管理データに登録されているNCプログラムが上書きされた場合、プログラム管理データも第1のCPU21によって初期化される。よって、プログラム管理データを参照すれば、運転バッファ内にNCプログラムが存在するか否かを判断できる。例えば、両パレットのNCプログラムが運転バッファに全て収まっている場合、パレット毎のNCプログラム番号が変わらない限り、運転バッファに登録されたままとなる。   Thereafter, the second CPU 22 determines whether or not the program number obtained in step S303 is already registered (transferred) in the operation buffer as a parent program (step S305). Here, there are as many program management data as the number of palettes (two) on the RAM 25, and when the NC program registered in the program management data in the operation buffer is overwritten except in the case of tape operation, Data is also initialized by the first CPU 21. Therefore, whether or not the NC program exists in the operation buffer can be determined by referring to the program management data. For example, if the NC programs for both pallets are all contained in the operation buffer, they will remain registered in the operation buffer unless the NC program number for each pallet changes.

さて、次に運転するNCプログラムが既に運転バッファにある場合(ステップS305にてYES)には、「並列動作転送完了」フラグと「プログラム転送完了」フラグとをONする(ステップS306)。   If the NC program to be operated next is already in the operation buffer (YES in step S305), the "parallel operation transfer completion" flag and the "program transfer completion" flag are turned ON (step S306).

一方、運転バッファに登録されていない場合(ステップS305にてNO)には、「並列動作転送完了」フラグと「プログラム転送完了」フラグとをOFFし、「次プログラム準備」フラグをONし、ステップS303で得たプログラム番号と共に、「次プログラム準備」フラグのONを、RAM25を介して第1のCPU21に伝達する(ステップS307)。続いて、ステップS308へ進み、最後に、「プログラム番号取得フラグ」をONして図5の制御を終了する(ステップS308)。   On the other hand, if it is not registered in the operation buffer (NO in step S305), the “parallel operation transfer completion” flag and the “program transfer completion” flag are turned off, the “next program preparation” flag is turned on, and step Along with the program number obtained in S303, ON of the “next program preparation” flag is transmitted to the first CPU 21 via the RAM 25 (step S307). Subsequently, the process proceeds to step S308, and finally, the “program number acquisition flag” is turned on to end the control of FIG. 5 (step S308).

さて、図6のフローチャートは、第1のCPU21の制御の内容を示すものであり、特には、第2のCPU22から、ステップS204の「プログラム転送」フラグのON、ステップS223の「プログラム領域」フラグのON、及び、ステップS307の「次プログラム準備」フラグのON、即ち、「プログラム転送」、「プログラム領域」、及び、「次プログラム準備」の各要求がRAM25を介して第1のCPU21に伝達されたかどうかを定常的に監視し、要求に応えるように動作する制御を示している。   The flowchart of FIG. 6 shows the contents of the control of the first CPU 21, and in particular, from the second CPU 22, the “program transfer” flag in step S204 is turned ON, and the “program area” flag in step S223. ON, and the “next program preparation” flag in step S307 ON, that is, “program transfer”, “program area”, and “next program preparation” requests are transmitted to the first CPU 21 via the RAM 25. It shows the control that constantly monitors whether it has been done and operates to meet the demand.

まず、ステップS401において、「プログラム転送」フラグがONしているか否かを判断する。ここで、「プログラム転送」フラグがONしていれば、即ち、「プログラム転送」要求があれば(ステップS401にてYES)、後述する図7のサブルーチンを実行する(ステップS404)。尚、図7のサブルーチンの実行が完了すると、ステップS401へ戻る。   First, in step S401, it is determined whether or not the “program transfer” flag is ON. If the “program transfer” flag is ON, that is, if there is a “program transfer” request (YES in step S401), a subroutine shown in FIG. 7 described later is executed (step S404). When the execution of the subroutine of FIG. 7 is completed, the process returns to step S401.

続いて、「プログラム転送」フラグがONしていなければ(ステップS401にてNO)、「プログラム領域」フラグがONしているか否かを判断する(ステップS402)。ここで、「プログラム領域」フラグがONしていれば、即ち、「プログラム領域」要求があれば(ステップS402にてYES)、図8のサブルーチンを実行する(ステップS405)。尚、図8のサブルーチンの実行が完了すると、ステップS401へ戻る。   Subsequently, if the “program transfer” flag is not ON (NO in step S401), it is determined whether or not the “program area” flag is ON (step S402). If the “program area” flag is ON, that is, if there is a “program area” request (YES in step S402), the subroutine of FIG. 8 is executed (step S405). When the execution of the subroutine of FIG. 8 is completed, the process returns to step S401.

そして、「プログラム領域」フラグがONしていなければ(ステップS402にてNO)、「次プログラム準備」フラグがONしているか否かを判断する(ステップS403)。ここで、「次プログラム準備」フラグがONしていれば、即ち、「次プログラム準備」要求があれば(ステップS403にてYES)、図9のサブルーチンを実行する(ステップS406)。尚、図9のサブルーチンの実行が完了すると、ステップS401へ戻る。   If the “program area” flag is not ON (NO in step S402), it is determined whether or not the “next program preparation” flag is ON (step S403). If the “next program preparation” flag is ON, that is, if there is a “next program preparation” request (YES in step S403), the subroutine of FIG. 9 is executed (step S406). When the execution of the subroutine of FIG. 9 is completed, the process returns to step S401.

次に、図7のフローチャートで示すサブルーチンについて、即ち、第2のCPU22からの「プログラム転送」要求に応える第1のCPU21の制御について説明する。
まず、図7のステップS501においては、ステップS204によってセットされたNCプログラム番号(親プログラム番号)をRAM25から得る。続いて、上記ステップS501で得た親プログラム番号に対応する<解析終了>フラグがOFFしているか否かを判断する(ステップS502)。
Next, the subroutine shown in the flowchart of FIG. 7, that is, the control of the first CPU 21 in response to the “program transfer” request from the second CPU 22 will be described.
First, in step S501 of FIG. 7, the NC program number (parent program number) set in step S204 is obtained from the RAM 25. Subsequently, it is determined whether or not the <analysis end> flag corresponding to the parent program number obtained in step S501 is OFF (step S502).

ここで、<解析終了>フラグがOFFしていれば(ステップS502にてYES)、プログラムの解析を行う、即ち、後述する図10のサブルーチンを実行する(ステップS511)。<解析終了>フラグは、親プログラムの番号毎に保有(確保)されている。また、<解析終了>フラグがONしている親プログラムは、RAM23、RAM25、不揮発メモリ24のいずれかに、対応するプログラム管理データが保有(作成)されている。尚、一度、図10の制御が実行されると、<解析終了>フラグがON(図10のステップS811参照)し、第2のCPU22が使用するRAM25上のプログラム管理データを作成すると共に、前記バックアップデータへも複写する。また、図示しないが、対応するプログラム管理データ上のNCプログラムの1つが、中身が変更されたときや、対応するプログラム管理データが初期化されたときなどに、<解析終了>フラグがOFFされ、対応するプログラム管理データのバックアップデータも削除されるようになっている。   If the <analysis end> flag is OFF (YES in step S502), the program is analyzed, that is, a subroutine shown in FIG. 10 described later is executed (step S511). The <analysis end> flag is held (reserved) for each parent program number. The parent program whose <analysis end> flag is ON holds (creates) corresponding program management data in any of the RAM 23, RAM 25, and nonvolatile memory 24. Once the control of FIG. 10 is executed, the <analysis end> flag is turned ON (see step S811 of FIG. 10), and the program management data on the RAM 25 used by the second CPU 22 is created. Copy to backup data. Although not shown, when one of the NC programs on the corresponding program management data is changed, or when the corresponding program management data is initialized, the <analysis end> flag is turned off. The backup data of the corresponding program management data is also deleted.

一方、ステップS502において、上記ステップS501で得た親プログラム番号に対応する<解析終了>フラグがONしていれば(ステップS502にてNO)、現在の<転送位置>を得る(ステップS503)。ここで、<転送位置>とは、第1のCPU21が次にNCプログラムを転送する運転バッファの位置を示すアドレスのことである。   On the other hand, if the <analysis end> flag corresponding to the parent program number obtained in step S501 is ON in step S502 (NO in step S502), the current <transfer position> is obtained (step S503). Here, <transfer position> is an address indicating the position of the operation buffer to which the first CPU 21 next transfers the NC program.

続いて、ステップS504へ進み、サブプログラムを含めた全てのNCプログラムが運転バッファに転送されているか否かを判断する。この場合、既に転送したNCプログラムの文字数と、プログラム管理データ上にあるNCプログラム全ての総文字数とを比較して、同じであれば、全てのNCプログラムが運転バッファに転送されたと判断する。   Subsequently, the process proceeds to step S504, and it is determined whether or not all NC programs including the subprogram have been transferred to the operation buffer. In this case, the number of characters of the NC program already transferred is compared with the total number of characters of all the NC programs on the program management data. If the numbers are the same, it is determined that all the NC programs have been transferred to the operation buffer.

そして、ステップS511のプログラム解析後(図10のサブルーチンを実行した後)、または、NCプログラムの転送が全て終わっていない(ステップS504にてYES)の場合、ステップS505へ進み、<転送位置>から、可能な限り(プログラム管理データのアドレスの1つ前まで)、続きのNCプログラムを運転バッファに転送する。尚、ここで全てを転送できない場合は、テープ運転のときのみである。   Then, after analyzing the program in step S511 (after executing the subroutine of FIG. 10), or when the transfer of all NC programs is not completed (YES in step S504), the process proceeds to step S505, and from <transfer position> As much as possible (up to one before the address of the program management data), the subsequent NC program is transferred to the operation buffer. In addition, when all cannot be transferred here, it is only at the time of tape operation.

続いて、<転送位置>を、ステップS505で運転バッファに転送した最終番地の次のアドレスとするように更新する(ステップS506)。
そして、「プログラム転送」フラグと「プログラム領域」フラグをOFFし、「プログラム転送完了」フラグと「並列動作転送完了」フラグをONし、「プログラム転送」処理の完了を第2のCPU22へ伝達する(ステップS507)。これにより、図7のサブルーチンを終了し、呼び出しステップへ戻るようになっている。
Subsequently, the <transfer position> is updated to be the address next to the last address transferred to the operation buffer in step S505 (step S506).
Then, the “program transfer” flag and the “program area” flag are turned OFF, the “program transfer completion” flag and the “parallel operation transfer completion” flag are turned ON, and the completion of the “program transfer” process is transmitted to the second CPU 22. (Step S507). As a result, the subroutine of FIG. 7 is terminated and the process returns to the calling step.

尚、上記ステップS504において、NCプログラムの転送が全て終わっている(ステップS504にてNO)場合も、上記ステップS507へ進む。
次に、図10のサブルーチン(NCプログラム解析処理)について説明する。この図10のサブルーチンは、次に運転するNCプログラムが、テープ運転か、内部メモリ運転かを判断し、対応するプログラム管理データを作成する制御(第1のCPU21の制御)である。
In step S504, if all the NC programs have been transferred (NO in step S504), the process proceeds to step S507.
Next, the subroutine (NC program analysis process) of FIG. 10 will be described. The subroutine shown in FIG. 10 is control for determining whether the NC program to be operated next is a tape operation or an internal memory operation and creating corresponding program management data (control of the first CPU 21).

まず、ステップS801において、親プログラムのサイズと、運転バッファを比較する。ここで、親プログラムのサイズよりも運転バッファが大きい場合(ステップS801にてYES)、ステップS802へ進み、NCプログラムを解析し、NCプログラム内に記述されてある全てのサブプログラム番号を抽出する。   First, in step S801, the size of the parent program is compared with the operation buffer. If the operation buffer is larger than the size of the parent program (YES in step S801), the process proceeds to step S802, where the NC program is analyzed, and all the subprogram numbers described in the NC program are extracted.

この場合、図13に示すように、NCプログラム内にあるサブプログラムコード(M98)を探し出し、対応するNCプログラム番号(Pのあとの数字)をサブプログラムとして抽出する。また、抽出されたサブプログラムについても、また同様にして、その内部にあるサブプログラムコード(M98)を探し出し、孫プログラムを抽出していくように構成されている。   In this case, as shown in FIG. 13, the subprogram code (M98) in the NC program is searched, and the corresponding NC program number (number after P) is extracted as a subprogram. Similarly, the extracted subprogram is also configured to search for a subprogram code (M98) inside and extract a grandchild program.

続いて、ステップS803へ進み、抽出されたサブプログラム全てを含むNCプログラム容量(総プログラム容量)と、運転バッファを比較する。ここで、運転バッファが総プログラム容量より小さい場合(ステップS803にてNO)、並びに、運転バッファが親プログラムのサイズより小さい場合(ステップS801にてNO)、ステップS807へ進み、親プログラムだけのプログラム管理データをRAM25上に作成し、親プログラム番号のみをプログラム管理データに登録し、プログラム管理データのバックアップデータとして、RAM23、RAM25、不揮発性メモリ24のいずれかに複写する。そして、このNCプログラムについてはテープ運転とする(ステップS808)。   In step S803, the NC buffer capacity (total program capacity) including all extracted subprograms is compared with the operation buffer. Here, if the operation buffer is smaller than the total program capacity (NO in step S803), and if the operation buffer is smaller than the size of the parent program (NO in step S801), the process proceeds to step S807, and the program only for the parent program Management data is created on the RAM 25, only the parent program number is registered in the program management data, and copied to any of the RAM 23, RAM 25, and nonvolatile memory 24 as backup data of the program management data. The NC program is set to tape operation (step S808).

一方、抽出された全てのNCプログラムが運転バッファに入る場合(ステップS803にてYES)、全てのNCプログラム番号と、ファイルをつなげた形で、親プログラムからそれぞれのNCプログラムの先頭番地の差と、全てのNCプログラムの総文字数をRAM25上のプログラム管理データに登録し、プログラム管理データのバックアップデータとして、RAM23、RAM25、不揮発性メモリ24のいずれかに複写する(ステップS805)。そして、このNCプログラムについては内部メモリ運転とする(ステップS806)。   On the other hand, if all the extracted NC programs enter the operation buffer (YES in step S803), all NC program numbers and the difference between the head address of each NC program from the parent program in the form of connecting files The total number of characters of all NC programs is registered in the program management data on the RAM 25, and is copied to any of the RAM 23, RAM 25, and nonvolatile memory 24 as backup data of the program management data (step S805). The NC program is set to the internal memory operation (step S806).

続いて、並列動作命令の設定が有るか否かを判断する(ステップS809)。ここで、並列動作命令の設定が有る場合(ステップS809にてYES)、親プログラム先頭から、最初の並列動作命令をサーチし、その位置を、プログラム管理データの一番最後の枠のアドレスに、先頭からの差分位置を登録する(ステップS810)。このとき、プログラム管理データのバックアップデータ側へも登録する。そして、解析終了フラグをONする(ステップS811)。これにて、図10のサブルーチンを終了し、呼び出しステップへ戻る。   Subsequently, it is determined whether or not a parallel operation instruction is set (step S809). If a parallel operation instruction is set (YES in step S809), the first parallel operation instruction is searched from the top of the parent program, and its position is set to the address of the last frame of the program management data. The difference position from the beginning is registered (step S810). At this time, the program management data is also registered on the backup data side. Then, the analysis end flag is turned on (step S811). This terminates the subroutine of FIG. 10 and returns to the calling step.

次に、図8のフローチャートで示すサブルーチンについて、即ち、第2のCPU22からの「プログラム領域」要求に応える第1のCPU21の制御について説明する。
まず、図8のステップS601においては、要求情報を得る、具体的には、ステップS223によってセットされた転送して欲しいサブプログラム番号や開放領域を、RAM25から読み込んで獲得し、また、ステップS506(またはステップS607)でセットされた<転送位置>を得る。
Next, the subroutine shown in the flowchart of FIG. 8, that is, the control of the first CPU 21 in response to the “program area” request from the second CPU 22 will be described.
First, in step S601 of FIG. 8, the request information is obtained. Specifically, the subprogram number and the open area that are desired to be transferred set in step S223 are read from the RAM 25 and acquired, and step S506 ( Alternatively, the <transfer position> set in step S607) is obtained.

続いて、ステップS602へ進み、要求が、テープ運転更新であるか否かを判断する。ここで、テープ運転更新以外、つまり、サブプログラム更新の場合(ステップS602にてNO)、運転バッファの例外領域に要求されたサブプログラムを転送する(ステップS605)。   Then, it progresses to step S602 and it is judged whether a request | requirement is a tape driving | operation update. Here, in cases other than the tape operation update, that is, in the case of subprogram update (NO in step S602), the requested subprogram is transferred to the exception area of the operation buffer (step S605).

上記例外領域とは、運転バッファ内に予め別領域として確保する領域であり(図14参照)、パラメータなどでその量を設定できる。通常は、内部メモリ運転において動的にサブプログラム番号が確定するような構文を組んだり、テープ運転においてサブプログラグラムの遷移命令があったときに、このエリアにサブプログラムを転送して行う。   The exceptional area is an area reserved in advance as another area in the operation buffer (see FIG. 14), and the amount can be set by a parameter or the like. Normally, when a subprogram number is dynamically determined in the internal memory operation or a subprogram transition instruction is issued in the tape operation, the subprogram is transferred to this area.

一方、要求が、テープ運転更新である場合、即ち、テープ運転の続きのプログラムが要求されている場合(ステップS602にてYES)、ステップS603へ進み、全ての転送が完了した(送るデータが無くなった)かどうかを判断する。   On the other hand, if the request is a tape operation update, that is, if a program following the tape operation is requested (YES in step S602), the process proceeds to step S603, where all transfers are completed (there is no data to send). Judgment)

ここで、全ての転送が完了していない場合(ステップS603にてNO)には、開放領域に、<転送位置>からNCプログラム(NCプログラムの続き)を書き込む(ステップS606)。尚、ステップS605またはステップS606を実行した後は、<転送位置>を更新する、即ち、<転送位置>を、ステップS605またはステップS606で転送した最終番地の次アドレスとする(ステップS607)。   If all the transfers have not been completed (NO in step S603), the NC program (continuation of the NC program) is written from the <transfer position> to the open area (step S606). After executing step S605 or step S606, <transfer position> is updated, that is, <transfer position> is set as the next address of the last address transferred in step S605 or step S606 (step S607).

一方、上記ステップS603において、全ての転送が完了した場合(ステップS603にてYES)、図11のサブルーチンを実行し、次パレットのNCプログラムを転送する(ステップS611)。そして、「プログラム領域」フラグをOFFする(ステップS608)。これにより、上記サブルーチンを終了し、呼び出しステップへ戻るようになっている。   On the other hand, if all the transfers are completed in step S603 (YES in step S603), the subroutine shown in FIG. 11 is executed to transfer the NC program for the next pallet (step S611). Then, the “program area” flag is turned OFF (step S608). As a result, the subroutine is terminated and the process returns to the calling step.

次に、図11のサブルーチン(プログラム転送処理)について説明する。この図11のサブルーチンは、次パレットのNCプログラムを運転バッファへ転送する制御(第1のCPU21の制御)である。   Next, the subroutine (program transfer process) of FIG. 11 will be described. The subroutine of FIG. 11 is control (control of the first CPU 21) for transferring the NC program of the next pallet to the operation buffer.

まず、ステップS901において、<転送位置>を読み込んで得る。続いて、現在運転しているNCプログラムが消えないように、運転バッファの空き容量を計算する(ステップS902)。そして、運転バッファの空き容量に次のプログラムを可能な限り転送し(ステップS903)、空き容量の最後の次の位置を<転送位置>として記憶する(ステップS904)。また、このとき、RAM25に転送するNCプログラムに対応するプログラム管理データが無い場合には、RAM23、RAM25、不揮発メモリ24のプログラム管理データのバックアップデータから、RAM25のプログラム管理データへ複写する。また、RAM25のプログラム管理データに、転送するNCプログラムに対応する親プログラムのアドレス(図12のA0(A列0行))が登録されていない場合には、転送を始めた<転送位置>を、プログラム管理データの親プログラムのアドレス(図12のA0(A列0行))へ書き込む。   First, in step S901, <transfer position> is read and obtained. Subsequently, the available capacity of the operation buffer is calculated so that the NC program currently being operated does not disappear (step S902). Then, the next program is transferred to the free capacity of the operation buffer as much as possible (step S903), and the last next position of the free capacity is stored as <transfer position> (step S904). At this time, if there is no program management data corresponding to the NC program to be transferred to the RAM 25, the backup data of the program management data in the RAM 23, RAM 25, and nonvolatile memory 24 is copied to the program management data in the RAM 25. If the address of the parent program corresponding to the NC program to be transferred (A0 (A column 0 row 0) in FIG. 12) is not registered in the program management data in the RAM 25, the <transfer position> at which transfer is started is set. The program management data is written to the parent program address (A0 (A column 0 row 0) in FIG. 12).

続いて、ステップS905へ進み、並列動作命令の設定が有るか否かを判断する。ここで、並列動作命令の設定が有る場合(ステップS905にてYES)、ステップS903の転送処理において、並列動作命令が転送されたか否かを判断して、転送されているならば、「並列動作転送完了」フラグをONする(ステップS906)。   Subsequently, the process proceeds to step S905, and it is determined whether or not a parallel operation instruction is set. If a parallel operation instruction is set (YES in step S905), it is determined in the transfer process in step S903 whether or not the parallel operation instruction has been transferred. The “transfer complete” flag is turned on (step S906).

この後、ステップS907へ進み、NCプログラムを全て転送できたか否かを判断する。ここで、NCプログラムを全て転送できた場合(ステップS907にてYES)、「プログラム転送完了」フラグをONする(ステップS908)。これにより、図11のサブルーチンを終了し、呼び出しステップへ戻る。   Thereafter, the process proceeds to step S907, and it is determined whether or not all NC programs have been transferred. If all NC programs have been transferred (YES in step S907), the “program transfer complete” flag is turned ON (step S908). This completes the subroutine of FIG. 11 and returns to the calling step.

次に、図9のフローチャートで示すサブルーチンについて、即ち、第2のCPU22からの「次プログラム準備」要求に応える第1のCPU21の制御について説明する。
まず、図9のステップS701においては、ステップS305によってセットされた次のパレットの親プログラム番号をRAM25から読む。続いて、上記ステップS701で得た親プログラム番号に対応する<解析終了>フラグがOFFしているか否かを判断する(ステップS702)。ここで、<解析終了>フラグがOFFしていれば(ステップS702にてYES)、プログラムの解析を行う、即ち、前述した図10のサブルーチンを実行する(ステップS711)。
Next, the subroutine shown in the flowchart of FIG. 9, that is, the control of the first CPU 21 in response to the “next program preparation” request from the second CPU 22 will be described.
First, in step S701 in FIG. 9, the parent program number of the next pallet set in step S305 is read from the RAM 25. Subsequently, it is determined whether or not the <analysis end> flag corresponding to the parent program number obtained in step S701 is OFF (step S702). If the <analysis end> flag is OFF (YES in step S702), the program is analyzed, that is, the above-described subroutine of FIG. 10 is executed (step S711).

そして、ステップS703へ進み、現行運転がテープ運転であるか否かを判断する。ここで、現行運転が内部メモリ運転の場合(ステップS703にてNO)、次パレットのNCプログラムを転送する、即ち、前述した図11のサブルーチンを実行する(ステップS712)。   Then, the process proceeds to step S703 to determine whether or not the current operation is a tape operation. If the current operation is an internal memory operation (NO in step S703), the NC program for the next pallet is transferred, that is, the subroutine shown in FIG. 11 is executed (step S712).

この後、ステップS704へ進み、「次プログラム準備」フラグをOFFする。これにより、サブルーチンを終了し、呼び出しステップへ戻るようになっている。
次に、図14を用いて、運転バッファの構成の流れを説明する。図14中の左部に示すような形態のNCプログラムが、図14中の中央部に示すように、現在の運転バッファに入る。そして、図5のステップS307において、「次プログラム準備」フラグがONすると、第1のCPU21は、次の運転バッファの先頭部(次に運転するNCプログラムの先頭部)を書き込む。
Thereafter, the process proceeds to step S704, and the “next program preparation” flag is turned OFF. This terminates the subroutine and returns to the calling step.
Next, the flow of the configuration of the operation buffer will be described with reference to FIG. An NC program having a form as shown in the left part of FIG. 14 enters the current operation buffer as shown in the central part of FIG. When the “next program preparation” flag is turned on in step S307 in FIG. 5, the first CPU 21 writes the head of the next operation buffer (the head of the NC program to be operated next).

運転が終了すると、次の運転バッファが現在の運転バッファとなり、続いて、図3のステップS203において、「プログラム転送」がONすると、図4のステップS214までの間に、図14中の右部に示すように、現在の運転バッファの続きをセット(残りのNCプログラムを転送)する。   When the operation is completed, the next operation buffer becomes the current operation buffer. Subsequently, when “program transfer” is turned ON in step S203 of FIG. 3, the right part in FIG. As shown in Fig. 5, the continuation of the current operation buffer is set (the remaining NC program is transferred).

そして、運転バッファの次部に、同様にして、「次プログラム準備」フラグが再びONすると、次の運転バッファの先頭部(次に運転するNCプログラムの先頭部)を書き込む。以下、同様の動作を繰り返すようになっている。   Similarly, when the “next program preparation” flag is turned ON again in the next portion of the operation buffer, the head portion of the next operation buffer (the head portion of the NC program to be operated next) is written. Thereafter, the same operation is repeated.

次に、図15に、内部メモリ運転を実行する場合において、パレットの旋回動作(並列動作命令である工具交換動作)と、第2のCPU22による主運転の動作(図3及び図4の各フローチャートの制御)と、第2のCPU22による並列運転の動作(図5のフローチャートの制御)と、第1のCPU21による運転の動作(図6〜図11の各フローチャートの制御)と、NCプログラムスケジュール装置36の動作との間の時系列な関係を示す。   Next, in FIG. 15, in the case of executing the internal memory operation, the turning operation of the pallet (tool changing operation as a parallel operation command) and the operation of the main operation by the second CPU 22 (the flowcharts of FIGS. 3 and 4). Control), parallel operation by the second CPU 22 (control of the flowchart of FIG. 5), operation of the first CPU 21 (control of the flowcharts of FIGS. 6 to 11), and NC program schedule device A time-series relationship between the 36 operations is shown.

この図15から、現在実行中の加工(第2のCPU22によるステップS219,S217〜223、時刻T1〜T2)と、運転バッファの空き容量よりも次に運転するNCプログラムの容量が大きい場合に、該NCプログラムの先頭から運転バッファの空き容量分、該運転バッファに転送する処理(第1のCPU21によるS701〜702,S810〜811,S703〜704,S901〜908、時刻t1〜t2)とが並列動作で実行されていることがわかる。尚、時刻T1、T2、t1、t2は、時系列で並べると、T1<t1<t2<T2となる。   From FIG. 15, when the machining currently being executed (steps S219 and S217 to 223 by the second CPU 22 and times T1 to T2) and the capacity of the NC program to be operated next are larger than the free capacity of the operation buffer, Processing for transferring to the operation buffer from the beginning of the NC program to the operation buffer (S701 to 702, S810 to 811, S703 to 704, S901 to 908, times t1 to t2 by the first CPU 21) is performed in parallel. You can see that it is running in action. Note that the times T1, T2, t1, and t2 are T1 <t1 <t2 <T2 when arranged in time series.

また、現在実行中のNCプログラムの運転が終了したときに(第2のCPU22によるステップS202、S203〜206、時刻T3)、次に運転するNCプログラムを、転送されたNCプログラムの最後のアドレスまたは転送されなかった最初のアドレスに基づいて運転バッファに転送する処理(第1のCPU21によるS501〜507、時刻t3〜t4)と、時刻t1〜t2間で、並列動作転送完了している場合に、プログラム先頭から並列動作命令とパレット旋回動作までの処理(第2のCPU22によるS208〜S212及び、並列動作開始とパレット旋回動作開始による実動作、時刻T3〜T4)とが並列動作で実行されていることがわかる。尚、パレット旋回時間よりもt3〜t4間が短い為、時刻T3、T4、t3、t4は、時系列で並べると、T3≦t3<t4<T4となる。   Further, when the operation of the NC program currently being executed is finished (steps S202, S203 to 206, time T3 by the second CPU 22), the NC program to be operated next is set to the last address of the transferred NC program or When the parallel operation transfer has been completed between the process of transferring to the operation buffer based on the first address not transferred (S501 to S507 by the first CPU 21, times t3 to t4) and the times t1 to t2. Processing from the beginning of the program to the parallel operation command and the pallet turning operation (S208 to S212 by the second CPU 22 and the actual operation by the start of the parallel operation and the pallet turning operation, times T3 to T4) are executed in parallel operation. I understand that. Since the time between t3 and t4 is shorter than the pallet turning time, the times T3, T4, t3, and t4 are T3 ≦ t3 <t4 <T4 when arranged in time series.

一方、図16A、図16Bに、テープ運転を実行する場合において、パレットの旋回動作(並列動作命令である工具交換動作)と、第2のCPU22による主運転の動作(図3及び図4の各フローチャートの制御)と、第2のCPU22による並列運転の動作(図5のフローチャートの制御)と、第1のCPU21による運転の動作(図6〜図11の各フローチャートの制御)と、NCプログラムスケジュール装置36の動作との間の時系列な関係を示す。   On the other hand, in the case of executing the tape operation in FIGS. 16A and 16B, the pallet turning operation (tool changing operation as a parallel operation command) and the main operation operation by the second CPU 22 (each of FIGS. 3 and 4). (Control of flowchart), operation of parallel operation by the second CPU 22 (control of flowchart of FIG. 5), operation of operation by the first CPU 21 (control of flowcharts of FIGS. 6 to 11), NC program schedule A time series relationship between the operation of the device 36 is shown.

上記図16Aから、現在実行中の加工(第2のCPU22によるステップS219,S217〜223、時刻T’1〜T’2)と、次に運転するNCプログラムを解析する処理(第1のCPU21によるS701〜702,S810〜811,S703〜704、時刻t’1〜t’2)とが並列動作で実行されていることがわかる。   From the above-mentioned FIG. 16A, processing (steps S219 and S217 to 223 by the second CPU 22 and times T′1 to T′2 by the second CPU 22) and processing to analyze the NC program to be operated next (by the first CPU 21). S701-702, S810-811, S703-704, time t'1-t'2) are understood to be executed in parallel operation.

更に、テープ運転の実行中に運転するNCプログラムが全て転送され、運転バッファに開放部分が発生したときに(第2のCPU22によるステップS223、時刻T’11、T’12、T’13)、運転バッファの開放部分に次に運転するNCプログラムを転送する処理(第1のCPU21によるS601〜603,S901〜908、S608,時刻t’11〜t’12、t’13〜t’14、t’15〜t’16)とが並列動作で実行されていることがわかる。尚、上記した各時刻を時系列で並べると、T’1<t’1<t’2<T’11<t’11<t’12<T’12<t’13<t’14<T’13<t’15<t’16<T’2となる。   Furthermore, when all the NC programs to be operated during the tape operation are transferred and an open portion is generated in the operation buffer (step S223 by the second CPU 22, times T′11, T′12, T′13), Processing for transferring the NC program to be operated next to the open portion of the operation buffer (S601 to 603, S901 to 908, S608 by the first CPU 21, times t'11 to t'12, t'13 to t'14, t It can be seen that '15 to t'16) are executed in parallel operation. When the above times are arranged in time series, T′1 <t′1 <t′2 <T′11 <t′11 <t′12 <T′12 <t′13 <t′14 <T '13 <t'15 <t'16 <T'2.

また、現在実行中のNCプログラムの運転が終了したときに(第2のCPU22によるステップS202、S203〜206、時刻T’3)、次に運転するNCプログラムを、転送されたNCプログラムの最後のアドレスまたは転送されなかった最初のアドレスに基づいて運転バッファに転送する処理(第1のCPU21によるS501〜507、時刻t’3〜t’4)が実行される。尚、上記各時刻を時系列で並べると、T’3≦t’3<t’4となる。   When the operation of the NC program currently being executed is finished (steps S202 and S203 to 206 by the second CPU 22, time T'3), the NC program to be operated next is the last of the transferred NC programs. A process of transferring to the operation buffer based on the address or the first address that has not been transferred (S501 to S507 by the first CPU 21, times t′3 to t′4) is executed. When the above times are arranged in time series, T′3 ≦ t′3 <t′4.

このような構成の本実施例によれば、次に運転するNCプログラム番号の入力の完了を検出したときに、現在実行中の加工と並列動作で、次に運転するNCプログラムの容量を算出し、運転バッファの空き容量よりも、上記NCプログラムの容量が大きい場合に、該NCプログラムの先頭から運転バッファの空き容量分、該運転バッファに転送するように構成したので、運転するNCプログラムを切り替えるときに、NCプログラムを運転バッファに転送する際に要する時間を極力短縮することができ、生産性を高めることが可能になる。   According to this embodiment having such a configuration, when the completion of the input of the NC program number to be operated next is detected, the capacity of the NC program to be operated next is calculated in parallel operation with the currently executing machining. Since, when the capacity of the NC program is larger than the free capacity of the operation buffer, the operation buffer is transferred to the operation buffer from the beginning of the NC program, so the NC program to be operated is switched. Sometimes the time required to transfer the NC program to the operation buffer can be shortened as much as possible, and productivity can be increased.

また、上記実施例の場合、NCプログラムを、メインプログラムとメインプログラムから呼び出されるサブプログラムとから構成し、プログラム容量を算出するに際して、メインプログラムの容量とサブプログラムの容量との総和を算出するように構成したので、内部メモリ運転またはテープ運転のいずれかを選択するときに、正確に選択することができる。   In the case of the above embodiment, the NC program is composed of a main program and a subprogram called from the main program, and when calculating the program capacity, the sum of the main program capacity and the subprogram capacity is calculated. Therefore, when selecting either the internal memory operation or the tape operation, the selection can be made accurately.

更に、上記実施例では、NCプログラムのプログラム番号とサブプログラム番号とを記憶する記憶手段を備えると共に、NCプログラムを運転バッファに転送する際に、サブプログラムのプログラム番号と、該サブプログラム番号の先頭アドレスを対応付けたプログラム管理データを前記記憶手段に記憶させるプログラム管理データ作成手段を備える構成としたので、メインプログラムからサブプログラムを呼び出すときに、プログラム管理データを参照することにより、時間的遅延なく、次の読み込み番地を決定することが可能となる。   Further, in the above-described embodiment, storage means for storing the program number and subprogram number of the NC program is provided, and when the NC program is transferred to the operation buffer, the program number of the subprogram and the head of the subprogram number are stored. Since the program management data creating means for storing the program management data associated with the address in the storage means is provided, when the subprogram is called from the main program, the program management data is referred to, so that there is no time delay. The next reading address can be determined.

また、上記実施例においては、パレットの旋回動作と並列動作命令である最初の工具交換動作を並列動作で実行するように構成し、次パレットのNCプログラム番号の入力が完了したことを検出したときに、現在実行中の加工パレットの加工と並列動作で、次に運転するNCプログラムの容量を算出し、運転バッファの空き容量よりも上記NCプログラムの容量が大きい場合に、該NCプログラムの先頭から運転バッファの空き容量分、該運転バッファに転送するように構成したので、回転テーブル機において、運転するNCプログラムを切り替えるときに(パレットを交換するときに)、NCプログラムを運転バッファに転送する際に要する時間を短縮できる。   Further, in the above embodiment, the pallet turning operation and the first tool change operation which is a parallel operation command are executed in parallel operation, and it is detected that the input of the NC program number of the next pallet is completed. Next, the capacity of the NC program to be operated next is calculated in parallel operation with the machining pallet currently being executed, and when the capacity of the NC program is larger than the free capacity of the operation buffer, the head of the NC program is calculated. When the NC program to be operated is switched (when the pallet is exchanged) in the rotary table machine, the NC program is transferred to the operation buffer. Can be shortened.

更に、上記実施例では、最初の工具交換動作に対応するNCプログラムが転送されている場合には、現在の加工パレットの加工が終了したときに、パレットの旋回動作と最初の工具交換動作を並列動作で実行し、加えて、パレットの旋回動作並びに最初の工具交換動作と並列動作で、次に運転するNCプログラムを転送されたNCプログラムの最後のアドレスまたは転送されなかった最初のアドレスに基づいて運転バッファに転送するように構成したので、NCプログラムを運転バッファに転送する際に要する時間をより一層短縮することができる。   Further, in the above embodiment, when the NC program corresponding to the first tool change operation is transferred, the pallet turning operation and the first tool change operation are performed in parallel when the machining of the current machining pallet is completed. In addition to the pallet swiveling operation as well as the first tool change operation, the next NC program to be operated is based on the last address of the transferred NC program or the first address not transferred Since it is configured to transfer to the operation buffer, the time required for transferring the NC program to the operation buffer can be further reduced.

尚、上記実施例においては、第1のCPU21と、第2のCPU22との間を、RAM25を介して接続するように構成したが、これに限られるものではなく、第1のCPU21と第2のCPU22間を通信手段で繋ぎ、RAM25は第2のCPU22に接続し、通信手段により、データ転送するように構成し、第1のCPU21が第2のCPU22を介して間接的に読み書きするように構成しても良い。   In the above-described embodiment, the first CPU 21 and the second CPU 22 are connected via the RAM 25. However, the present invention is not limited to this, and the first CPU 21 and the second CPU 22 are connected to each other. The CPUs 22 are connected by communication means, the RAM 25 is connected to the second CPU 22, and data is transferred by the communication means so that the first CPU 21 indirectly reads and writes via the second CPU 22. It may be configured.

本発明の一実施例を示す数値制御装置のブロック図1 is a block diagram of a numerical control apparatus showing an embodiment of the present invention. 工作機械の側面図Side view of machine tool 第2のCPUの主運転の制御のフローチャート(その1)Flow chart of control of main operation of second CPU (Part 1) 第2のCPUの主運転の制御のフローチャート(その2)Flow chart of control of main operation of second CPU (part 2) 第2のCPUの並列運転の制御のフローチャートFlow chart of control of parallel operation of second CPU 第1のCPUの運転の制御のフローチャートFlowchart of operation control of the first CPU 第1のCPUのサブルーチンのフローチャートFlowchart of first CPU subroutine 第1のCPUの他のサブルーチンのフローチャートFlowchart of another subroutine of the first CPU 第1のCPUの他のサブルーチンのフローチャートFlowchart of another subroutine of the first CPU 第1のCPUの他のサブルーチンのフローチャートFlowchart of another subroutine of the first CPU 第1のCPUの他のサブルーチンのフローチャートFlowchart of another subroutine of the first CPU プログラム管理データを説明する図Diagram explaining program management data NCプログラムの親プログラム、子プログラム、孫プログラムの関係を説明する図Diagram explaining the relationship between the parent program, child program, and grandchild program of the NC program NCプログラムを運転バッファに転送するときの動作を説明する図Diagram explaining the operation when transferring NC program to the operation buffer パレット、第1のCPU、第2のCPU等の各動作の時系列な関係を示すタイムチャート(内部メモリ運転の場合)Time chart showing the time-series relationship of each operation of the pallet, first CPU, second CPU, etc. (in the case of internal memory operation) パレット、第1のCPU、第2のCPU等の各動作の時系列な関係を示すタイムチャート(テープ運転の場合(その1))Time chart showing the time-series relationship of each operation of the pallet, the first CPU, the second CPU, etc. (in the case of tape operation (1)) パレット、第1のCPU、第2のCPU等の各動作の時系列な関係を示すタイムチャート(テープ運転の場合(その2))Time chart showing the time-series relationship of each operation of the pallet, the first CPU, the second CPU, etc. (in the case of tape operation (part 2))

符号の説明Explanation of symbols

図面中、1は数値制御装置、2は工作機械、3は主軸、4は工具、8は工具交換装置、9はパレット交換装置、15は工具マガジン、16はパレット交換モータ、17はテーブル、18は第1パレット(加工パレット)、19は第2パレット(加工パレット)、21は第1のCPU、22は第2のCPU、23はRAM、24は不揮発メモリ、25はRAM(記憶手段)、26はリムーバブルディスク、27はRAM、28はROM、29は動力系IF、30は外部入出力IF、31は外側起動スイッチ、32は次プログラム番号入力端子、33は次プログラムready端子、34は次プログラム要求端子、35はワーク交換機構、36はNCプログラムスケジュール装置を示す。   In the drawings, 1 is a numerical controller, 2 is a machine tool, 3 is a spindle, 4 is a tool, 8 is a tool changer, 9 is a pallet changer, 15 is a tool magazine, 16 is a pallet changer motor, 17 is a table, 18 Is a first pallet (processing pallet), 19 is a second pallet (processing pallet), 21 is a first CPU, 22 is a second CPU, 23 is a RAM, 24 is a non-volatile memory, 25 is a RAM (storage means), 26 is a removable disk, 27 is a RAM, 28 is a ROM, 29 is a power system IF, 30 is an external input / output IF, 31 is an external start switch, 32 is a next program number input terminal, 33 is a next program ready terminal, and 34 is a next program ready terminal. A program request terminal, 35 is a workpiece exchange mechanism, and 36 is an NC program schedule device.

Claims (4)

工作機械で運転するNCプログラムをハードディスク等の記憶装置から運転バッファに転送して加工運転を実行するように構成された数値制御装置において、
次に運転するNCプログラム番号を入力する入力手段と、
前記入力手段によってNCプログラム番号の入力が完了したことを検出する完了信号検出手段と、
前記運転バッファの空き容量を算出する空き容量算出手段と、
前記完了信号検出手段によって次に運転するNCプログラム番号の入力の完了を検出したときに、現在実行中の加工と並列動作で、次に運転するNCプログラムの容量を算出するプログラム容量算出手段と、
前記空き容量算出手段によって算出される前記運転バッファの空き容量よりも、前記プログラム容量算出手段によって算出されるNCプログラムの容量が大きい場合に、該NCプログラムの先頭から前記運転バッファの空き容量分、該運転バッファに転送する第1転送手段と、
前記転送手段によって転送されたNCプログラムの最後のアドレスまたは転送されなかった最初のアドレスを記憶するアドレス記憶手段と、
現在実行中のNCプログラムの運転が終了したときに、次に運転するNCプログラムを前記アドレス記憶手段に記憶されたアドレスに基づいて前記運転バッファに転送する第2転送手段とを
備えたことを特徴とする数値制御装置。
In a numerical controller configured to execute a machining operation by transferring an NC program operated by a machine tool from a storage device such as a hard disk to an operation buffer,
Input means for inputting the NC program number to be operated next;
A completion signal detecting means for detecting that the input of the NC program number has been completed by the input means;
Free capacity calculating means for calculating the free capacity of the operation buffer;
A program capacity calculating means for calculating the capacity of the NC program to be operated next in parallel with the machining currently being executed when the completion signal detecting means detects the completion of the input of the NC program number to be operated next;
When the capacity of the NC program calculated by the program capacity calculation means is larger than the free capacity of the operation buffer calculated by the free capacity calculation means, the free capacity of the operation buffer from the head of the NC program, First transfer means for transferring to the operation buffer;
Address storage means for storing the last address of the NC program transferred by the transfer means or the first address not transferred;
And a second transfer means for transferring the NC program to be operated next to the operation buffer based on the address stored in the address storage means when the operation of the NC program currently being executed is completed. Numerical control device.
前記NCプログラムは、メインプログラムとメインプログラムから呼び出されるサブプログラムとから構成されるものであって、前記プログラム容量算出手段は、前記メインプログラムの容量と前記サブプログラムの容量との総和を算出することを特徴とする請求項1に記載の数値制御装置。   The NC program is composed of a main program and a subprogram called from the main program, and the program capacity calculating means calculates the sum of the capacity of the main program and the capacity of the subprogram. The numerical control apparatus according to claim 1. 前記NCプログラムのプログラム番号とサブプログラム番号とを記憶する記憶手段と、前記第1転送手段によってNCプログラムを運転バッファに転送する際、前記サブプログラムのプログラム番号と、該サブプログラム番号の先頭アドレスを対応付けたプログラム管理データを前記記憶手段に記憶させるプログラム管理データ作成手段とを備えたことを特徴とする請求項2に記載の数値制御装置。   Storage means for storing the program number and subprogram number of the NC program, and when the NC program is transferred to the operation buffer by the first transfer means, the program number of the subprogram and the start address of the subprogram number are 3. The numerical control apparatus according to claim 2, further comprising program management data creating means for storing the associated program management data in the storage means. 運転するNCプログラムをハードディスク等の記憶装置から運転バッファに転送して加工運転を実行するように構成されると共に、パレットの旋回動作と工具交換動作を並列動作で実行するように構成された数値制御装置において、
次パレットのNCプログラム番号を入力する入力手段と、
前記入力手段によってNCプログラム番号の入力が完了したことを検出する完了信号検出手段と、
前記運転バッファの空き容量を算出する空き容量算出手段と、
前記完了信号検出手段によって次に運転するNCプログラム番号の入力の完了を検出したときに、現在実行中の加工パレットの加工と並列動作で、次に運転するNCプログラムの容量を算出するプログラム容量算出手段と、
前記空き容量算出手段によって算出される前記運転バッファの空き容量よりも、前記プログラム容量算出手段によって算出されるNCプログラムの容量が大きい場合に、該NCプログラムの先頭から前記運転バッファの空き容量分、該運転バッファに転送する第1転送手段と、
前記転送手段によって転送されたNCプログラムの最後のアドレスまたは転送されなかった最初のアドレスを記憶するアドレス記憶手段と、
最初の工具交換動作に対応するNCプログラムが転送されたか否かを判断する転送判断手段と、
最初の工具交換動作に対応するNCプログラムが転送されている場合には、現在の加工パレットの加工が終了したときに、パレットの旋回動作と最初の工具交換動作を並列動作で実行する実行手段と、
現在の加工パレットの加工が終了したときに、最初の工具交換動作に対応するNCプログラムが転送されている場合には、パレットの旋回動作並びに最初の工具交換動作と並列動作で、次に運転するNCプログラムを前記アドレス記憶手段に記憶されたアドレスに基づいて前記運転バッファに転送する第2転送手段とを
備えたことを特徴とする数値制御装置。
Numerical control configured to transfer the NC program to be operated from a storage device such as a hard disk to the operation buffer and execute the machining operation, and to execute the pallet turning operation and the tool change operation in parallel operation In the device
Input means for inputting the NC program number of the next pallet;
A completion signal detecting means for detecting that the input of the NC program number has been completed by the input means;
Free capacity calculating means for calculating the free capacity of the operation buffer;
Program capacity calculation for calculating the capacity of the next NC program to be operated in parallel operation with the machining pallet currently being executed when the completion signal detection means detects the completion of the input of the NC program number to be operated next. Means,
When the capacity of the NC program calculated by the program capacity calculation means is larger than the free capacity of the operation buffer calculated by the free capacity calculation means, the free capacity of the operation buffer from the head of the NC program, First transfer means for transferring to the operation buffer;
Address storage means for storing the last address of the NC program transferred by the transfer means or the first address not transferred;
Transfer determination means for determining whether or not the NC program corresponding to the first tool change operation has been transferred;
When the NC program corresponding to the first tool change operation is transferred, execution means for executing the pallet turning operation and the first tool change operation in parallel operation when the machining of the current machining pallet is completed. ,
When machining of the current machining pallet is completed, if the NC program corresponding to the first tool change operation is transferred, the pallet turning operation and the first tool change operation are performed in parallel with the next operation. And a second transfer means for transferring the NC program to the operation buffer based on an address stored in the address storage means.
JP2006292733A 2006-10-27 2006-10-27 Numerical controller Active JP4882666B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006292733A JP4882666B2 (en) 2006-10-27 2006-10-27 Numerical controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006292733A JP4882666B2 (en) 2006-10-27 2006-10-27 Numerical controller

Publications (2)

Publication Number Publication Date
JP2008108205A JP2008108205A (en) 2008-05-08
JP4882666B2 true JP4882666B2 (en) 2012-02-22

Family

ID=39441489

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006292733A Active JP4882666B2 (en) 2006-10-27 2006-10-27 Numerical controller

Country Status (1)

Country Link
JP (1) JP4882666B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5136000B2 (en) * 2007-11-05 2013-02-06 トヨタ自動車株式会社 Production instruction device
WO2019019051A1 (en) * 2017-07-26 2019-01-31 深圳配天智能技术研究院有限公司 Input and output control method for slave device, master control device and numerical control system
JP2020184179A (en) * 2019-05-08 2020-11-12 ファナック株式会社 Process control system and process system
CN112801503B (en) * 2021-01-26 2022-08-19 上海金山纸业有限公司 To-be-processed area allocation method and auxiliary device

Also Published As

Publication number Publication date
JP2008108205A (en) 2008-05-08

Similar Documents

Publication Publication Date Title
JP4119372B2 (en) Numerical control method and numerical control system
US8195911B2 (en) Numerical controller capable of dividing and combining memory areas to store machining programs and binary data
JPS62277244A (en) Accommodation control device for machine tool
JP4882666B2 (en) Numerical controller
EP1471404A2 (en) Numerical control apparatus for machine tool
US20160062336A1 (en) Numerical controller for facilitating adjustment of machining motion
WO2022034848A1 (en) Numerical control system and robot control method
JP6687579B2 (en) Numerical control device
JPH09212227A (en) Method for setting operation information of machine controlled and driven by numerical controller
US11320800B2 (en) Optimization device
JP2013233604A (en) Method and device of monitoring control of production apparatus, and production system
JP2006099284A (en) Numerical controller
JP2007233624A (en) Numerical controller of machine tool
JP2009053823A (en) Machining simulation device
JP4112433B2 (en) Numerical control device for machine tool and numerical control method for machine tool
JPH0288139A (en) Exchanging device for tool
JP2000089813A (en) Working program editing method and controller for machine tool
JP2011039701A (en) Numerical control device, method and program
JPH02151909A (en) Control device for industrial machine
JPH0772845B2 (en) NC data creation device
JP2019168804A (en) Machining program editing device
JPH11202917A (en) Managing method for working data and nc device
WO2022196622A1 (en) Numerical control device
JP2712442B2 (en) Shellfish use order determination system
JPS6319007A (en) Data transfer method in numerical controller

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090911

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100826

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: 20111108

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111121

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141216

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4882666

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150