PART PROGRAM EXECUTION METHOD

Abstract: A PERT program execution method which converts a PERT program prepared in automatic programming language into NC data of a type that can be executed by an NC apparatus. When error is detected in the PERT program (PPM) that is being executed, a question (M₂) is indicated on a display screen (CRT) as to whether the PERT program be corrected together with an error message (M₁). When it is designated to effect the correction, the correction screen is displayed and the PERT program is executed all again upon designation of correction completion.

Description: This invention relates to a method of executing a part program and, more particularly, to a part program execution method for converting a part program, which has been created in an automatic programming language, into NC data in a format capable of being executed by an NC unit. In automatic programming for creating NC data using an automatic programming language such as APT (automatically programmed tools) or FAPT, (a) a part program based on the automatic programming language is created by defining points, straight lines and circular arcs using simple symbols (this is referred to as "figure definition"), and defining a profile of a part using these defined points, straight lines and circular arcs (referred to as "motion statement definition"), and (b) the part program based on the automatic programming language is subsequently converted into NC data, which comprises NC data (EIA codes or ISO codes) in a format capable of being executed by an NC unit. Fig. 7 shows a part program PPM created in an automatic programming language. In Fig. 7, the portion from line "045" to line "088" is a part program for moving a tool along a figure, which comprises straight lines S1, S2 and a circular arc C1, starting from a point P1 (see Fig. 6). It is arranged to define a figure composed of points P1, P2, P3, P5, straight lines S1, S2 and circular arc C1, and to define subsequently a motion statement along the figure. Line numbers 045 - 051 are figure definition statements, line number 083 - 084 and 086 - 088 are motion definition statements, and line numbers 080 - 082, 085 are machining auxiliary statements. After the part program is created, an automatic programming unit responds to selection of a part program execution function by effecting a conversion into NC data in an execution format based on EIA or ISO codes while referring automatically to an NC data output table. In Fig. 7, (1) designates the start of the part program, and "REIDAI" is a header. (2) This indicates the type of NC machine. "MILL" is used in case of milling and "TURN" in case of turning. "ABS" indicates an absolute command ("INCR" is used in case of an incremental command). (3) This signifies a straight line passing through points P2, P3. (4) This signifies a circular arc of center (x₄,y₄) and radius r₁. (5) Of two tangent lines passing through the point P5 and contacting the circular arc C1, this signifies the lower tangent line (straight line). The alphabetic character B is a modifier meaning "below". In the case of the tangent line on the upper side, a modifier A meaning "above" is used instead of the modifier B. (6) This is a tool command which command a tool having a tool diameter of 10 mm. (7) This is a command for the rotational velocity of a spindle. (8) This is a command which offsets the tool to the left side of the direction of travel (the command would be TLRGT to offset the tool to the right side of the direction of travel. (9) This is a coordinate system setting command indicating that the starting point is P1; (10) This is a command for positioning in the direction of the straight line S1 and for positioning a cutter in such a manner that the cutter will contact the straight line at the point P2. (11) This is a velocity command which indicates that the feed velocity is 500 mm/min. When a grammatical error or an error due to a logical contradiction (a figure which cannot be defined) in terms of using a statement appears in the part program when the completed part program is being converted into NC data (which is referred to as execution of the part program), an error message corresponding to the contents of the error is outputted and execution processing is halted while in progress. In order to correct the part program, the operator manually returns the display from a part program execution screen to an initial screen for activity selection, selects a part program correction activity (editing activity) and calls the part program using the initial screen, finds the error location in the part program by employing the error message, and corrects the part program. After the correction, the operator again manually returns the display from the correction screen to the initial screen, selects the part program execution activity, calls the corrected part program and re-executes processing for conversion to NC data. Thus, the conventional part program execution method is such that if an error occurs, the entire operation for changing over the display must be performed manually in the following manner until the part program is corrected and re-executed: execution screen → initial screen → editing screen → initial screen → execution screen, the operation required for going back and forth between screens is very troublesome, and an exorbitant amount of time is needed for changing over screens. Accordingly, an object of the present invention is to provide a part program execution method so adapted that when an error occurs in a part program, the operation required for going back and forth between screens until the part program is re-executed can be performed simply and without taking too much time. JP-A-62-121511 discloses a method of correcting a working program by editing the program by inputting modified information in an interactive way based upon a working shape and character data displayed on an image display screen. According to the present invention there is provided a part program execution method for converting a part program, which defines a machining tool path and which has been created in an automatic programming language, into NC data in a format capable of being executed by an NC unit, the part program containing a figure definition statement and a tool motion definition statement and wherein processing is executed, along with the processing for conversion to said NC data, for adding a figure defined by said figure definition statement to an execution screen and displaying it along therewith, and for adding a tool path defined by said motion definition statement to the execution screen and displaying it along therewith; said method being characterised by: displaying a prompt, which inquires as to whether the part program is to be corrected, on a part program execution screen when an error is detected during execution of the part program, and also displaying along therewith a message conforming to contents of said error; automatically displaying a correction screen, with which the part program is capable of being corrected, instead of the part program execution screen if implementation of a correction is designated by an operator, the part program execution screen prevailing at detection of the error present in the part program being stored and being displayed in superimposed form within said correction screen in response to a request by the operator; and returning to the part program execution screen in response to designation of the end of the correction by the operator, and re-executing the corrected part program from the beginning thereof. Brief Description of the Drawings Fig. 1 is a block diagram of an apparatus for practicing the present invention; Fig. 2 is a block diagram of a graphic display unit for practicing the invention; Fig. 3 is a flowchart of part program execution processing according to the invention; Fig. 4 shows a correction screen on which a list of a part program is displayed; Fig. 5 shows an example of a dialog screen according to the invention; and Figs. 6 and 7 are views for describing examples of the prior art, in which Fig. 6 is a view for describing a tool path, and Fig. 7 is an example of a part program. Fig. 1 is a block diagram of an automatic programming apparatus for practicing the present invention. Shown are a processor 11a which performs automatic programming processing, a ROM 11b in which loading programs and the like have been stored, a RAM 11c for storing a system program read in from a floppy FL, as well as various parameters and the results of processing, a graphic display unit (CRT) 12, a tablet device 13, a keyboard 14a, an X-Y plotter 14b, a floppy drive 14c, and an NC data memory 15 for storing execution-format NC data that is eventually created. It should be noted that a part program execution screen which prevails at the time an error occurs is being displayed as an example on the CRT of the graphic display unit 12, in which M1 represents an error message indicating the type of an error, and M2 represents a prompt inquiring as to whether editing (a correction) is to be performed. Fig. 2 is a block diagram of the graphic display unit 12. Numeral 21 denotes a display processor which generates an image based on image data and stores the image in a prescribed frame memory, 22 a main frame memory which stores a part program execution screen and editing screen, 22a a reading unit for reading a main image out of the main frame memory 22 in synchronism with raster scanning of a CRT 26, 23 a subordinate frame memory which stores the part program execution screen that prevails when an error occurs, 23a a reading unit for reading a subordinate image out of the subordinate frame memory 23 in synchronism with raster scanning of the CRT 26, and 24 a mixing circuit for combining, and outputting to the CRT 26, the main image read out of the main frame memory 22 and the subordinate image read out of the subordinate frame memory 23. Numeral 25 designates a gate circuit which does not output the subordinate image, read out of the subordinate frame memory 23, to the mixing circuit when a changeover signal GOT outputted by the display processor 21 is at a low level, but which does output the subordinate image to the mixing circuit 24 when the changeover signal GOT attains a high level. Numeral 27 denotes a display RAM, and 28 a timing signal generator circuit which generates a bit clock whose frequency conforms to the raster scanning velocity of the beam in the CRT 26, as well as a vertical synchronizing signal, a horizontal synchronizing signal, etc. Fig. 3 is a flowchart of processing for the part program execution method according to the present invention. Part program execution processing will now be described in accordance with the flowchart of Fig. 3. It is assumed here that the part program PPM has already been created and stored in the RAM 11c. When the operator selects a part program execution activity by a prescribed operation using an initial screen, a dialog screen for part program execution is displayed on the CRT. More specifically, on the basis of the image data for the part program execution screen, the display processor 21 generates the part program execution screen, stores it in the main frame memory 22 and displays it on the CRT 26 via the reading unit 22a. In this state, the completed part program (e.g., the part program PPM shown in Fig. 7) is designated and an execute key, not shown, is operated. When this is done, the processor 11a reads in an i-th (the initial value of i is 1) statement of the part program PPM (step 101) and determines whether this statement is the end PEND of the part program (step 102). If the statement is PEND, execution of the program is terminated. If the statement is not PEND, however, it is determined whether a grammatical error or an error due a logical contradiction in terms of use of the statement is present in the statement (step 103). If there is no error, processing for execution of the part program is performed. That is, if the statement read in is a figure definition statement, the figure is painted on the CRT 26. If the statement is a motion definition statement, a tool path is painted on the CRT. Further, the statement is converted into NC data in a format (an EIA code or ISO code) capable of being executed by an NC unit, the NC data are stored in the NC data memory 15, and thereafter processing is executed from step 101 onward (step 104). If the decision rendered at step 103 is that an error is present, the processor 11a displays an error message corresponding to the contents of the error on the display screen CRT and displays also a prompt inquiring as to whether the part program PPM is to be corrected (edited) (step 105). By way of example, in the processing for executing the statement on line number "051" in Fig. 7, there is a case in which the point P5 is on the inner side of the circular arc C1 (see Fig. 1) so that a figure of a tangent line S2 passing through the point P5 and tangent to the circular arc C1 cannot be defined. In such case, the processor 11a displays the error message M1 and the prompt M2 shown in Fig. 1. In the error message M1, "Error No. 164" is an error number corresponding to the contents of an error in a case where a designated tangent line cannot be obtained. A correspondence table ENOT giving the correspondence between error contents and error numbers is stored in the RAM 11c in advance. If, in response to the prompt, the operator does not perform a correction (editing), the operator enters "0" as by the keyboard 14a. If a correction is to be performed, the operator enters "1" (step 106). The processor 11a ends the part program execution processing if "0" is entered. If "1" is entered, on the other hand, the dialog screen is changed over from the part program execution screen to the correction screen (editing screen), the list of the part program PPM is displayed on the correction screen (see Fig. 4), and the part program is rendered correctable. Specifically, the display processor 21 stores the execution screen prevailing at the occurrence of the error in the subordinate frame memory 23, generates the correction screen (which includes the part program list) based on correction data for the part program correction screen, stores the data in the main frame memory 22 and displays the data on the CRT 26 via the reading unit 22a. If desired, the line number in which the error has been detected can be displayed in a manner to distinguish it from other line numbers. In a case where it is desired to simultaneously display the execution screen (e.g., the screen of Fig. 1) prevailing at the occurrence of the error on the CRT 26 along with the list of the part program PPM, an "ERROR DISPLAY" key EFK (Fig. 1) provided on the keyboard 14a is pressed. When the "ERROR DISPLAY" key is pressed, the display processor 21 sets the changeover signal GOT to the high level and applies a read-out start/end timing to the reading unit 23a. As a result, the execution screen which prevailed at the occurrence of the error, and which has been stored in the subordinate frame memory 23, is read out by the reading unit 23a at the commanded timing, and the screen is inputted to the mixing circuit 24 via the gate circuit 25. Accordingly, the execution screen SIM (Fig. 5) prevailing at the occurrence of the error and the editing screen MIM read out of the main frame memory 22 are combined in the mixing circuit 24, and the result is displayed on the CRT 26. If the "ERROR DISPLAY" key EFK is pressed under these conditions, the changeover signal GOT assumes the low level and the execution screen prevailing at the occurrence of the error vanishes from the CRT 26. The operator corrects the part program PPM while referring to the execution screen SIM prevailing at the occurrence of the error. By way of example, the coordinates of the point P5 are corrected to a position outside the circular arc C1 and an attempt is made to obtain the tangent line S2 (step 107). When correction of the part program PPM is finished, the operator presses an edit end key, not shown. When this is done, the processor 11a changes over the dialog screen from part program editing screen to the execution screen and re-executes part program execution processing from step 101 onward starting from the beginning of the corrected part program PPM. Thus, in accordance with the present invention, the arrangement is such that a prompt inquiring as to whether a part program is to be corrected is displayed when an error occurs during execution of the part program, a correction screen is displayed if implementation of a correction has been designated, and the part program is re-executed from the beginning thereof in response to the end of the correction. As a result, a key operation needed to change back and forth between an editing screen and an execution screen is eliminated, part program debugging time can be shortened and the labor required therefor reduced.

Claims: A part program execution method for converting a part program, which defines a machining tool path and which has been created in an automatic programming language, into NC data in a format capable of being executed by an NC unit, the part program containing a figure definition statement and a tool motion definition statement and wherein processing is executed, along with the processing for conversion to said NC data, for adding a figure defined by said figure definition statement to an execution screen and displaying it along therewith, and for adding a tool path defined by said motion definition statement to the execution screen and displaying it along therewith; said method being characterised by: displaying a prompt, which inquires as to whether the part program is to be corrected, on a part program execution screen when an error is detected during execution of the part program, and also displaying along therewith a message conforming to contents of said error; automatically displaying a correction screen, with which the part program is capable of being corrected, instead of the part program execution screen if implementation of a correction is designated by an operator, the part program execution screen prevailing at detection of the error present in the part program being stored and being displayed in superimposed form within said correction screen in response to a request by the operator; and returning to the part program execution screen in response to designation of the end of the correction by the operator, and re-executing the corrected part program from the beginning thereof.

Inventors: KAJITANI AKIRA FANUC DAI- VIRA, SEKI MASAKI, TAKEGAHARA TAKASHI, KAJITANI, AKIRA FANUC DAI-3 VIRA-KARAMATSU, SEKI, MASAKI, TAKEGAHARA, TAKASHI
Applicants: FANUC LTD, FANUC LTD.
Application year: 1989
Main classification: G05B19
IPC codes: G05B19