JPH0619518A - Program calling system - Google Patents

Program calling system

Info

Publication number
JPH0619518A
JPH0619518A JP17414792A JP17414792A JPH0619518A JP H0619518 A JPH0619518 A JP H0619518A JP 17414792 A JP17414792 A JP 17414792A JP 17414792 A JP17414792 A JP 17414792A JP H0619518 A JPH0619518 A JP H0619518A
Authority
JP
Japan
Prior art keywords
calling
program
subprograms
group data
subprogram
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
JP17414792A
Other languages
Japanese (ja)
Inventor
Hideshi Kochiya
秀史 古知屋
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.)
Fanuc Corp
Original Assignee
Fanuc Corp
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 Fanuc Corp filed Critical Fanuc Corp
Priority to JP17414792A priority Critical patent/JPH0619518A/en
Publication of JPH0619518A publication Critical patent/JPH0619518A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To make a machining program of an CNC high in flexibility by easily changing the calling order of the machining program. CONSTITUTION:Group data 131 consist of subprograms O0010-O0050, which are given a group number '0001'. Further, a call order number S and a repetitive execution frequency T are set for each of the subprograms. The subprograms are called in order according to the call order numbers S and repeatedly executed as many times as the repetitive execution frequencies T given to the subprograms. The call order numbers S and repetitive execution frequencies T are varied by an operator through a keyboard, etc. Consequently, the order of the caging of the subprograms from a main program can easily be varied. The machining program itself can, therefore, be made high in flexibility.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はCNCの加工プログラム
を呼び出すプログラム呼出し方式に関し、特にサブプロ
グラムの実行順序を容易に変更することができるプログ
ラム呼出し方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program calling method for calling a CNC machining program, and more particularly to a program calling method capable of easily changing the execution order of subprograms.

【0002】[0002]

【従来の技術】一般にCNC(数値制御装置)工作機械
を用いて加工プログラムに基づいてワークを加工する場
合、メインプログラムから数多くのサブプログラムを呼
び出す方法が採られている。この方法では、各サブプロ
グラムはプログラム番号単位で管理されており、その呼
出しは、主にMコードを用いて例えば「M98 Pプロ
グラム番号」の形式で行われる。サブプログラムの実行
順序は、メインプログラムでの呼出し順序となる。
2. Description of the Related Art Generally, when a CNC (Numerical Control Unit) machine tool is used to machine a workpiece based on a machining program, a method of calling many subprograms from a main program is adopted. In this method, each subprogram is managed in program number units, and the calling is mainly performed by using the M code, for example, in the form of "M98P program number". The execution order of the subprograms is the calling order in the main program.

【0003】図5は従来のメインプログラムでのサブプ
ログラム呼出しを示す図である。図に示すように、メイ
ンプログラム「O0001」はMコードによってサブプ
ログラムO0010、O0020、O0030、O00
40、O0050を順に呼び出し、サブプログラムO0
010等は、その順で実行される。なお、プログラム文
中の「L」はサブプログラムO0010等の繰り返し実
行回数を示す。また、Mコードによるサブプログラム呼
出しは「M30」で終了する。
FIG. 5 is a diagram showing a subprogram call in a conventional main program. As shown in the figure, the main program "O0001" is made up of subprograms O0010, O0020, O0030, O00 by M code.
40 and O0050 are called in sequence, and subprogram O0
010 and the like are executed in that order. It should be noted that "L" in the program statement indicates the number of times the subprogram O0010 or the like is repeatedly executed. Further, the subprogram call by the M code ends at "M30".

【0004】[0004]

【発明が解決しようとする課題】ところで、実際の加工
では、メインプログラムで指定した呼出し順序を変更し
なければならないときがある。例えば、呼出し順序を一
部変更して別のワークを加工するような場合である。そ
の場合、従来の方法では、新しく呼出し順序を変更した
メインプログラムを作成したり、呼出し順序変更のため
に条件判別文(IF文)等でメインプログラムの流れを
変えたりする必要がある。このため、サブプログラムの
呼出し順序は、簡単には変更することができず、その点
で従来の加工プログラムは柔軟性に欠けていた。
By the way, in actual machining, there are cases where the calling sequence designated by the main program must be changed. For example, there is a case where a part of the calling sequence is changed to process another work. In that case, in the conventional method, it is necessary to create a new main program in which the calling order is changed, or to change the flow of the main program by a condition determination statement (IF statement) for changing the calling order. For this reason, the calling order of the subprograms cannot be easily changed, and the conventional machining programs lack flexibility in that respect.

【0005】本発明はこのような点に鑑みてなされたも
のであり、呼出し順序を容易に変更することができ、加
工プログラムを柔軟度の高いものとすることができるプ
ログラム呼出し方式を提供することを目的とする。
The present invention has been made in view of the above circumstances, and provides a program calling method in which the calling sequence can be easily changed and the machining program can be made highly flexible. With the goal.

【0006】[0006]

【課題を解決するための手段】本発明では上記課題を解
決するために、CNCの加工プログラムを呼び出すプロ
グラム呼出し方式において、書換え可能な呼出し順序番
号が付されたサブプログラムによって構成されたグルー
プデータを格納するグループデータ格納手段と、メイン
プログラムにおいて前記グループデータが呼び出された
ときに前記呼出し順序番号に従って前記サブプログラム
を順次呼出し実行するサブプログラム呼出し手段と、を
有することを特徴とするプログラム呼出し方式が、提供
される。
In order to solve the above-mentioned problems, the present invention provides a program calling method for calling a CNC machining program, in which group data composed of subprograms with rewritable calling sequence numbers is added. A program call system characterized by comprising group data storage means for storing and subprogram call means for sequentially calling and executing the subprograms according to the calling sequence number when the group data is called in a main program. , Provided.

【0007】[0007]

【作用】グループデータは、複数のサブプログラムによ
って構成され、その各サブプログラムには、書換え可能
な呼出し順序番号が付されている。このグループデータ
はグループデータ格納手段に格納される。メインプログ
ラムの実行中に、グループデータが呼び出されたとき、
サブプログラム呼出し手段は、グループデータ内の呼出
し順序番号に従ってサブプログラムを順次呼び出し実行
する。このように、グループデータ内の呼出し順序番号
に従ってサブプログラムを呼び出し実行する。その呼出
し順序番号は、オペレータがキーボード等を用いて容易
に変更することができる。このため、メインプログラム
からサブプログラムを呼出すその呼出し順序も容易に変
更することができ、その結果、加工プログラムは柔軟度
の高いものとなる。
The group data is composed of a plurality of subprograms, and each subprogram has a rewritable call sequence number. This group data is stored in the group data storage means. When group data is called during execution of the main program,
The subprogram calling means sequentially calls and executes the subprograms according to the calling sequence number in the group data. In this way, the subprogram is called and executed according to the calling sequence number in the group data. The calling sequence number can be easily changed by the operator using a keyboard or the like. Therefore, the calling sequence for calling the subprograms from the main program can be easily changed, and as a result, the machining program becomes highly flexible.

【0008】[0008]

【実施例】以下、本発明の一実施例を図面に基づいて説
明する。図2は本発明に係るグループデータの一例を示
す図である。図に示すように、グループデータ130
は、サブプログラムO0010〜O0050から構成さ
れ、その全体にグループ番号「0001」が付される。
また、各サブプログラムO0010等には、呼出し順序
番号S及び繰り返し実行回数Tが設定される。グループ
データ130は予めオペレータによって作成され、後述
するRAM13(図4)に格納される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 2 is a diagram showing an example of group data according to the present invention. As shown in the figure, the group data 130
Is composed of subprograms O0010 to O0050, and the group number "0001" is given to the whole.
Further, a calling sequence number S and a repeat execution count T are set in each subprogram O0010 and the like. The group data 130 is created in advance by the operator and stored in the RAM 13 (FIG. 4) described later.

【0009】このグループデータ130は、メインプロ
グラムにおいて次のようにグループ番号を用いて簡単に
呼び出され実行される。 O0001; M98 P10001;(グループ番号の呼出しは、
「10000+グループ番号」で行われる。) M30 ; このように、サブプログラムO0010等をグループデ
ータ130のグループ番号を用いて一括して呼び出すよ
うにしたので、図5に示した従来の方法に比べて、サブ
プログラム呼出しを簡単に行うことができる。次に、サ
ブプログラムO0010等の呼出し順序及び繰り返し実
行回数の変更方法について説明する。
The group data 130 is simply called and executed by using the group number in the main program as follows. O0001; M98 P10001; (Calling the group number is
It is performed by "10000 + group number". ) M30; As described above, since the subprograms O0010 and the like are collectively called by using the group number of the group data 130, the subprogram can be called easily as compared with the conventional method shown in FIG. You can Next, a method of changing the calling sequence of the subprogram O0010 and the like and the number of repeated executions will be described.

【0010】図1はサブプログラムの呼出し順序及び繰
り返し実行回数を変更した場合を示す図である。図にお
いて、グループデータ131は、図2に示したグループ
データ130の呼出し順序番号S及び繰り返し実行回数
Tを変更したものである。この呼出し順序番号S及び繰
り返し実行回数Tは、オペレータがキーボード17(図
4)等を用いて変更する。そのときのメインプログラム
は、上述したメインプログラム「O0010」と同じで
あり、グループデータ131は、「M98 P1000
1」によって呼び出される。サブプログラムO0010
等は、グループデータ131内の呼出し順序番号Sに従
って順次呼び出され、そのサブプログラムに付与されて
いる繰り返し実行回数Tだけ繰り返し実行される。
FIG. 1 is a diagram showing a case where the calling order of subprograms and the number of times of repeated execution are changed. In the figure, the group data 131 is obtained by changing the calling sequence number S and the number of repeated executions T of the group data 130 shown in FIG. The calling sequence number S and the number of repeated executions T are changed by the operator using the keyboard 17 (FIG. 4) or the like. The main program at that time is the same as the main program “O0010” described above, and the group data 131 is “M98 P1000”.
1 ”. Subprogram O0010
Etc. are sequentially called in accordance with the calling order number S in the group data 131, and are repeatedly executed for the number of times of repeated execution T given to the subprogram.

【0011】このように、本実施例では、グループデー
タ131内の呼出し順序番号Sに従ってサブプログラム
を呼び出し、そのサブプログラムを繰り返し実行回数T
だけ繰り返し実行する。この呼出し順序番号S及び繰り
返し実行回数Tは、オペレータがキーボード等を用いて
容易に変更することができる。このため、メインプログ
ラムからサブプログラムを呼出すその呼出し順序も容易
に変更することができる。したがって、加工プログラム
そのものを柔軟度の高いものとすることができる。
As described above, in this embodiment, the subprogram is called according to the calling sequence number S in the group data 131, and the subprogram is repeatedly executed T times.
Just repeat. The calling sequence number S and the number of times of repeated execution T can be easily changed by the operator using a keyboard or the like. Therefore, the calling sequence for calling the subprogram from the main program can be easily changed. Therefore, the processing program itself can be made highly flexible.

【0012】図3は本発明のプログラム呼出し方式を実
行するためのフローチャートを示す図である。図におい
て、Sに続く数値はステップ番号を示す。 〔S1〕サブプログラム呼出し指令、すなわち「M9
8」による呼出し指令があったか否かを判別する。呼出
し指令があればステップS2に、そうでなければそのま
ま本プログラムを終了する。 〔S2〕「M98」に続くPの値が10001以上であ
るか否かを判別する。10001以上であればステップ
S3に、そうでなければステップS10に進む。 〔S3〕Pの値から10000を差し引いてグループ番
号を算出する。 〔S4〕ステップS3で得られたグループ番号のグルー
プデータを読み取り、そのグループデータ内の呼出し順
序番号Sの順にサブプログラムを並べ換える。その順番
を呼出し順番Nとする。 〔S5〕呼出し順番Nの初期値を設定し、N=1とす
る。 〔S6〕呼出し順番Nのサブプログラムを呼び出す。 〔S7〕そのサブプログラムに付与されている繰り返し
実行回数Tだけ繰り返し実行したか否かを判別する。繰
り返し実行回数Tだけ実行されていればステップS8
に、そうでなければステップS6に戻る。 〔S8〕呼出し順番Nに値1を加算する。 〔S9〕呼出し順番Nが呼出し順序番号Sの最大値を越
えたか否かを判別する。越えていればそのまま本プログ
ラムを終了し、そうでなければステップS6に戻る。 〔S10〕通常のサブプログラム呼び出しを行う。
FIG. 3 is a diagram showing a flow chart for executing the program calling method of the present invention. In the figure, the numerical value following S indicates a step number. [S1] Subprogram call command, that is, "M9
It is determined whether or not there is a call command by "8". If there is a call command, the process proceeds to step S2, and if not, the present program ends. [S2] It is determined whether the value of P following "M98" is 10001 or more. If it is 10001 or more, the process proceeds to step S3, and if not, the process proceeds to step S10. [S3] The group number is calculated by subtracting 10000 from the value of P. [S4] The group data of the group number obtained in step S3 is read, and the subprograms are rearranged in the order of the calling sequence number S in the group data. The order is called a calling order N. [S5] The initial value of the calling order N is set, and N = 1 is set. [S6] The subprogram with the calling order N is called. [S7] It is determined whether or not the sub-program has been repeatedly executed the number of times T of repetitions. If it has been executed by the repeat execution count T, step S8
Otherwise, the process returns to step S6. [S8] The value 1 is added to the calling order N. [S9] It is determined whether the calling sequence N exceeds the maximum value of the calling sequence number S. If it exceeds, this program is terminated as it is, and if not, the process returns to step S6. [S10] A normal subprogram is called.

【0013】図4は本発明を実施するためのCNCのハ
ードウェアの概略構成図である。プロセッサ11は、R
OM12に格納されたシステムプログラムに従ってCN
C全体を制御する。ROM12には、EPROMあるい
はEEPROMが使用される。RAM13にはSRAM
等が使用され、各種のデータあるいは入出力信号が格納
される。また、上述したように、グループデータ13
0、131が格納される。不揮発性メモリ14には図示
されていないバッテリによってバックアップされたCM
OSが使用され、電源切断後も保持すべきパラメータ等
が格納されている。
FIG. 4 is a schematic block diagram of the hardware of the CNC for implementing the present invention. The processor 11 is R
CN according to the system program stored in OM12
Control C as a whole. EPROM or EEPROM is used for the ROM 12. SRAM in RAM13
Are used to store various data or input / output signals. In addition, as described above, the group data 13
0 and 131 are stored. CM backed up by a battery not shown in the non-volatile memory 14
The OS is used, and the parameters and the like to be retained even after the power is turned off are stored.

【0014】グラフィック制御回路15はディジタル信
号を表示用の信号に変換し、表示画面16に与える。表
示画面16はCRTあるいは液晶表示装置が使用され
る。キーボード17はシンボリックキー、数値キー等か
らなり、必要な図形、データをこれらのキーを使用して
入力する。グループデータ130の作成、その呼出し順
序番号S及び繰り返し実行回数Tの変更は、この表示画
面16及びキーボード17を用いて行われる。
The graphic control circuit 15 converts the digital signal into a signal for display and gives it to the display screen 16. As the display screen 16, a CRT or a liquid crystal display device is used. The keyboard 17 is composed of symbolic keys, numerical keys, etc., and necessary figures and data are input using these keys. The display screen 16 and the keyboard 17 are used to create the group data 130 and change the calling sequence number S and the repeat execution count T.

【0015】PMC(プログラマブル・マシン・コント
ローラ)20はバス21経由でM機能信号等を受けて、
シーケンス・プログラムで処理して、出力信号を出力
し、工作機械25を制御する。また、機械側からの入力
信号を受けて、シーケンス・プログラムで処理を行い、
バス21を経由して、プロセッサ11に必要な入力信号
を転送する。
A PMC (Programmable Machine Controller) 20 receives an M function signal or the like via a bus 21,
Processing is performed by the sequence program, an output signal is output, and the machine tool 25 is controlled. In addition, receiving the input signal from the machine side, processing by the sequence program,
The necessary input signals are transferred to the processor 11 via the bus 21.

【0016】軸制御回路18はプロセッサ11からの軸
の移動指令を受けて、軸の指令をサーボアンプ19に出
力する。サーボアンプ19はこの移動指令を受けて、工
作機械25のサーボモータを駆動する。上記各構成要素
はバス21によって互いに結合されている。
The axis control circuit 18 receives the axis movement command from the processor 11 and outputs the axis command to the servo amplifier 19. The servo amplifier 19 receives the movement command and drives the servo motor of the machine tool 25. The above components are connected to each other by a bus 21.

【0017】[0017]

【発明の効果】以上説明したように本発明では、複数の
サブプログラムによってグループデータを構成し、その
各サブプログラムに書換え可能な呼出し順序を付与する
ようにした。メインプログラムの実行中にグループデー
タが呼び出されると、サブプログラムは、その呼出し順
序番号に従って順次呼び出され実行される。呼出し順序
番号は、オペレータがキーボード等を用いて容易に変更
することができる。このため、メインプログラムからサ
ブプログラムを呼出すその呼出し順序も容易に変更する
ことができる。したがって、加工プログラムそのものを
柔軟度の高いものとすることができる。
As described above, in the present invention, group data is formed by a plurality of subprograms, and a rewritable calling sequence is given to each subprogram. When the group data is called during the execution of the main program, the subprograms are sequentially called and executed according to the calling sequence number. The calling sequence number can be easily changed by the operator using a keyboard or the like. Therefore, the calling sequence for calling the subprogram from the main program can be easily changed. Therefore, the processing program itself can be made highly flexible.

【図面の簡単な説明】[Brief description of drawings]

【図1】サブプログラムの呼出し順序及び繰り返し実行
回数を変更した場合を示す図である。
FIG. 1 is a diagram showing a case where a calling order of subprograms and a number of times of repeated execution are changed.

【図2】本発明に係るグループデータの一例を示す図で
ある。
FIG. 2 is a diagram showing an example of group data according to the present invention.

【図3】本発明のプログラム呼出し方式を実行するため
のフローチャートを示す図である。
FIG. 3 is a diagram showing a flowchart for executing the program calling method of the present invention.

【図4】本発明を実施するためのCNCのハードウェア
の概略構成図である。
FIG. 4 is a schematic configuration diagram of hardware of a CNC for implementing the present invention.

【図5】従来のメインプログラムでのサブプログラム呼
出しを示す図である。
FIG. 5 is a diagram showing a subprogram call in a conventional main program.

【符号の説明】[Explanation of symbols]

11 プロセッサ 12 ROM 13 RAM 14 不揮発性メモリ 15 グラフィック制御回路 16 表示画面 17 キーボード 18 軸制御回路 19 サーボアンプ 20 PMC 21 バス 25 工作機械 130,131 グループデータ S 呼出し順序番号 T 繰り返し実行回数 11 processor 12 ROM 13 RAM 14 non-volatile memory 15 graphic control circuit 16 display screen 17 keyboard 18 axis control circuit 19 servo amplifier 20 PMC 21 bus 25 machine tool 130, 131 group data S calling sequence number T number of repeated executions

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 CNCの加工プログラムを呼び出すプロ
グラム呼出し方式において、 書換え可能な呼出し順序番号が付されたサブプログラム
によって構成されたグループデータを格納するグループ
データ格納手段と、 メインプログラムにおいて前記グループデータが呼び出
されたときに前記呼出し順序番号に従って前記サブプロ
グラムを順次呼出し実行するサブプログラム呼出し手段
と、 を有することを特徴とするプログラム呼出し方式。
1. In a program calling method for calling a CNC machining program, group data storage means for storing group data composed of subprograms having rewritable calling sequence numbers, and the group data in the main program And a subprogram calling means for sequentially calling and executing the subprograms according to the calling sequence number when called.
【請求項2】 前記サブプログラムに付された繰り返し
実行回数に従って前記サブプログラムを繰り返し実行す
るサブプログラム繰り返し実行手段を有することを特徴
とする請求項1記載のプログラム呼出し方式。
2. The program calling system according to claim 1, further comprising sub-program repeat execution means for repeatedly executing the sub-program according to the number of times of repeated execution given to the sub-program.
JP17414792A 1992-07-01 1992-07-01 Program calling system Pending JPH0619518A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17414792A JPH0619518A (en) 1992-07-01 1992-07-01 Program calling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17414792A JPH0619518A (en) 1992-07-01 1992-07-01 Program calling system

Publications (1)

Publication Number Publication Date
JPH0619518A true JPH0619518A (en) 1994-01-28

Family

ID=15973499

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17414792A Pending JPH0619518A (en) 1992-07-01 1992-07-01 Program calling system

Country Status (1)

Country Link
JP (1) JPH0619518A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010116413A1 (en) * 2009-04-07 2010-10-14 三菱電機株式会社 Control device for profiling electric discharge machine
JP2016164721A (en) * 2015-03-06 2016-09-08 株式会社ソディック Numerical control device with processing process management function, and processing process management program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010116413A1 (en) * 2009-04-07 2010-10-14 三菱電機株式会社 Control device for profiling electric discharge machine
CN102387888A (en) * 2009-04-07 2012-03-21 三菱电机株式会社 Control device for profiling electric discharge machine
JP5241917B2 (en) * 2009-04-07 2013-07-17 三菱電機株式会社 Control device for Die-sinker EDM
US8612044B2 (en) 2009-04-07 2013-12-17 Mitsubishi Electric Corporation Control device for die-sinking electrical discharge machine
JP2016164721A (en) * 2015-03-06 2016-09-08 株式会社ソディック Numerical control device with processing process management function, and processing process management program

Similar Documents

Publication Publication Date Title
JPH04176539A (en) Interactive numerical control unit
US4722043A (en) Control system with changable time-shared execution of ladder and non-ladder programs
JPH0766286B2 (en) Processing method of NC device
JPH0619518A (en) Program calling system
EP0512116A1 (en) Method for executing program for cnc equipment
JPH02220102A (en) Sequence program editing system
JP3460747B2 (en) Numerical control unit
JP2921231B2 (en) Programmable controller
JPH06119021A (en) Operation system for controller
JP3327641B2 (en) Numerical control unit
JP2553490B2 (en) Abnormality detection device for sequence control device
JPH06324717A (en) Edit system for sequence program
EP0440806A1 (en) System for controlling program of pc
JPS6217803A (en) Control system for programmable controller
JP3018732B2 (en) Programmable controller
JPH03139703A (en) Timer instruction processing system of programmable controller
JPS59119413A (en) Programmable controller
JPH05297913A (en) Programmable controller
JPS58221405A (en) Programmable controller
JPH01194003A (en) Control system for pc device
JPH01200409A (en) Scheduling operation method
JPH08286712A (en) Editing system for sequence program
JPH0863221A (en) Method for generating program for numerical controller
JPS60101612A (en) Programmable controller
JPS59106005A (en) Programmable controller