JPH03196307A - Numerical controller - Google Patents

Numerical controller

Info

Publication number
JPH03196307A
JPH03196307A JP20186190A JP20186190A JPH03196307A JP H03196307 A JPH03196307 A JP H03196307A JP 20186190 A JP20186190 A JP 20186190A JP 20186190 A JP20186190 A JP 20186190A JP H03196307 A JPH03196307 A JP H03196307A
Authority
JP
Japan
Prior art keywords
macro
numerical control
variable
command
user
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
JP20186190A
Other languages
Japanese (ja)
Inventor
Akira Nagamine
永峰 侃
Hideaki Kawamura
川村 英昭
Mitsuto Miyata
宮田 光人
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 JP20186190A priority Critical patent/JPH03196307A/en
Publication of JPH03196307A publication Critical patent/JPH03196307A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To eliminate the need of modification of software by providing a macro-processing means for executing a prescribed numerical control processing in accordance with a macro-instruction read out of a macro-registration memory in accordance with the contents of a read-out system variable. CONSTITUTION:The controller is provided with a macro-processing means 27 for reading out a system variable contained in a macro-instruction from a variable memory 28, and executing a prescribed numerical control in accordance with the macro-instruction read out of a macro-registration memory 24 in accordance with the contents of this system variable. In such a state, a prescribed user macro is called by a user macro call instruction from the macro-registration memory 24, and at the time of executing the macro-processing corresponding to this user macro in the macro-processing means 27, the state quantity of a numerical controller or a machine tool corresponding to the system variable is read, and in accordance with a function instruction prescribed by the system variable, a system state is discriminated, and at that time, a necessary special numerical control processing function is selected and executed. In such a way, modification of software becomes unnecessary.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、数値制御装置に係り、特に数値制御装置のソ
フトウェアを改造することなくユーザの希望する種々の
特殊処理が行なえる装置に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a numerical control device, and particularly to a device that can perform various special processing desired by a user without modifying the software of the numerical control device.

(従来の技術) 数値制御装置は、紙テープ等から指令された指令プログ
ラムに基いて数値制御処理を実行し、該処理結果により
工作機械を駆動してワークに指令通りの加工を施すもの
である。
(Prior Art) A numerical control device executes numerical control processing based on a command program instructed from a paper tape or the like, and drives a machine tool based on the processing result to process a workpiece according to the command.

第1図はかかる従来の数値制御装置のブロック図である
FIG. 1 is a block diagram of such a conventional numerical control device.

テープリーダ11からブロック毎に読込まれた指令プロ
グラムは、まず、処理装置や制御プログラムメモリ等を
内蔵する制御装置12に入力される。ついで、制御装置
12は該指令プログラムに応じた数値制御処理を実行し
、工作機械のサーボモータを駆動してテーブル又は刃物
を移動指令通りに移動せしめ、或いは強電制御装置13
を介して工作機械14のクーラントのオン/オフ、スピ
ンドル正転/逆転/停止等の制御を行なう。
A command program read block by block from the tape reader 11 is first input to a control device 12 that includes a processing device, a control program memory, and the like. Next, the control device 12 executes numerical control processing according to the command program and drives the servo motor of the machine tool to move the table or cutter according to the movement command, or the high-power control device 13
Controls such as turning on/off the coolant of the machine tool 14, normal rotation/reverse rotation/stopping of the spindle, etc.

尚、15は原点復帰、ジョグ等を指令するスイッチ、釦
類等を有する操作盤、16は手動によりlブロックの指
令データ等を入力するマニュアル・データ・インプット
装置(以後MDIという)、17は機械現在位置等を表
示する表示ユニットであり、各装置11〜17(工作機
械14は除く)によりコンピュータ数値制御装置(CN
Cという)が構成されている。
In addition, 15 is an operation panel having switches, buttons, etc. for commanding return to origin, jog, etc., 16 is a manual data input device (hereinafter referred to as MDI) for manually inputting command data of the l block, etc., and 17 is a machine. This is a display unit that displays the current position, etc., and each device 11 to 17 (excluding the machine tool 14) is a computer numerical control device (CN
C) is configured.

ところで従来の数値制御装置に与えられていた指令には
、移動指令、速度指令、工作機械に所定の機械動作を指
示する補助機能命令、主軸の回転数を指示する主軸機能
命令、工具交換を指示する工具機能命令、その他準備機
能命令などがあって、それらが順次に読み込まれる時に
、このCNCにおける制御装置12は、それらの指令を
解読して実行していたから、工作機械や処理装置(CP
U)等の内部状態、或はそこに外部からオペレータが設
定した状態信号に応じて指令プログラムの順序を変更す
ることはできなかった。
By the way, the commands given to conventional numerical control devices include movement commands, speed commands, auxiliary function commands that instruct the machine tool to perform predetermined mechanical operations, spindle function commands that instruct the spindle rotation speed, and tool exchange instructions. There are tool function commands to perform and other preparation function commands, etc., and when they are sequentially read, the control device 12 in this CNC decodes and executes those commands, so the machine tool and processing device (CP
It was not possible to change the order of the command programs in accordance with the internal state of the system, such as U), or a state signal set there by an operator from the outside.

(発明が解決しようとする問題点) ところが最近のCNCは機能の向上が要求されてきてお
り、工作機械やNCの状態に応じてその処理内容を指令
プログラムから指令する機能が必要になってきた。また
一般にCNCのソフトウェアは標準的な工作機械の制御
が行なえるように作られているが、工作機械によって、
或いは同種の工作機械でもユーザによって特殊な工作機
械制御が必要とされる場合がある。
(Problem to be solved by the invention) However, in recent years, CNCs have been required to have improved functionality, and it has become necessary to have the ability to command the processing content from a command program depending on the state of the machine tool or NC. . Additionally, CNC software is generally designed to control standard machine tools, but depending on the machine tool,
Or even for the same type of machine tools, the user may require special machine tool control.

このような場合、従来はその都度CNCのソフトウェア
を改造し特殊仕様通りの制御が行なえるようにしていた
。即ち、数値制御メーカは特殊な工作機械制御が要求さ
れる毎にその都度ソフトウェアを改造しており、このた
め多大の労力と時間を必要とし、人件費の増大、ひいて
はコストアップの弊害を招来していた。
In such cases, conventionally the CNC software has been modified each time to enable control in accordance with the special specifications. In other words, numerical control manufacturers modify software each time a special machine tool control is required, which requires a great deal of effort and time, resulting in increased labor costs and, ultimately, increased costs. was.

そこで、従来からパートプログラム中に、定数は異なっ
ているがステートメントそのものは同じという命令群が
存在するとき、その都度プログラムをしなくてもすむよ
うに、そのグループにマクロ定義をほどこして、それに
特定シンボルを与えて格納し、マクロ識別名を含むマク
ロ呼出命令がプログラムされた指令プログラムからそれ
を呼び出して数値制御処理を行なおうという考えはあっ
た。
Therefore, traditionally, when there is a group of instructions in a part program that have different constants but the same statement, in order to avoid having to program each time, a macro definition is added to that group and a specific symbol is added to it. There was an idea to perform numerical control processing by giving and storing a macro name and calling it from a command program programmed with a macro call command including a macro identification name.

マクロ定義のひとつに、カスタムマクロ、或はユーザマ
クロといわれるプログラム手法がある。
One type of macro definition is a programming method called a custom macro or user macro.

これは、ユーザや機械メーカが作成した一群の命令で構
成される機能を予めNC装置に登録しておき、あたかも
専用のソフトが組み込まれているかの様に、いつでも簡
単な手順で、マクロを呼び出して使用することができる
機能である。
This allows a function consisting of a group of commands created by the user or machine manufacturer to be registered in advance in the NC device, and the macro can be called up at any time using a simple procedure, just as if special software had been installed. This is a function that can be used with

ある−群の命令で構成されるマクロプログラムは、その
後通常のプログラムに代表命令を書くことにより特殊な
機能を実行できる点では、一種のサブプログラムである
が、通常の指令のみでプログラムが構成されるのではな
(、変数、演算指令、制御指令を使用して構成すること
ができ、更にマクロ呼び出し指令との間で引数(パラメ
ータ)の受は渡しが可能であるため、使用する工作機械
を含む数値制御システムにマツチした仕様や、ユーザ独
自の固定サイクルや自動プログラミングが実現できる。
A macro program composed of a certain group of instructions is a type of subprogram in that a special function can be executed by subsequently writing representative instructions in a normal program, but a macro program is a type of subprogram that is composed of only normal instructions. It can be configured using variables, calculation commands, and control commands, and it is also possible to pass arguments (parameters) to and from macro call commands. It is possible to create specifications that match the numerical control system, as well as user-specific fixed cycles and automatic programming.

ここでは、登録される一群の命令をユーザマクロ本体或
は単にマクロといい、代表命令をユーザマクロ命令、或
はマクロ呼出命令という。
Here, a group of registered commands is referred to as a user macro body or simply a macro, and a representative command is referred to as a user macro command or a macro call command.

ここで変数とは、マクロの中にあって、あるアドレスに
直接に数値を与えるのではなく、マクロを呼び出して実
行する際に定義されている変数に値を与えて使用される
ものであって、これによって、マクロに融通性と汎用性
を付与するものである。
Here, a variable is something that exists in a macro and is used by giving a value to a variable defined when calling and executing a macro, rather than giving a numerical value directly to a certain address. , which gives macros flexibility and versatility.

例えば、変数は#に続く変数番号i (1,2、・・・
)によって指定し、 #i と表現することができる。即ち#5、#109、#10
05という様に。
For example, the variable is # followed by variable number i (1, 2,...
) and can be expressed as #i. i.e. #5, #109, #10
Like 05.

また、変数番号としては、自然数のほか、式を使用する
ことも可能であり、その場合には、#[#100]、#
 [#1001−1]、# [#6/2]という様にな
る。
In addition to natural numbers, expressions can also be used as variable numbers; in that case, #[#100], #
[#1001-1], # [#6/2], etc.

さらにアドレスに続く数値を変数で置換することもでき
る。即ちくアドレス〉#i又はくアドレス〉−#iとプ
ログラムすれば、変数の値をそのまま、又はその補数を
、そのアドレスの指令値とすることを意味する。
You can also replace the number following the address with a variable. That is, programming kuaddress>#i or kuaddress>-#i means that the value of the variable is used as it is, or its complement is used as the command value for that address.

ところがこのように変更可能なマクロ変数に代入できる
数は、従来では指令プログラム中のマクロ呼出命令であ
るコールステートメント中で直接に指定される数値に限
られている。そのため機械からの入力信号、機械側への
出力信号の送出制御等の処理機能を直接にプログラムで
実行させるとき、こうした工作機械が有する複数種類の
数値制御処理機能に対応した変数を持たせることができ
ず、数値制御装置の有する多様な機能をユーザが更に独
自に拡張してマクロ命令を構成するうえで、不十分であ
った。
However, the number that can be assigned to a macro variable that can be changed in this way is conventionally limited to a value that is directly specified in a call statement that is a macro call instruction in a command program. Therefore, when directly executing processing functions such as controlling input signals from the machine and sending output signals to the machine side, it is necessary to have variables that correspond to the multiple types of numerical control processing functions that these machine tools have. Therefore, it was insufficient for users to independently expand the various functions of the numerical control device and configure macro instructions.

従って、本発明は工作機械に対する特殊な制御が要求さ
れても、数値制御機能に対応するマクロ命令を呼び出す
マクロ呼出命令をプログラムしておくだけで、CNCの
ソフトウェアを何等改造せずに対処できる低コストの数
値制御装置を提供することを目的としている。
Therefore, even if special control is required for a machine tool, the present invention can handle the problem without modifying the CNC software by simply programming a macro call command that calls a macro command corresponding to the numerical control function. The purpose is to provide a cost numerical control device.

(問題点を解決するための手段) この目的は本発明において、マクロ識別名を含むユーザ
マクロ呼出命令がプログラムされた指令プログラムに基
づいて数値制御処理を実行し、該処理結果により工作機
械を駆動してワークに指令代表する状態量を変数値とす
るシステム変数を記憶した変数メモリと、工ないし複数
のシステム変数を含み前記マクロ識別名により識別可能
な複数の機能命令をマクロ命令として予め記憶している
マクロ登録メモリと、このマクロ登録メモリから前記マ
クロ命令を呼び出したとき前記変数メモリからマクロ命
令に含まれるシステム変数を読出しこのシステム変数の
内容に応じて前記マクロ登録メモリから読出されたマク
ロ命令に従って所定の数値制御処理を実行するマクロ処
理手段とを有することを特徴とする数値制御装置により
達成される。
(Means for Solving the Problem) This purpose is to execute numerical control processing based on a command program in which a user macro calling command including a macro identification name is programmed, and to drive a machine tool based on the processing result. A variable memory stores system variables whose variable values are representative state quantities, and a plurality of function commands that can be identified by the macro identification name and that include one or more system variables are stored in advance as macro commands. A macro registration memory that includes a macro instruction, and when the macro instruction is called from this macro registration memory, a system variable included in the macro instruction is read from the variable memory, and a macro instruction that is read from the macro registration memory according to the contents of this system variable. This is achieved by a numerical control device characterized in that it has a macro processing means for executing predetermined numerical control processing according to the following.

(作用) 本発明によれば、マクロ登録メモリ(24)からユーザ
マクロ呼出命令により所定のユーザマクロを呼出し、マ
クロ処理手段(27)において該ユーザマクロに応じた
マクロ処理を実行する際に、システム変数に対応する数
値制御装置或は工作機械の状態量を読みとって、システ
ム変数により規定された機能命令に従ってシステム状態
を判別して、その時点で必要とされる特殊の数値制御処
理機能を選択して実行できる。
(Operation) According to the present invention, when a predetermined user macro is called from the macro registration memory (24) by a user macro call command and the macro processing means (27) executes macro processing according to the user macro, the system It reads the state quantity of the numerical control device or machine tool corresponding to the variable, determines the system state according to the function command specified by the system variable, and selects the special numerical control processing function required at that time. It can be executed by

(実施例) 以下、本発明の実施例を図面に従って詳細に説明する。(Example) Embodiments of the present invention will be described in detail below with reference to the drawings.

第2図は本発明に係るCNCのブロック図である。FIG. 2 is a block diagram of a CNC according to the present invention.

図中、21は指令プログラムが穿孔されている指令テー
プ、22はl又は複数のユーザマクロが穿孔されている
ユーザマクロ指令テープである。
In the figure, 21 is a command tape on which a command program is perforated, and 22 is a user macro command tape on which l or a plurality of user macros are perforated.

ここで各ユーザマクロは、第3図の如く少なくとも■マ
クロ識別名(たとえば09001)と■後述するシステ
ム変数を用いた命令とから構成され、それらの命令の最
終行には、たとえばM99*(*はエンド・オプ・ブロ
ックを、M99はマクロの終りをそれぞれ意味する)が
プログラムされている。
As shown in FIG. 3, each user macro consists of at least (1) a macro identification name (for example, 09001) and (2) an instruction using a system variable, which will be described later. M99 means the end op block and M99 means the end of the macro) are programmed.

以下に、ユーザマクロの一例を示す。ここで#3001
がシステム変数である。
An example of a user macro is shown below. Here #3001
is a system variable.

09001* #3001=O* WHILE [#3001LE#2] DOIEND1
* M99* 変数は、その変数番号(3001或は20など)により
、ローカル変数、コモン変数、システム変数に分類され
る。
09001* #3001=O* WHILE [#3001LE#2] DOIEND1
*M99* Variables are classified into local variables, common variables, and system variables according to their variable numbers (3001, 20, etc.).

ローカル変数とは、マクロ内でローカルに使用される変
数であって、その変数番号には1〜33が使用される。
A local variable is a variable that is used locally within a macro, and the variable numbers 1 to 33 are used.

即ちある時点で呼び出したマクロで使用しているローカ
ル変数#iと他の時点で呼び出したマクロで使用してい
る#iとは(iが同じ値かどうかを問わず)、別のもの
として扱われる。従って、多重呼び出しのように、マク
ロAから別のマクロBを呼ぶような場合、マクロAで使
用しているローカル変数をマクロBで誤って使用してそ
の値を破壊してしまうというおそれはない。このローカ
ル変数は、引数の受は渡しに使用される。
In other words, local variable #i used in a macro called at one point in time and #i used in a macro called at another point in time (regardless of whether or not i has the same value) are treated as different things. be exposed. Therefore, when macro A calls another macro B, such as in multiple calls, there is no risk that a local variable used in macro A will be accidentally used in macro B and its value will be destroyed. . This local variable is used for receiving and passing arguments.

コモン変数の変数番号には100〜199.500〜9
99が使用される。ローカル変数がマクロ内でローカル
に使用されるのに対して、メインプログラム或はそこか
ら呼ばれたサブプログラム、各マクロを通じて、コモン
変数は共通に使用される。従って、あるマクロAで使用
している#iと他のマクロで使用する#iとが同じもの
であって、一方のマクロで演算した結果のコモン変数を
、別のマクロで使用することができる。
Variable numbers of common variables are 100-199.500-9
99 is used. While local variables are used locally within a macro, common variables are used in common throughout the main program, subprograms called from it, and each macro. Therefore, #i used in one macro A and #i used in another macro are the same, and the common variable resulting from the operation in one macro can be used in another macro. .

更にシステム変数は、後述するシステム変数メモリに格
納されるものであって、ローカル変数やコモン変数とは
異なり、工作機械が有する複数種類の数値制御処理機能
に対応する変数番号(シス1 テム符号)が割り当てられていて、工作機械或はNC装
置の内部状態等の状態量に応じて決定される変数となる
ものである。
Furthermore, system variables are stored in the system variable memory described later, and unlike local variables and common variables, they are variable numbers (system codes) that correspond to multiple types of numerical control processing functions possessed by the machine tool. is assigned and becomes a variable determined according to the state quantity such as the internal state of the machine tool or NC device.

又、上記指令テープ21から読み込まれる指令プログラ
ムには、通常の指令のほかに、マクロ識別名を含むユー
ザマクロ呼出命令(ユーザマクロコール)がプログラム
され、適宜のプログラムステップにて所定のユーザマク
ロを呼出すことにより、該ユーザマクロに応じた処理の
実行が可能である。このユーザマクロ呼出命令は、少な
くともG65(ユーザマクロ呼出しのG機能命令)と、
例えばP4O10(Pは9001がマクロ識別名である
ことを示すワードアドレス、9001はマクロ識別名)
とを有している。
Furthermore, in addition to normal commands, the command program read from the command tape 21 is programmed with a user macro call command (user macro call) including a macro identification name, and a predetermined user macro is called at an appropriate program step. By calling it, it is possible to execute processing according to the user macro. This user macro call command includes at least G65 (G function command for user macro call),
For example, P4O10 (P is a word address indicating that 9001 is a macro identifier, 9001 is a macro identifier)
It has

23は紙テープリーグであり、指令テープ21.22に
穿孔されている指令を読取る。24はマクロ登録メモリ
であり、ユーザマクロ指令テープ22から読取られた複
数のユーザマクロが該メモリに記憶される。25は判別
回路であり、26は通常処理部、27はユーザマクロ処
理部で 2 ある。これら処理部26.27はそれぞれ演算部、制御
部、メモリ等を内蔵している。テープリーダ23から判
別回路25に読込まれた情報がユーザマクロ本体であれ
ば(ワードアドレスOにより識別する)、これをマクロ
登録メモリ24に転送記憶せしめ、通常指令であれば次
段の通常処理部26へ送出し、又ユーザマクロ呼出命令
であれば該当するユーザマクロ処理部27へ送出する。
Reference numeral 23 denotes a paper tape league, which reads commands punched in the command tapes 21 and 22. 24 is a macro registration memory in which a plurality of user macros read from the user macro instruction tape 22 are stored. 25 is a discrimination circuit, 26 is a normal processing section, and 27 is a user macro processing section. Each of these processing units 26 and 27 includes a calculation unit, a control unit, a memory, and the like. If the information read into the discrimination circuit 25 from the tape reader 23 is the user macro itself (identified by the word address O), it is transferred to the macro registration memory 24 and stored therein, and if it is a normal command, it is sent to the next stage normal processing section. 26, and if it is a user macro calling command, it is sent to the corresponding user macro processing unit 27.

尚、これら処理部26.27を共通に構成してもよい。Note that these processing units 26 and 27 may be configured in common.

また通常の指令とユーザマクロ本体とは1つのテープに
混在することはなくそれぞれ別々のテープから人力され
る。
Further, normal commands and user macro bodies are not mixed on one tape, but are manually input from separate tapes.

28は、工作機械が有する複数種類の数値制御処理機能
のそれぞれに対応するシステム符号が割り当てられると
ともに該システム符号に割り当てられた機能命令により
実行される処理内容を規定するシステム変数を記憶した
変数メモリであり、通常処理部26及びユーザマクロ処
理部27の双方から参照できるようになっている。各シ
ステム変数#iはその変数番号iに応じてシステム内で
の用途が固定される。
Reference numeral 28 denotes a variable memory in which system codes corresponding to each of the plurality of types of numerical control processing functions possessed by the machine tool are assigned, and system variables that define the processing contents to be executed by the function commands assigned to the system codes are stored. , and can be referenced by both the normal processing section 26 and the user macro processing section 27. The use of each system variable #i within the system is fixed according to its variable number i.

即ち、この変数メモリ28内のマクロ用DI領域では、
#1000〜#1035がそれぞれ工作機械との間で授
受される16ビツトの入力信号からなるインタフェース
信号をその変数値として記憶し、マクロ用DO領域では
、#1100〜#1135がそれぞれ工作機械との間で
授受される16ビツトの出力信号からなるインタフェー
ス信号をその変数値として記憶し、工具オフセット用領
域では、#2001〜#2099がそれぞれ99種類の
工具のオフセット量をその変数値として記憶し、マクロ
アラーム用領域では、#3000がマクロ中の誤りを検
出したときNG装置をアラームにする信号をその変数値
として記憶し、クロック領域では、#3001、#30
02がそれぞれ基準時刻からの経過時間に関するクロッ
ク信号をその変数値として記憶し、自動運転制御領域で
は、#3003がシングルブロック停止の抑制或はその
解除に関する信号をその変数値として記憶し、位置記憶
域では、#3004がフィードホールド、フィードレー
トオーバライドの無効或はその解除に関する信号をその
変数値として記憶し、モーダル情報領域では、#400
0〜#4012がそれぞれモーダル指令の現在値信号を
その変数値として記憶し、機械座標領域では、#500
1〜#5104が各種機械位置をその変数値として記憶
している。
That is, in the macro DI area in this variable memory 28,
#1000 to #1035 each store an interface signal consisting of a 16-bit input signal exchanged with the machine tool as its variable value, and in the macro DO area, #1100 to #1135 respectively store the interface signal consisting of a 16-bit input signal exchanged with the machine tool. An interface signal consisting of a 16-bit output signal exchanged between the two is stored as its variable value, and in the tool offset area, #2001 to #2099 each store the offset amount of 99 types of tools as its variable value, In the macro alarm area, a signal that alarms the NG device when #3000 detects an error in the macro is stored as a variable value, and in the clock area, #3001, #30
02 stores a clock signal related to the elapsed time from the reference time as its variable value, and in the automatic operation control area, #3003 stores a signal related to suppression or cancellation of single block stop as its variable value, and position storage. In the area, #3004 stores a signal regarding invalidation or cancellation of feed hold and feed rate override as its variable value, and in the modal information area, #400
0 to #4012 respectively store the current value signal of the modal command as its variable value, and in the machine coordinate area, #500
1 to #5104 store various machine positions as variable values.

29は、工作機械、表示ユニット、テープパンチャ等と
の入出力のインタフェースを司るインタフェイス回路で
ある。30は工作機械、31はMDI、32は表示ユニ
ット、33は操作盤である。34はアドレス変換ユニッ
トで、変数番号iを変数メモリ28のアドレスに変換す
る。
Reference numeral 29 denotes an interface circuit that controls input/output interfaces with machine tools, display units, tape punchers, and the like. 30 is a machine tool, 31 is an MDI, 32 is a display unit, and 33 is an operation panel. 34 is an address conversion unit that converts the variable number i into an address of the variable memory 28.

さて、予めユーザマクロ指令テープ22から複数のユー
ザマクロがユーザマクロ登録メモリ24に記憶されてお
り、この状態で指令テープ21かも指令プログラムが読
み込まれたものとする。読み込まれた指令が通常のNC
指令であれば、該NC指令は通常処理部26に入力され
、従来と同様のNC処理が実行される。又、指令がユー
ザマ 5 クロ呼出命令であれば、判別回路25はユーザマクロ登
録メモリ24から該当するユーザマクロを呼び出し、こ
れをユーザマクロ処理部27に入力し、後述のユーザマ
クロ処理を行う。
Now, it is assumed that a plurality of user macros from the user macro instruction tape 22 are stored in the user macro registration memory 24 in advance, and in this state, the instruction tape 21 is also loaded with an instruction program. The read command is a normal NC
If it is a command, the NC command is input to the normal processing section 26, and the same NC processing as the conventional one is executed. If the command is a user macro calling command, the discrimination circuit 25 calls the corresponding user macro from the user macro registration memory 24, inputs it to the user macro processing section 27, and performs user macro processing to be described later.

なお、指令テープ21.22からユーザマクロたけてな
く指令プログラムをもマクロ登録メモリ24に予め記憶
させておき、該記憶したNC指令を順次に読み出してN
C処理を実行するいわゆるメモリ運転方式とした場合に
は、NCの操作盤33上のモード選択スイッチをテープ
編集モードにしてプログラムの読み込みを行い、その後
NC処理に際しては該モード選択スイッチを自動モード
にする。
Incidentally, the user macros and command programs from the command tapes 21 and 22 are stored in advance in the macro registration memory 24, and the stored NC commands are sequentially read out and the N.
When using the so-called memory operation method for executing C processing, the mode selection switch on the NC operation panel 33 is set to tape editing mode to read the program, and then the mode selection switch is set to automatic mode for NC processing. do.

次に本発明の詳細な説明する。Next, the present invention will be explained in detail.

(A)ユーザマクロの登録 インタフェース信号(機械側への出力信号、機械側から
の入力信号)の読取り及び送出についてのユーザマクロ
; 機械側にたとえば工具の移動量を指示する10種類のダ
イヤルがあり、ある条件により所定のダ 6 イヤル値(10進3桁)を読取り、その値に基いて工具
移動を制御しなければならないものとする。さて、第3
番目のダイヤルから設定値を読出さなければならないも
のとすれば、以下のユーザマクロを作成してユーザマク
ロ登録メモリ24に登録しなければならない。
(A) User macro registration interface User macro for reading and sending signals (output signals to the machine side, input signals from the machine side); For example, there are 10 types of dials on the machine side that instruct the amount of tool movement. , it is assumed that a predetermined dial value (3 decimal digits) must be read under certain conditions and tool movement must be controlled based on that value. Now, the third
If it is necessary to read the setting value from the th dial, the following user macro must be created and registered in the user macro registration memory 24.

091001                ・・・
■# 1132= # 1132A N D 4960
 R# 1   ・・・■G 65  P 9101 
 T 60*          ・・・■#100 
=B I N [#1032AND4095]*  ・
・・■I F#2012EQOGOT、091001 
   ・・・■#100 =−#100       
     ・・・■N 9100  M 99*   
          ・・・■ユーザマクロは、先に述
べた様に一般に、変数、演算指令、制御指令の使用が可
能になる点で、通常のサブプログラムとは異なるもので
あって、ここでは、変数の定義、置換の指令=、論理積
演算指令AND、論理和演算指令OR,BCDからの変
換指令BINが使用され、これらによって、変数間での
種々な演算が一般の算術式と同じにプログラムすること
ができる。又、プログラムの流れを制御する制御指令の
ひとつである、IF〈条件式>GOTOnは、〈条件式
〉が成立する場合に、同一プログラム内のシーケンス番
号nの付いたブロックから、次に実行するように指令す
るものである。ここで、条件式EQとは=を意味し、そ
のほかにNE、GT、LT、GE、LEがそれぞれ≠、
 >、 <、≧、≦を意味する記号として使用できる。
091001...
■# 1132 = # 1132A N D 4960
R# 1...■G 65 P 9101
T 60* ・・・■#100
=B I N [#1032AND4095]* ・
・・■IF#2012EQOGOT, 091001
...■#100 =-#100
...■N 9100 M 99*
... As mentioned above, user macros are generally different from normal subprograms in that they allow the use of variables, calculation commands, and control commands. , substitution command =, logical product operation command AND, logical sum operation command OR, and conversion command BIN from BCD are used, and by these, various operations between variables can be programmed in the same way as general arithmetic expressions. can. In addition, IF <conditional expression>GOTOn, which is one of the control commands that controls the flow of the program, executes the next block in the same program starting from the block with the sequence number n when the <conditional expression> is satisfied. It instructs them to do so. Here, the conditional expression EQ means =, and in addition, NE, GT, LT, GE, and LE are each ≠,
Can be used as symbols to mean >, <, ≧, ≦.

上記ユーザマクロのうち■はマクロ識別名を指示するブ
ロックで、09100はBOD5桁を読取るユーザマク
ロ識別名である。■はアドレスデータ送出用のブロック
である。さて、機械側へ出力するデータは本発明におい
て第4図(b)に示す如く16ビツトで構成されており
、第1乃至第4ビツトに機械へ出力するアドレスデータ
が書込まれている。但し、第5ビツト乃至第9ビツトは
他の目的に使用され、第10ビツトから第16ビツト迄
は使用されない。尚、ローカル変数#lと対応する変数
レジスタ(これは、上記変数メモリ28の一部を構成し
ている。)には、第3番目のダイヤルを指示するアドレ
スデータがその変数値として書込まれており、しかもシ
ステム変数#1132とに対応する変数レジスタには、
前回の処理において出力された第4図(b)に示す16
ビツトデータがその変数値として格納されているものと
する。
Among the above user macros, ■ is a block that indicates a macro identification name, and 09100 is a user macro identification name that reads 5 digits of BOD. 3 is a block for sending address data. Now, in the present invention, the data to be output to the machine side is composed of 16 bits as shown in FIG. 4(b), and the address data to be output to the machine is written in the first to fourth bits. However, the 5th to 9th bits are used for other purposes, and the 10th to 16th bits are not used. Note that address data instructing the third dial is written as the variable value in the variable register (this constitutes a part of the variable memory 28) corresponding to the local variable #l. and in the variable register corresponding to system variable #1132,
16 shown in FIG. 4(b) output in the previous process
Assume that bit data is stored as the variable value.

従って、10進の496は、第5ビツトから第9ビツト
までが1で他のビットが0の2進数によって表現される
ため、■のAND (論理積)によって# 1132の
第5ビツト乃至第9ビツトの内容が保存され、OR(論
理和)によって# 1132の第1乃至第4ビツトに今
回読出すべき第3番目のダイヤルのアドレスデータが書
込まれる。
Therefore, the decimal number 496 is expressed as a binary number in which the 5th to 9th bits are 1 and the other bits are 0, so by AND (logical product) of ■, the 5th to 9th bits of #1132 are The contents of the bits are saved, and the address data of the third dial to be read this time is written into the first to fourth bits of #1132 by OR (logical sum).

■は、前記■のアドレスデータを機械側に送出した後、
機械側がダイヤルにセットした値を出力できるようにな
る迄の時間(60m5ec)を待つユーザマクロ命令で
ある(尚、この命令については後述する)。
■After sending the address data of ■ above to the machine side,
This is a user macro command that waits for the time (60 m5ec) until the machine side can output the value set on the dial (this command will be described later).

■はダイヤルにセットしたBOD5桁の値を読 9 取って2進数に変換する命令である。さて、システム変
数# 1032の変数レジスタには第4図(a)に示す
如き16ビツトのデータが60 m5ec経過後に機械
側から出力されて書込まれている。尚、第4図(a)中
、第1〜第12ビツトにはBOD5桁(ダイヤル値)が
書込まれ、第13ビツトにはその符号が書込まれ、第1
4ビツトから第16ビツトは他の目的に使用される。従
って、# 1032に対応する変数レジスタの内容と4
095 (オール” 1 ” )とのANDをとればこ
の変数レジスタの第1〜第12ビツトに書込まれている
BOD5桁が抽出され2進化されて、コモン変数#10
0の変数レジスタ(これも、上記変数メモリ28の一部
を構成している。)に書込まれる。そして、■で符号の
正負が判定され、負であれば、■で符号を反転し、■の
M99によりユーザマクロは終了する。
■ is a command to read the 5-digit BOD value set on the dial and convert it into a binary number. Now, 16-bit data as shown in FIG. 4(a) is output from the machine and written into the variable register of system variable #1032 after 60 m5ec has elapsed. In FIG. 4(a), the 5-digit BOD (dial value) is written in the 1st to 12th bits, the code is written in the 13th bit, and the 1st
Bits 4 through 16 are used for other purposes. Therefore, the contents of the variable register corresponding to #1032 and 4
095 (all "1"), the 5 BOD digits written in the 1st to 12th bits of this variable register are extracted and binarized, and the common variable #10 is obtained.
0 variable register (which also forms part of the variable memory 28). Then, the sign is determined to be positive or negative in step 2, and if it is negative, the sign is inverted in step 2, and the user macro ends in M99 in step 2.

第5図は、第3番目のダイヤルに設定したBOD5桁の
読出制御を説明する回路図である。
FIG. 5 is a circuit diagram illustrating readout control of the 5-digit BOD set on the third dial.

図中、#1032R,#1132Rはシステム変 0 数#1032.#1132に対応する変数レジスタであ
り、それぞれ16ビツトの人力データおよび出力データ
を変数値として記憶する。RII〜R116は人力デー
タ用のリレーril−ri16はその接点、ROI〜R
016は出力データ用のリレー ro1〜ro16はそ
の接点、Trl〜Tr16はトランジスタ、DL1〜D
LIOは符合付きBCD3桁設定用のダイヤル、SWC
は選択回路である。なお、BCDであるため各桁からそ
れぞれ4本の線が選択回路SWCに入力されている。
In the figure, #1032R and #1132R are system variables #1032. This is a variable register corresponding to #1132, and stores 16-bit manual data and output data as variable values. RII~R116 is the relay for human data data ril-ri16 is its contact point, ROI~R
016 is a relay for output data, ro1 to ro16 are its contacts, Trl to Tr16 are transistors, DL1 to D
LIO is a signed BCD 3-digit setting dial, SWC
is a selection circuit. Note that since it is a BCD, four lines from each digit are input to the selection circuit SWC.

さて、前記ユーザマクロの第2ブロツク■の演算が実行
されると、変数レジスタ#1132Rの第1ビツト乃至
第4ビツト(24〜23)に第3番目のダイヤルDL3
のアドレスがセットされる。今、第3番目のダイヤルD
L3のアドレスを0011とすれば、トランジスタTr
l、Tr2が導通しリレーROI、RO2がオンする。
Now, when the operation of the second block (2) of the user macro is executed, the first to fourth bits (24 to 23) of the variable register #1132R are set to the third dial DL3.
address is set. Now the third dial D
If the address of L3 is 0011, the transistor Tr
1 and Tr2 conduct, and relays ROI and RO2 are turned on.

尚、リレーRO3,RO4はオフである。この結果、選
択回路SWCはダイヤルDL3に設定された符合付BC
D3桁を線ff1l 〜I238.j2sに出力する。
Note that relays RO3 and RO4 are off. As a result, the selection circuit SWC selects the signed BC set on the dial DL3.
D3 digit to line ff1l ~I238. Output to j2s.

尚、線!2.11〜β18には1桁目のBCD数値に応
じて、f221〜f228には2桁目のBCD数値に応
じて、又I231〜9.38には3桁目のBCD数値に
応じてハイレベル、ローレベルの信号が瑛われる。従っ
て、入力データ用のリレーRII〜R113はダイヤル
DL3にセットした数値に応じてオン/オフし、変数レ
ジスタ#1032Rに記憶される。以後、変数レジスタ
#1032Hに読出された数値をデータバスDBUSを
介して処理部に取り込み前記■以降の演算を行う。
Also, line! 2.11 to β18 according to the first digit BCD value, f221 to f228 according to the second digit BCD value, and I231 to 9.38 according to the third digit BCD value. Level, low level signals are reflected. Therefore, the input data relays RII to R113 are turned on/off according to the numerical value set on the dial DL3, and are stored in the variable register #1032R. Thereafter, the numerical value read into the variable register #1032H is taken into the processing section via the data bus DBUS, and the calculations from (2) onwards are performed.

(B)ユーザマクロ呼出命令 ユーザマクロ呼出命令は、指令テ〜ブ21にプログラム
しておくことによりマクロ登録メモリ24から所定のユ
ーザマクロを呼出してユーザマクロ処理部27により数
値制御処理を実行させる命令で、少なくとも G65P(マクロ識別名) が指令される。
(B) User Macro Calling Instruction The user macro calling instruction is a command that is programmed in the command table 21 to call a predetermined user macro from the macro registration memory 24 and cause the user macro processing section 27 to execute numerical control processing. At least G65P (macro identification name) is commanded.

さて、指令テープ21からテープリーグ23により指令
が読込まれれば、判別回路25はユーザマクロ呼出命令
か否かの判定を行い、ユーザマクロ呼出命令でなければ
通常処理部26は該指令に基いた処理を行って工作機械
を制御し、一方ユザマクロ呼出命令であれば、該呼出命
令のワードアドレスPのあとに指示されているマクロ識
別名を有するユーザマクロに含まれるマクロ命令に従っ
て、マクロ登録メモリ24から所定のシステム符号に対
応する変数レジスタの内容を呼出してユーザマクロ処理
部27に引渡し、マクロ処理を実行させ工作機械をユー
ザマクロに応じて制御する。
Now, when a command is read from the command tape 21 by the tape league 23, the discrimination circuit 25 determines whether it is a user macro call command or not, and if it is not a user macro call command, the normal processing unit 26 If the command is a user macro call command, the macro register memory 24 executes processing to control the machine tool, and in the case of a user macro call command, the macro command is stored in the macro registration memory 24 according to the macro command included in the user macro having the macro identification name specified after the word address P of the call command. The contents of the variable register corresponding to a predetermined system code are called from the system code and delivered to the user macro processing section 27, which executes macro processing and controls the machine tool according to the user macro.

(発明の効果) 以上、本発明においてはユーザマクロを予め、複数登録
しているマクロ登録メモリからユーザマクロ呼出命令に
より所定のユーザマクロを呼出し、マクロ処理部におい
て該ユーザマクロに応じたマクロ処理を実行する際に、
CNCのソフトウェアをその都度改善するのではなく、
システム 3 符号に割り当てられた機能命令により実行される処理内
容が、システム変数を任意に変更して工作機械が有する
複数種類の数値制御処理機能に対応したシステム符号を
指定するだけで、必要とされる特殊の数値制御処理機能
を選択して実行できる。したがってユーザは何等CNC
のソフトウェアを改造することなく、単に該特殊制御の
ユーザマクロを作成し、マクロ登録メモリに記憶させ、
指令テープなどの適所に該ユーザマクロ呼出命令をプロ
グラムするだけでよい。
(Effects of the Invention) As described above, in the present invention, a predetermined user macro is called from a macro registration memory in which a plurality of user macros are registered in advance by a user macro call command, and the macro processing unit performs macro processing according to the user macro. When executing
Rather than improving CNC software each time,
System 3 The processing content to be executed by the function command assigned to the code can be changed to the required one by simply changing the system variables arbitrarily and specifying the system code corresponding to the multiple types of numerical control processing functions possessed by the machine tool. You can select and execute special numerical control processing functions. Therefore, what does the user do with the CNC?
Simply create a user macro for the special control and store it in the macro registration memory without modifying the software.
It is sufficient to simply program the user macro call command in a suitable location such as on a command tape.

この結果、ソフトウェアの改造に要する労力と時間を省
くことができ低コストで、しかもユーザの要望に適合し
たCNCを提供できる。又、ユーザマクロを使用するこ
とによって、機械、システムにマツチした特殊仕様や、
ユーザ独自の固定サイクルや自動プログラミングが実現
可能となった。
As a result, the labor and time required for modifying the software can be saved, and a CNC that meets the user's needs can be provided at low cost. In addition, by using user macros, you can create special specifications that match the machine or system.
User-specific canned cycles and automatic programming are now possible.

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

第1図は従来の数値制御装置のブロック図、第2図は本
発明に係るCNCのブロック図、第34 図は指令プログラムの一例を示す説明図、第4図はユー
ザマクロの登録説明図で、同図(a)。 (b)はインタフェース信号読取り及び送出を説明する
説明図、第5図は、第3番目のダイヤルに設定したBC
D3桁の読出制御を説明する回路図である。 21・・・指令テープ、22・・・ユーザマクロ指令テ
ープ、23・・・テープリーグ、24・・・マクロ登録
メモリ、25・・・判別回路、26・・・通常処理部、
27・・・ユーザマクロ処理部、28・・・変数メモリ
、29・・・インタフェース回路。
Fig. 1 is a block diagram of a conventional numerical control device, Fig. 2 is a block diagram of a CNC according to the present invention, Fig. 34 is an explanatory diagram showing an example of a command program, and Fig. 4 is an explanatory diagram of user macro registration. , same figure (a). (b) is an explanatory diagram explaining interface signal reading and sending, and Figure 5 shows the BC set on the third dial.
FIG. 3 is a circuit diagram illustrating readout control for D3 digits. 21... Command tape, 22... User macro command tape, 23... Tape league, 24... Macro registration memory, 25... Discrimination circuit, 26... Normal processing section,
27... User macro processing unit, 28... Variable memory, 29... Interface circuit.

Claims (3)

【特許請求の範囲】[Claims] (1)マクロ識別名を含むユーザマクロ呼出命令がプロ
グラムされた指令プログラムに基づいて数値制御処理を
実行し、該処理結果により工作機械を駆動してワークに
指令通りの加工を施す数値制御装置において、前記工作
機械と数値制御装置との間のインタフェイス信号状態を
代表する状態量を変数値とするシステム変数を記憶した
変数メモリと、1ないし複数のシステム変数を含み前記
マクロ識別名により識別可能な複数の機能命令をマクロ
命令として予め記憶しているマクロ登録メモリと、この
マクロ登録メモリから前記マクロ命令を呼び出したとき
前記変数メモリからマクロ命令に含まれるシステム変数
を読出しこのシステム変数の内容に応じて前記マクロ登
録メモリから読出されたマクロ命令に従って所定の数値
制御処理を実行するマクロ処理手段とを有することを特
徴とする数値制御装置。
(1) In a numerical control device that executes numerical control processing based on a command program in which a user macro call command including a macro identification name is programmed, and drives a machine tool based on the processing result to perform machining on a workpiece according to the command. , a variable memory storing system variables whose variable values are state quantities representative of interface signal states between the machine tool and the numerical control device, and one or more system variables, which can be identified by the macro identifier. A macro registration memory pre-stores a plurality of function instructions as macro instructions, and when the macro instruction is called from this macro registration memory, a system variable included in the macro instruction is read from the variable memory and the contents of this system variable are and macro processing means for executing predetermined numerical control processing in accordance with macro instructions read from the macro registration memory.
(2)前記工作機械と数値制御装置との間のインタフェ
イス信号状態を代表する状態量は、工作機械から数値制
御装置に伝達される信号状態を代表する状態量であるこ
とを特徴とする特許請求の範囲第1項に記載の数値制御
装置。
(2) A patent characterized in that the state quantity representing the interface signal state between the machine tool and the numerical control device is a state quantity representing the signal state transmitted from the machine tool to the numerical control device. A numerical control device according to claim 1.
(3)前記工作機械と数値制御装置との間のインタフェ
イス信号状態を代表する状態量は、数値制御装置から工
作機械に対して出力される信号状態を代表する状態量で
あることを特徴とする特許請求の範囲第1項に記載の数
値制御装置。
(3) The state quantity representing the interface signal state between the machine tool and the numerical control device is a state quantity representing the signal state output from the numerical control device to the machine tool. A numerical control device according to claim 1.
JP20186190A 1990-07-30 1990-07-30 Numerical controller Pending JPH03196307A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20186190A JPH03196307A (en) 1990-07-30 1990-07-30 Numerical controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20186190A JPH03196307A (en) 1990-07-30 1990-07-30 Numerical controller

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP7099780A Division JPS56168223A (en) 1980-05-28 1980-05-28 Numerical value control system

Publications (1)

Publication Number Publication Date
JPH03196307A true JPH03196307A (en) 1991-08-27

Family

ID=16448107

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20186190A Pending JPH03196307A (en) 1990-07-30 1990-07-30 Numerical controller

Country Status (1)

Country Link
JP (1) JPH03196307A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56168223A (en) * 1980-05-28 1981-12-24 Fanuc Ltd Numerical value control system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS56168223A (en) * 1980-05-28 1981-12-24 Fanuc Ltd Numerical value control system

Similar Documents

Publication Publication Date Title
EP0766154B1 (en) Numerically controlled machine tool and method
US4415965A (en) Programmable sequence controller
US4034354A (en) Programmable interface controller for numerical machine systems
US5128857A (en) Sequence control apparatus having separate sequence memory and interlock condition memory
CN101025622A (en) Numerical controller
EP0230471B1 (en) Manual operation system for machine controlled by numerical control unit
EP0845721B1 (en) Numerical controller
US4396973A (en) Programmable sequence controller
US4924403A (en) Numerical control method and system therefor having override playback function
JPS6232805B2 (en)
JPH03196307A (en) Numerical controller
JPH03206503A (en) Numerical controller
EP0827053A1 (en) Programming system for motion controller
JPH03196309A (en) Numerical controller
JPH0336606A (en) Numerical controller
JPH03206505A (en) Numerical controller
JPH03196308A (en) Numerical controller
JPH06318109A (en) Numerical controller
JP3460747B2 (en) Numerical control unit
JP2588944B2 (en) How to create NC data
JPH0460805A (en) Sequence program generating method
JPH06119021A (en) Operation system for controller
JPH03206504A (en) Numerical controller
JP2821743B2 (en) Numerical control unit
JP3060515B2 (en) Production control device