JPH086624A - Numerical controller equipped with local variable display function - Google Patents
Numerical controller equipped with local variable display functionInfo
- Publication number
- JPH086624A JPH086624A JP6163315A JP16331594A JPH086624A JP H086624 A JPH086624 A JP H086624A JP 6163315 A JP6163315 A JP 6163315A JP 16331594 A JP16331594 A JP 16331594A JP H086624 A JPH086624 A JP H086624A
- Authority
- JP
- Japan
- Prior art keywords
- local variable
- subprogram
- variable
- local
- display
- 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
Links
- 238000000034 method Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000012790 confirmation Methods 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
Landscapes
- Testing And Monitoring For Control Systems (AREA)
- Numerical Control (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、NCプログラム内で使
用するローカル変数の表示機能を備えた数値制御装置に
関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a numerical controller having a display function of local variables used in an NC program.
【0002】[0002]
【従来の技術】図4は従来のローカル変数表示機能を備
えた数値制御装置の一例を示すブロック図である。プロ
グラム記憶部1は主プログラム及びサブプログラムを記
憶している。オペレータの要求により、プログラム選択
部2はプログラム記憶部1に記憶されている主プログラ
ム及びサブプログラムの中から該当するプログラムを選
択し、NCプログラム運転領域である運転バッファ3に
格納する。オペレータが運転指令をすると、パートプロ
グラム解析部4は、運転バッファ3に格納されている主
プログラムあるいはサブプログラムを1ブロックずつ読
出し、解析して解析データを生成する。サブプログラム
内にてローカル変数が定義されていると、パートプログ
ラム解析部4はローカル変数名及び変数内容をローカル
変数記憶部6に記憶させ、またサブプログラム内にてロ
ーカル変数が参照されていると、パートプログラム解析
部4はローカル変数記憶部6に記憶されているローカル
変数名及び変数内容のうち該当するローカル変数名及び
変数内容を読出し、解析データを生成する。実行ブロッ
クデータ作成部5はパートプログラム解析部4にて生成
された解析データを基にして実行ブロックデータを作成
する。表示用制御部11はローカル変数記憶部6に記憶
されているローカル変数名及び変数内容を読出し、表示
装置12に表示する。ローカル変数記憶部6に記憶され
ているローカル変数名及び変数内容はリセット、または
サブプログラムの実行終了と共に消去される。関数発生
部7は実行ブロックデータ作成部5にて作成された実行
ブロックデータを基にして関数発生を行ない、サーボ制
御部8に演算値を出力する。サーボ制御部8は関数発生
部7から出力された演算値を基にして検出器10の現在
値データのフィードバックと合わせてモータ9を駆動す
る。2. Description of the Related Art FIG. 4 is a block diagram showing an example of a conventional numerical controller having a local variable display function. The program storage unit 1 stores a main program and a sub program. At the request of the operator, the program selection unit 2 selects the corresponding program from the main program and the sub-program stored in the program storage unit 1 and stores it in the operation buffer 3 which is the NC program operation area. When the operator gives an operation command, the part program analysis unit 4 reads the main program or the subprogram stored in the operation buffer 3 block by block and analyzes the block to generate analysis data. When a local variable is defined in the subprogram, the part program analysis unit 4 stores the local variable name and the variable content in the local variable storage unit 6, and the local variable is referred to in the subprogram. The part program analysis unit 4 reads the corresponding local variable name and variable contents from the local variable names and variable contents stored in the local variable storage unit 6 and generates analysis data. The execution block data creation unit 5 creates execution block data based on the analysis data generated by the part program analysis unit 4. The display control unit 11 reads out the local variable name and the variable contents stored in the local variable storage unit 6 and displays them on the display device 12. The local variable name and the variable contents stored in the local variable storage unit 6 are erased at the time of resetting or execution of the subprogram. The function generation unit 7 generates a function based on the execution block data created by the execution block data creation unit 5, and outputs the calculated value to the servo control unit 8. The servo controller 8 drives the motor 9 based on the calculated value output from the function generator 7 together with the feedback of the current value data of the detector 10.
【0003】[0003]
【発明が解決しようとする課題】上述した従来のローカ
ル変数表示機能を備えた数値制御装置では、ローカル変
数はサブプログラム内で定義された時のみ記憶かつ表示
されるが、サブプログラムの実行が終了するとローカル
変数の記憶は消去されるため、表示装置にはサブプログ
ラム実行終了後はローカル変数の内容が表示できない。
従ってサブプログラム実行終了後はローカル変数を用い
たNCプログラムの動作を確認する作業が困難であると
いう問題があった。本発明は上述した事情から成された
ものであり、本発明の目的は、ローカル変数がサブプロ
グラムの実行終了により消去されても、ローカル変数の
内容を保持、表示できるようにして、ローカル変数を用
いたNCプログラムの動作確認作業を容易にするローカ
ル変数表示機能を備えた数値制御装置を提供することに
ある。In the conventional numerical control device having the local variable display function described above, the local variables are stored and displayed only when they are defined in the subprogram, but the execution of the subprogram ends. Then, since the storage of the local variables is erased, the contents of the local variables cannot be displayed on the display device after the subprogram execution is completed.
Therefore, there is a problem that it is difficult to confirm the operation of the NC program using the local variables after the subprogram execution is completed. The present invention has been made from the above-described circumstances, and an object of the present invention is to enable the contents of a local variable to be retained and displayed even if the local variable is erased by the end of execution of a subprogram so that the local variable can be stored. It is an object of the present invention to provide a numerical controller having a local variable display function for facilitating the operation confirmation work of the NC program used.
【0004】[0004]
【課題を解決するための手段】本発明は、主プログラム
及びサブプログラムで構成されたNCプログラム内で使
用される変数のうち、前記サブプログラム内で定義され
た時生成され、前記サブプログラムが終了すると消去さ
れるローカル変数名及び変数内容を表示する機能を備え
た数値制御装置に関するものであり、本発明の上記目的
は、前記サブプログラム内で前記ローカル変数が定義さ
れると当該ローカル変数名、変数内容及びサブプログラ
ム名を記憶する表示用ローカル変数記憶部と、前記表示
用ローカル変数記憶部に記憶されている前記ローカル変
数名、変数内容及びサブプログラム名の表示を制御する
表示制御部とを具備することにより達成される。According to the present invention, among variables used in an NC program composed of a main program and a subprogram, the variables are generated when they are defined in the subprogram, and the subprogram is terminated. The present invention relates to a numerical control device having a function of displaying a local variable name and a variable content that are deleted when the local variable name is defined in the subprogram. A display local variable storage unit for storing variable contents and a subprogram name; and a display control unit for controlling display of the local variable name, variable contents and subprogram name stored in the display local variable storage unit. It is achieved by having.
【0005】[0005]
【作用】本発明にあっては、ローカル変数名、変数内容
及びサブプログラム名が別の表示用ローカル変数記憶部
に記憶されるので、サブプログラムの実行が終了して
も、別の主プログラムが実行開始されるまではローカル
変数名、変数内容及びサブプログラム名を保持でき、表
示装置にローカル変数名及び変数内容を表示することが
できる。In the present invention, since the local variable name, the variable contents and the subprogram name are stored in another display local variable storage unit, another main program can be executed even after the execution of the subprogram is completed. Until the execution is started, the local variable name, the variable content and the subprogram name can be held, and the local variable name and the variable content can be displayed on the display device.
【0006】[0006]
【実施例】図1は本発明のローカル変数表示機能を備え
た数値制御装置の一実施例におけるブロック図であり、
図4と同一構成箇所は同符合を付す。プログラム記憶部
1は主プログラム及びサブプログラムを記憶している。
オペレータの要求により、プログラム選択部2はプログ
ラム記憶部1に記憶されている主プログラム及びサブプ
ログラムの中から該当するプログラムを選択し、NCプ
ログラム運転領域である運転バッファ3に格納する。オ
ペレータが運転指令をすると、パートプログラム解析部
4は、運転バッファ3に格納されている主プログラムあ
るいはサブプログラムを1ブロックずつ読出し、解析し
て解析データを生成する。サブプログラム内にてローカ
ル変数が定義されていると、パートプログラム解析部4
はローカル変数名及び変数内容をローカル変数記憶部6
に記憶させ、またそのローカル変数名、変数内容及びサ
ブプログラム名を表示用ローカル変数変換記憶部13に
記憶させる。サブプログラム内にてローカル変数が参照
されていると、パートプログラム解析部4はローカル変
数記憶部6に記憶されているローカル変数名及び変数内
容のうち該当するローカル変数名及び変数内容を読出
し、解析データを生成する。実行ブロックデータ作成部
5はパートプログラム解析部4にて生成された解析デー
タを基にして実行ブロックデータを作成する。表示用制
御部11´はローカル変数記憶部6に記憶されているロ
ーカル変数名及び変数内容を読出し、表示装置12に表
示し、また表示用ローカル変数記憶部13に記憶されて
いるローカル変数名、変数内容及びサブプログラム名を
読出し、表示装置12に表示する。ローカル変数記憶部
6に記憶されているローカル変数名及び変数内容はリセ
ット、またはサブプログラムの実行終了と共に消去され
る。表示用ローカル変数記憶部13に記憶されているロ
ーカル変数名、変数内容及びサブプログラム名は次の主
プログラム実行開始時に消去される。関数発生部7は実
行ブロックデータ作成部5にて作成された実行ブロック
データを基にして関数発生を行ない、サーボ制御部8に
演算値を出力する。サーボ制御部8は関数発生部7から
出力された演算値を基にして検出器10の現在値データ
のフィードバックと合わせてモータ9を駆動する。1 is a block diagram showing an embodiment of a numerical controller having a local variable display function of the present invention.
The same components as those in FIG. 4 are designated by the same reference numerals. The program storage unit 1 stores a main program and a sub program.
At the request of the operator, the program selection unit 2 selects the corresponding program from the main program and the sub-program stored in the program storage unit 1 and stores it in the operation buffer 3 which is the NC program operation area. When the operator gives an operation command, the part program analysis unit 4 reads the main program or the subprogram stored in the operation buffer 3 block by block and analyzes the block to generate analysis data. If local variables are defined in the subprogram, the part program analysis unit 4
Shows the local variable name and variable contents in the local variable storage unit 6
In addition, the local variable name, the variable contents, and the subprogram name are stored in the display local variable conversion storage unit 13. When a local variable is referred to in the subprogram, the part program analysis unit 4 reads out and analyzes the corresponding local variable name and variable content among the local variable name and variable content stored in the local variable storage unit 6. Generate data. The execution block data creation unit 5 creates execution block data based on the analysis data generated by the part program analysis unit 4. The display control unit 11 ′ reads out the local variable name and the variable contents stored in the local variable storage unit 6, displays them on the display device 12, and displays the local variable name stored in the display local variable storage unit 13. The variable contents and the subprogram name are read out and displayed on the display device 12. The local variable name and the variable contents stored in the local variable storage unit 6 are erased at the time of resetting or execution of the subprogram. The local variable name, the variable contents, and the subprogram name stored in the display local variable storage unit 13 are erased at the start of execution of the next main program. The function generation unit 7 generates a function based on the execution block data created by the execution block data creation unit 5, and outputs the calculated value to the servo control unit 8. The servo controller 8 drives the motor 9 based on the calculated value output from the function generator 7 together with the feedback of the current value data of the detector 10.
【0007】図2は、本発明装置で用いるローカル変数
の表示用ローカル変数記憶部13の階層を示す説明図で
ある。表示用ローカル変数記憶部13は、サブプログラ
ム名、ローカル変数名、ローカル変数の解析データで構
成され、サブプログラム単位で記憶される。まずサブプ
ログラム名を記憶し、次にローカル変数名とローカル変
数の解析データを記憶し、また次に別のローカル変数名
とローカル変数の解析データを記憶していく。また別の
サブプログラムが実行されると、同様にサブプログラム
名を記憶し、次にローカル変数名とローカル変数の解析
データを記憶する。FIG. 2 is an explanatory diagram showing the hierarchy of the local variable display unit 13 for displaying local variables used in the apparatus of the present invention. The display local variable storage unit 13 includes a subprogram name, a local variable name, and local variable analysis data, and is stored in subprogram units. First, the subprogram name is stored, then the local variable name and the analysis data of the local variable are stored, and then another local variable name and the analysis data of the local variable are stored. When another subprogram is executed, the subprogram name is similarly stored, and then the local variable name and the analysis data of the local variable are stored.
【0008】図3は本発明装置の動作を示すフローチャ
ート図である。主プログラムの実行開始時、表示用ロー
カル変数記憶部13に記憶されているサブプログラム
名、ローカル変数名、ローカル変数データすべてを消去
し(ステップS1)、実行されているNCプログラムを
1ブロックずつ読出す(ステップS2)。ステップS2
で読出されたデータが主プログラムの終了コードである
M02あるいはM30かどうかの判定を行ない(ステッ
プS3)、終了コードであれば終了へ進み、終了コード
でなければステップS4へ進む。ステップS2で読出さ
れたデータがサブプログラムの終了コードであるRTS
指令かどうか判定し(ステップS4)、RTS指令であ
ればステップS5へ進み、RTS指令でなければステッ
プS6へ進む。ローカル変数記憶部6から実行が終了し
たサブプログラムにて使用されていたローカル変数名、
ローカル変数データすべてを消去し(ステップS5)、
ステップS2へ戻る。ステップS2で読出されたデータ
を基にして解析データを生成し、ローカル変数が参照さ
れていれば、ローカル変数記憶部6に記憶されているロ
ーカル変数名とローカル変数データの中から該当するロ
ーカル変数名とローカル変数データを読出して、解析デ
ータを生成する(ステップS6)。ステップS6で生成
された解析データにおいて、ローカル変数が定義されて
いるかどうか判定し(ステップS7)、定義されていれ
ばステップS8へ進み、定義されてなければステップS
13へ進む。現在実行中のサブプログラム名が表示用ロ
ーカル変数記憶部13に記憶されているかどうか検索し
(ステップS8)、記憶されていなければステップS9
へ進み、記憶されていればステップS10へ進む。実行
中のサブプログラム名を表示用ローカル変数記憶部13
に記憶する(ステップS9)。ステップS7で定義され
ていたローカル変数名が表示用ローカル変数記憶部13
に記憶されているかどうか検索し(ステップS10)、
記憶されていればステップS11へ進み、記憶されてい
なければステップS12へ進む。表示用ローカル変数記
憶部13に記憶されているローカル変数名のうち該当す
るローカル変数名に該当する変数内容を更新し(ステッ
プS11)、ステップS13へ進む。表示用ローカル変
数記憶部13にローカル変数名、変数内容を記憶する
(ステップS12)。ステップS6で生成された解析デ
ータを基にして実行ブロックデータを作成し(ステップ
S13)、関数発生部7で関数発生を行ない(ステップ
S14)、ステップS2へ戻る。FIG. 3 is a flow chart showing the operation of the device of the present invention. At the start of execution of the main program, all the subprogram names, local variable names, and local variable data stored in the display local variable storage unit 13 are erased (step S1), and the NC program being executed is read block by block. Put out (step S2). Step S2
It is determined whether the data read in step S1 is the end code M02 or M30 of the main program (step S3). If the end code is the end code, the process proceeds to the end. If not, the process proceeds to step S4. The data read in step S2 is the RTS which is the end code of the subprogram.
It is determined whether or not it is a command (step S4). If it is an RTS command, the process proceeds to step S5, and if it is not the RTS command, the process proceeds to step S6. The local variable name used in the subprogram that has finished executing from the local variable storage unit 6,
Erase all local variable data (step S5),
Return to step S2. Analysis data is generated based on the data read in step S2, and if the local variable is referenced, the corresponding local variable is selected from the local variable name and the local variable data stored in the local variable storage unit 6. The name and local variable data are read out to generate analysis data (step S6). In the analysis data generated in step S6, it is determined whether or not a local variable is defined (step S7). If it is defined, the process proceeds to step S8, and if it is not defined, step S8.
Proceed to 13. It is searched whether or not the name of the currently executed subprogram is stored in the display local variable storage unit 13 (step S8), and if not stored, step S9.
If it is stored, the process proceeds to step S10. Local variable storage unit 13 for displaying the name of the subprogram being executed
(Step S9). The local variable name defined in step S7 is the display local variable storage unit 13
Is searched (step S10),
If it is stored, the process proceeds to step S11, and if it is not stored, the process proceeds to step S12. Of the local variable names stored in the display local variable storage unit 13, the variable contents corresponding to the corresponding local variable name are updated (step S11), and the process proceeds to step S13. The local variable name and the variable contents are stored in the display local variable storage unit 13 (step S12). Execution block data is created based on the analysis data generated in step S6 (step S13), the function generator 7 generates a function (step S14), and the process returns to step S2.
【0009】[0009]
【発明の効果】以上説明したように、本発明に係るロー
カル変数表示機能を備えた数値制御装置によれば、定義
されたローカル変数がサブプログラムの実行終了により
消去されても、次の主プログラム実行開始まではローカ
ル変数の内容を保持、表示ができることから、ローカル
変数を用いたNCプログラムの動作確認作業においてロ
ーカル変数関連のプログラムミスの発見が可能となる。As described above, according to the numerical controller having the local variable display function of the present invention, even if the defined local variable is deleted by the end of the execution of the subprogram, the next main program is executed. Since the contents of the local variables can be retained and displayed until the start of execution, it is possible to find a program error related to the local variables in the operation confirmation work of the NC program using the local variables.
【図1】本発明のローカル変数表示機能を備えた数値制
御装置の一実施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of a numerical controller having a local variable display function of the present invention.
【図2】本発明装置で用いるローカル変数の表示用ロー
カル変数記憶部の階層の一例を示す説明図である。FIG. 2 is an explanatory diagram showing an example of a hierarchy of a display local variable storage unit for local variables used in the device of the present invention.
【図3】本発明装置の動作例を示すフローチャートであ
る。FIG. 3 is a flowchart showing an operation example of the device of the present invention.
【図4】従来のローカル変数表示機能を備えた数値制御
装置の一例を示すブロック図である。FIG. 4 is a block diagram showing an example of a conventional numerical control device having a local variable display function.
13 表示用ローカル変数記憶部 13 Local variable storage for display
フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G05B 23/02 301 L 7531−3H Continuation of the front page (51) Int.Cl. 6 Identification number Office reference number FI technical display location G05B 23/02 301 L 7531-3H
Claims (2)
されたNCプログラム内で使用される変数のうち、前記
サブプログラム内で定義された時生成され、前記サブプ
ログラムが終了すると消去されるローカル変数名及び変
数内容を表示する機能を備えた数値制御装置において、
前記サブプログラム内で前記ローカル変数が定義される
と当該ローカル変数名、変数内容及びサブプログラム名
を記憶する表示用ローカル変数記憶部と、前記表示用ロ
ーカル変数記憶部に記憶されている前記ローカル変数
名、変数内容及びサブプログラム名の表示を制御する表
示制御部とを備えたことを特徴とするローカル変数表示
機能を備えた数値制御装置。1. A local variable name of a variable used in an NC program composed of a main program and a subprogram, which is created when the subprogram is defined and is deleted when the subprogram ends, and In a numerical controller equipped with a function to display the contents of variables,
When the local variable is defined in the subprogram, a local variable storage unit for storing the local variable name, variable content and subprogram name, and the local variable stored in the local display variable storage unit A numerical control device having a local variable display function, which is provided with a display control unit for controlling display of names, variable contents and subprogram names.
示用ローカル変数記憶部に記憶されている前記ローカル
変数名、変数内容及びサブプログラム名を消去する手段
を備えた請求項1に記載のローカル変数表示機能を備え
た数値制御装置。2. The local according to claim 1, further comprising means for erasing the local variable name, the variable content and the subprogram name stored in the display local variable storage section at the start of execution of the main program. Numerical control device with variable display function.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6163315A JPH086624A (en) | 1994-06-23 | 1994-06-23 | Numerical controller equipped with local variable display function |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6163315A JPH086624A (en) | 1994-06-23 | 1994-06-23 | Numerical controller equipped with local variable display function |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH086624A true JPH086624A (en) | 1996-01-12 |
Family
ID=15771505
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP6163315A Pending JPH086624A (en) | 1994-06-23 | 1994-06-23 | Numerical controller equipped with local variable display function |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH086624A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1057989A2 (en) | 1999-06-04 | 2000-12-06 | Nissan Motor Company, Limited | Air-fuel ratio control system for engine |
-
1994
- 1994-06-23 JP JP6163315A patent/JPH086624A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1057989A2 (en) | 1999-06-04 | 2000-12-06 | Nissan Motor Company, Limited | Air-fuel ratio control system for engine |
| US6347514B1 (en) | 1999-06-04 | 2002-02-19 | Nissan Motor Co., Ltd. | Air-fuel ratio control system for engine |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH03154105A (en) | Nc program generating device | |
| JPH04176539A (en) | Interactive numerical control unit | |
| WO1985000063A1 (en) | Numerical control apparatus with function for checking stored stroke limit of drawing | |
| JP2773517B2 (en) | Program display device | |
| JPH086624A (en) | Numerical controller equipped with local variable display function | |
| JPH08339215A (en) | Numerical controller | |
| JP2916015B2 (en) | Programming device for programmable controller | |
| JPH0563749U (en) | Numerical control device with processing time calculation function | |
| JP3048679B2 (en) | Interactive NC device | |
| JPH04245503A (en) | Editing device for machining program | |
| JPH09258808A (en) | Motion controller programming system | |
| JPH0747209B2 (en) | Welding condition automatic setting device | |
| JP2642451B2 (en) | Numerical control unit | |
| JPH0863218A (en) | Program constitution display system | |
| JPH11249715A (en) | Automatic generation method of sequence program and motion controller | |
| JP3283055B2 (en) | Program editing device | |
| JPH07210232A (en) | Numerical controller | |
| JPH05108359A (en) | Interactive expert system construction method | |
| JP2001209412A (en) | Sequence program simulation device | |
| JP3362520B2 (en) | Image forming device | |
| JPH08286712A (en) | Editing system for sequence program | |
| JPH0697416B2 (en) | Screen display method in automatic programming device | |
| JPH04209007A (en) | User program editing system for programmable controller | |
| JPS62103714A (en) | Program generating device for industrial robot | |
| JPH0772918A (en) | Numerical control device |