# Post Name : MPLFAN # Product : LATHE # Machine Name : GENERIC FANUC # Control Name : GENERIC FANUC # Description : GENERIC FANUC LATHE POST # Associated Post : # Mill/Turn : NO # 4-axis/Axis subs. : NO # 5-axis : NO # Executable : MPL # # WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO # THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE. # # -------------------------------------------------------------------------- # Revision log: # ------------------------------------------------------------------------ # Programmers Note: # CNC 05/21/96 - Initial post setup V6.0, jph # CNC 11/05/96 - Added line in 'papproach' to set 'gcode' to zero for # drilling operations, grt # CNC 11/07/96 - Change <= to < in 'pg70' for buffer read., jph # CNC 12/16/96 - Add search for end Z with G74 to 'prapid'., jph # CNC 01/17/97 - Initialize prv_x, and prv_z in 'ptlchg' to override the # Motion Test. Chg in 'pg71endpos' from !xout, !zout, grt # CNC 01/23/97 - Change in 'preset_2', grt # CNC 02/06/97 - In 'pg70' changed while loop to <= was <. Added test for # for size2 in pg70cmpr1. Chg depth in G72 (format with W) # CNC 02/10/97 - Update xsav, and zsav in 'pthread0'. Fixed "endless loop" # in 'pg70cmpr1' & 'pg70cmpr3'. Test on size of buffer 3 # in 'pg70cmpr3' and 'pg70cmpr3_5a', grt # CNC 03/07/97 - Add sequence and cr to pcancc call in pretract1, jph # CNC 03/19/97 - Moved 'preset' dwell = zero to 'ptoolend1', jph # # -------------------------------------------------------------------------- # Features: # -------------------------------------------------------------------------- # Following Misc. Integers are used: # # mi1 = Work coordinate system # 0 = G50 with the X and Z home positions and reference return. # 1 or 2 = X and Z home positions. # 3 thru 9 = WCS of G53 thru G59 respectively. # # mi2 = Canned cycle type selection: # 0 = do not use canned cycle (output long code) # 1 = generate G71-73 rough cut canned cycle only # or G74/75 canned cycles # 2 = generate G71-73 rough and G70 finish canned cycle # See description for use of canned cycle below # # mi3 = Output tailstock at start of tool # 0 = OFF, 1 = ON # # mi4 = Select simple thread output (G32 or G92) # 0 = G32, 1 = G92 # # mi5 = Output thread chamfer code for G76/G92. # 0 = OFF, 1 = ON # # mi6 = Override of thread number of cut when 'thdmaj' = yes. # 0 = OFF, 1... = ON # # mi7 = Perform toolchange if offset number changes. # 0 = OFF, 1 = ON # # Following Misc. Reals are used: # # mr3 = Enter value for G71-73 and G74/75 clearance in canned cycle. # D for old style, R for new ( non-zero overrides the default ) # # mr4 = Enter value for G74/75 peck in canned cycle. # ( non-zero overrides the default ) # # mr5 = Enter chamfer value in G76 threading of .1 increments of lead. # ( range 0 to 9.9 by .1 increments ) # # mr6 = Enter value for dwell with cantext select. # ( non-zero overrides the default ) # # -------------------------------------------------------------------------- # Options / Usage # -------------------------------------------------------------------------- # This post is designed to be configurable to most 2d lathes. # Support for the following is provided: # Canned turning cycles # Gear selection - based on smallest diameter # Approach and retract procedures - optional safe motion break to/from work # Toolchange modification with point selection (buffered toolchange) # Linear processing sequence - toolchange call on first motion # # -------------------------------------------------------------------------- #G71 and G72 Canned cycles: # # NOTICE: Version 6 canned cycles require the parameter information be # included in the NCI. To include the parameter information, # turn the option on in the configuration file with the # screen-configure and NC settings. Use a parameter file other # than 'NONE' when displayed on the parameter pages. # # 1) Create a tool path for the roughing cut. The cut direction must be # horizontal or vertical to the machine axis. The "Point" function # allows the selection of an unlimited number of approach and retract # positions before and after the "Rough" tool path selection. Select # the misc. integer and real with the point selections and set mi2! # DO NOT use the approach and retract point function from within the # "Rough" toolpath!! # 2) At the parameters page set the amount of stock to leave. # Set the cut angle equal to the major axis. ex. 0.0, 90.0, etc.. # Select the integer and real misc. values. Set mi2! # Set the cutter compensation in control, this is required. # 3) Accept the toolpath if it is good, do not accept paths with # gouges etc.. # 4) Create the finish cut for the cycle by selecting the same path used # for the roughing passes. Select Last for the tool path that was just # roughed or, if the "Point" toolpath menu selection was used, re-chain # the toolpath. Select points for the approach and retract as described # in the roughing path. DO NOT use the approach and retract point # function from within the "Finish" toolpath!! # 5) Set the stock to 0 on the finish pass. Use the same radius size # (Radius of zero in both rough and finish allows part type program) # and tool geometry. Change of tool number for the finish cut is # allowed (Change the tool number on the rapid points if they are used). # Set the cutter compensation in control the same as the rough cut was set. # #G73 Canned cycles: # 1) Create a tool path as in G71/72. Select "Finish" to create the # rough tool path. At the parameters page set the amount of stock to # leave, the number of cuts and the depth of cuts. # 2) Accept the toolpath if it is good, do not accept paths with # gouges etc.. # 3) Select Finish cuts after the "Finish" roughing cycle as in G71/G72. # Set the stock to 0, number of cuts to one for the finish pass. Use # the same radius size and tool geometry. # # NOTE: G71 thru G73 paths require BOTH the rough and finish paths. All # motion (points, rough and finish) must have the mi2 set and be # contiguous. Tool orientation must be correct for cut where the # lead angle cuts in the direction of cut. Lead in and lead out # vectors are included, be certain not to reverse the direction of # the path with the vectors. If vectors are not used then extend # the geometry beyond the part to prevent collisions. # The mi2 must be off for toolpaths and point selections when not # part of the canned cycle. # #G74/75 Canned cycles: # 1) Create a tool path for groove cut with a flat bottom and square sides # and aligned to the machine axis. Select "Groove" to create the tool # path. Positioning points are applied the same as with the G71/G72 cycle. Cut the groove with # Use a grooving tool of the proper width and with the end parallel to # the bottom of the groove to be cut. Compensate the tool to create the # desired tool path. # 2) At the parameters page set the amount of stock to leave and mi2. # 3) Accept the toolpath if it is good, do not accept paths with # gouges etc.. # # NOTE: G74/G75 canned cycle function from a SINGLE groove tool path. # #G70 canned cycle finish pass recall: # 1) G70 canned cycles are generated automatically if the absolute position # segments of additional finish tool paths match any created with the # canned cycle routine. Offset tool paths require the same tool radius # to obtain a match. All rapid motion to and from the G70 recall line # are output. # # -------------------------------------------------------------------------- #Canned text: # 1) The tailstock cantext selector is a toggle for in and out (do not select # the same point twice, two different positions must be selected). The # first point puts the tailstock out and the second in etc.. # The mi3 selection allows the tailstock to come out in the start of a # tool and with tools where cantext is not available. # 2) Toggle for pickup chute works the same as that for the tailstock. # 3) Dwell writes dwell using value in dwelltxt or mr6 if not zero, # dwell is output after the selected point. # #Threading: # 1) Mi4 allows the use of box thread G92 or G32 threading when simple # threading is selected. G92 ignores the infeed angle. # #Coolant: # 1) Remove the '#' in the global definition for 'spdlsel' to output coolant # with the spindle command. # #Canned Cycle Flags: # The canned cycle flag 'cancycseq' consists of place assignment and sign: # # 0 = Off # cycsign: # sign: positive = G71-72 # negative = G73 # cyctype: # tens: 1 = G71/G72 rough NCI # 2 = G71/G73 finish NCI, output rough NC # 3 = G71/G73 finish NCI, output rough and finish NC # 4 = G74/G75 cycle # cycseq: # ones: 1 = Position points to rough # 2 = Rough passes # 3 = Position points from rough # 4 = Position points to finish # 5 = Finish pass motion # 6 = Position points from finish # # -------------------------------------------------------------------------- # Debugging and Post switches # -------------------------------------------------------------------------- bug1 : 1 #1 = Output post to screen, 2 = output leader to screen bug2 : 0 #Append postline labels, non-zero is column position? bug3 : 0 #Append whatline no. to each NC line? bug4 : 0 #Append NCI line no. to each NC line? whatno : yes #Do not perform whatline branches? (leave as yes) fastmode : 1 #Post speed optimizing, Set to NO for debug info lathe : yes #Lathe post? metric : 0 #Set for english (0) or metric (1) calculations #Format statements for metric must be adjusted old_new_sw : 1 #Switch old (6T+), new (0T+) cycle formats, 0=old, 1=new use_gear : 0 #Output gear selection code, 0=no, 1=yes arcoutput : 1 #0 = IJK, 1 = R no sign, 2 = R signed neg. over 180 dia_mult : 2 #Multiplier for output on X axis (Neg. switches sign of X) app_retr : 1 #Move tool to and from part as displayed in backplot (0) #or perform post safety moves on tool orientation (1) thdmaj : 0 #Output of thread with horizontal line representing #the major diameter and flag int. or ext., 0=no, 1=yes #(graphics are incorrect when yes) # -------------------------------------------------------------------------- # Format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta # -------------------------------------------------------------------------- fs 1 0.4 #Decimal, absolute, 4 place, default for initialize (:) fs 2 0.4 #Decimal, absolute, 4 place fs 3 0.4d #Decimal, delta fs 4 1 0 #Integer, not leading fs 5 2 0l #Integer, force two leading fs 6 3 0l #Integer, force three leading fs 7 4 0l #Integer, force four leading fs 8 0 4t #No decimal, absolute, four trailing fs 9 0.2 #Decimal, absolute, 2 place fs 10 0.4 #Decimal, absolute, 4 place fs 11 0.5 #Decimal, absolute, 5 place fs 12 0 4lt #No decimal, absolute, leading, four trailing # -------------------------------------------------------------------------- # Format assignments # -------------------------------------------------------------------------- # Axis output formats - Linear # -------------------------------------------------------------------------- fmt X 2 xout #X position output fmt Z 2 zout #Z position output fmt X 2 xouti #X position output fmt Z 2 zouti #Z position output # -------------------------------------------------------------------------- # Axis output formats - Circular # -------------------------------------------------------------------------- fmt I 3 i #Arc center description in X fmt K 3 k #Arc center description in Z fmt I 2 iout #Arc center description in X fmt K 2 kout #Arc center description in Z fmt R 2 arcrad #Arc Radius fmt R- 2 arcradm #Arc Radius over 180 degree sweep # -------------------------------------------------------------------------- # Program & Sequence number format # -------------------------------------------------------------------------- fmt O 7 progno #Program number fmt N 4 n #Sequence number # -------------------------------------------------------------------------- # Tool format # -------------------------------------------------------------------------- fmt T 12 toolno #Tool number fmt G 5 wcs #WCS number # -------------------------------------------------------------------------- # Spindle Speeds & Feedrate format # -------------------------------------------------------------------------- fmt S 4 speed #CSS spindle speed fmt S 4 strt_spd #RPM spindle speed fmt S 4 maxss #RPM spindle speed fmt F 10 fipr #IPR feedrate fmt F 9 fipm #IPM feedrate fmt M 4 gear #Gear range # -------------------------------------------------------------------------- # Drill variable format # -------------------------------------------------------------------------- fmt P 1 dwell #Dwell fmt 1 initht #Initial Height fmt Z 1 refht #Reference Height fmt Z 1 depth #Depth fmt 1 peck1 #First peck increment (positive) fmt 1 peck2 #Second or last peck (positive) fmt 1 peckclr #Safety distance fmt 1 retr #Retract height fmt 1 frplunge #Drill feedrate # -------------------------------------------------------------------------- # Threading variable format # -------------------------------------------------------------------------- fmt R 2 thdfinish #G76 thread finish allowance fmt P 5 nspring #Number of spring cuts fmt Q 8 thdfrsts #Save initial value of 'thdfirst' fmt Q 8 thdlasts #Save initial value of 'thdlast' fmt E 11 thdlead #Thread lead fmt X 2 thdxg76 #G76 thread X position fmt U 2 thdxdlt #Thread taper in G32 fmt R 2 thdrdlt #Thread R delta G92 and G76 fmt 5 thdang #G76 threading angle fmt 2 thdxr #Thread X rapid position fmt Z 2 thdz2 #Thread end point in Z fmt Z 2 thdzr #Thread Z rapid position fmt P 8 thdht #Thread height absolute fmt 5 mr5 #G76 threading chamfer value fmt A 5 thdang0 #G76 threading angle, old style fmt I 2 thdrdlt0 #Thread I delta G76, old style fmt K 2 thdht0 #Thread height absolute, old style fmt D 2 thdfrsts0 #Save initial value of 'thdfirst', old style # -------------------------------------------------------------------------- # Canned cycle variable format # -------------------------------------------------------------------------- fmt U 2 g70cc_d #Depth of canned cycle rough cut fmt W 2 g70cc_d_72 #Depth of canned cycle rough cut fmt P 2 g74cc_d #Depth of G74 canned cycle rough cut fmt Q 2 g74peck #Peck of G74 canned cycle rough cut fmt R 4 g73cnt #Number of cuts for G73 canned cycle fmt U 2 xstck #Calculated max/min for allowance amount fmt W 2 zstck #Calculated max/min for allowance amount fmt U 2 g73xa2 #Stored offset of canned cycle rough cut G73 fmt W 2 g73za2 #Stored offset of canned cycle rough cut G73 fmt R 2 g70clr #R G70's and thread cycle clearance fmt P 4 ng70s #P line number in canned cycle fmt Q 4 ng70e #Q line number in canned cycle fmt P 4 ng70s_r #P line number in canned cycle fmt Q 4 ng70e_r #Q line number in canned cycle fmt X 2 g74x #End X positition G74 canned cycle fmt Z 2 g74z #End Z positition G74 canned cycle fmt D 2 g70cc_d0 #Depth of canned cycle rough cut, old style fmt D 4 g73cnt0 #Number of cuts for G73 canned cycle, old style fmt I 2 g73xa20 #Stored offset of canned cycle rough G73, old style fmt K 2 g73za20 #Stored offset of canned cycle rough G73, old style fmt I 2 g74cc_d0 #Depth of G74 canned cycle rough cut fmt K 2 g74peck0 #Peck of G74 canned cycle rough cut fmt D 2 g70clr0 #R G70's and thread cycle clearance # -------------------------------------------------------------------------- # INITIALIZE - initialize system variables and define user variables # -------------------------------------------------------------------------- newglobal : 1 #Error checking for global variables arctype : 2 #Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc. breakarcs : 1 #Break arcs into quadrants? getnextop : 1 #Build the next variable table omitcrlf : no #Omit CR/LF omitseq : yes #Omit sequence no. omitround : yes #Omit rounding of nci data progname : 1 #Use uppercase for program name seqmax : 9999 #Max. sequence no. skipmotest : 0 #Skip motion test in linear spaces : 0 #Number of spaces to add before fields tooltable : 1 #Read for tool table and pwrtt zero : 0 #Define constant one : 1 #Define constant two : 2 #Define constant c9k : 9999 #Define constant max_speed : 5000 #Maximum spindle speed (used if maxss out of range) min_speed : 20 #Minimum spindle speed speed : 0 #Absolute value of ss gear_spd : 0 #Absolute value of gear speed speedx : 0 #Test spindle calculation X position dwelltxt : .5 #Default for dwell with cantext selection chute : 0 #Toggle for part catcher operation tlstk : 0 #Toggle for tailstock operation orient2 : 0 #Orient for gang tool map ccompsav : 0 #Cutter comp. modal variable absswp : 0 #Absolute sweep thdflg : 0 #Flag for thread repetitions root : 0 #Thread root calculation frsel : 1 #Feedrate type selector sof : 1 #Start of file flag eof : 0 #End of file flag # -------------------------------------------------------------------------- # Canned cycle variables # -------------------------------------------------------------------------- mtchflag : 0 #Match direction for canned cycle routines mtchflag2 : 0 #Match direction for canned cycle routines g70mtch1 : 0 #Match in G70 recall test as binary g70mtch2 : 0 #Match in G70 recall test as sum g71cnt : 0 #Count lines in finish pass g71seq : 0 #Counter for canned cycle sequence loop : 0 #Cycle output call cycsign : 1 #Flag for cancycseq sign cycseq : 0 #Flag for cancycseq sequence cyctype : 0 #Flag for cancycseq type cancycseq : 0 #Flag for sequence frc_retr2 : 0 #Flag for canned cycle retract cycsign2 : 0 #Flag for cancycseq sign found : 0 #Return for parameter call depth_r : 0 #Depth from rough parameters xstck_r : 0 #X stock from rough parameters zstck_r : 0 #Z stock from rough parameters angle_r : 0 #Angle from rough parameters ncuts_f : 0 #Cuts from finish parameters xstck_f : 0 #X stock from finish parameters zstck_f : 0 #Z stock from finish parameters depth_f : 0 #Depth from finish parameters xentv_f : 0 #X entry from finish parameters zentv_f : 0 #Z entry from finish parameters xretv_f : 0 #X retract from finish parameters zretv_f : 0 #Z retract from finish parameters depth_g : 0 #Depth from groove parameters vert_g : 0 #Flag for horizontal(0) or vertical(1) xentv_g : 0 #X entry from groove parameters zentv_g : 0 #Z entry from groove parameters xretv_g : 0 #X retract from groove parameters zretv_g : 0 #Z retract from groove parameters cycledone2 : 0 #Flag to update previous with canned cycle done flag canccflag : 0 #Flag for canned cycle routines with cutter comp. canccpnt : 0 #Flag for canned cycle routines with cutter comp. canccout : 0 #Flag for canned cycle cutter comp. output g70skip : 0 #Flag to delay output on G70 recall test g70test : 0 #Flag if test for G70 cycle dir_rpx : 0 #Binary value for canned cycle type, rapid dir_rpz : 0 #Binary value for canned cycle type, rapid dir_fdx : 0 #Binary value for canned cycle type, feed dir_fdz : 0 #Binary value for canned cycle type, feed frsel : 1 #Feedrate type selector ccseq : 0 #Passed cancycseq value ccprcnt : .25 #Percent between max and min where contour starts cyctyp : 0 #Canned cycle type, 0 thru 7 test : 0 #Test variable #Modify these for metric g70clr : .02 #Default clearance for canned cycle g74peck : .05 #Default G74/75 peck amount canccxz : .05 #Enter the motion in X and Z to offset start when comp. #is used with the canned cycles # -------------------------------------------------------------------------- # Saved variables # -------------------------------------------------------------------------- ccompsav : 0 #Save cutter compensation coms1 : 1 #Comment start number come1 : 1 #Comment end number come1s : 0 #Comment end number, saved coms1s1 : 0 #Comment start number, first tool coms1s2 : 0 #Comment start number, second tool dwelltxts : dwelltxt #Save the default value g70clrs : g70clr #Save the default value g74pecks : g74peck #Save the default value g73dst : 0 #Total distance between passes in G73 prvgcode : 0 #Previous gcode xa : 0 #X absolute value za : 0 #Z absolute value xi : 0 #Incremental value for X zi : 0 #Incremental value for Z xrapid : 0 #X rapid value for retract zrapid : 0 #Z rapid value for retract txi2 : 0 #Direction of canned cycle finish cut tzi2 : 0 #Direction of canned cycle finish cut txa1 : 0 #Position of canned cycle finish cut tza1 : 0 #Position of canned cycle finish cut txa2 : 0 #Position of canned cycle finish cut tza2 : 0 #Position of canned cycle finish cut rtnx : 0 #Test canned cycle X return rtnz : 0 #Test canned cycle Z return xsav : 0 #X saved value for inc. zsav : 0 #Z saved value for inc. prvx : 0 #Previous X value for incremental calculation prvz : 0 #Previous Z value for incremental calculation xrsav1 : 0 #Save X rapid zrsav1 : 0 #Save Z rapid xrsav2 : 0 #Save X rapid zrsav2 : 0 #Save Z rapid xrsav3 : 0 #Save X rapid with comp. zrsav3 : 0 #Save Z rapid with comp. xr_fsav : 0 #Test X rapid finish canned cycle match zr_fsav : 0 #Test Z rapid finish canned cycle match # -------------------------------------------------------------------------- # Canned drill cycle ON/OFF switches # -------------------------------------------------------------------------- usecandrill : no # use canned drill cycle usecanpeck : no # use canned drill cycle usecanchip : no # use canned drill cycle usecantap : yes # use canned drill cycle usecanbore1 : no # use canned drill cycle usecanbore2 : yes # use canned drill cycle usecanmisc1 : no # use canned drill cycle usecanmisc2 : no # use canned drill cycle # -------------------------------------------------------------------------- # BUFFER FUNCTION # -------------------------------------------------------------------------- # Toolchange information buffer - buffer 1 wc1 : 1 #Initial count for write buffer 1 rc1 : 1 #Initial count for read buffer 1 size1 : 0 #Buffer 1 size rc1sav1 : 0 #Buffer 1 save write position upd_106 : 0 #Saved count for the first point motion (0 is off) frc_tool2 : 0 #Duplicate variable to prevent buffer overwrite gcode1 : 0 #Buffer 1 ccomp1 : 0 #Buffer 1 tcr1 : 0 #Buffer 1 opcode1 : 0 #Buffer 1 tool1 : 0 #Buffer 1 tloffno1 : 0 #Buffer 1 maxss1 : 0 #Buffer 1 orient1 : 0 #Buffer 1 ss1 : 0 #Buffer 1 fr1 : 0 #Buffer 1 coolant1 : 0 #Buffer 1 xr1 : 0 #Buffer 1 zr1 : 0 #Buffer 1 xh1 : 0 #Buffer 1 zh1 : 0 #Buffer 1 spdir1 : 0 #Buffer 1 x_min1 : 0 #Buffer 1 x_max1 : 0 #Buffer 1 frc_tool : 0 #Buffer 1 frc_retr : 0 #Buffer 1 strt_spd1 : 0 #Buffer 1 cancycseq1 : 0 #Buffer 1 mi1_1 : 0 #Buffer 1 mi2_1 : 0 #Buffer 1 mi3_1 : 0 #Buffer 1 mi4_1 : 0 #Buffer 1 mi6_1 : 0 #Buffer 1 mr3_1 : 0 #Buffer 1 mr4_1 : 0 #Buffer 1 mr6_1 : 0 #Buffer 1 cycledone : 0 #Buffer 1 fbuf 1 0 31 0 #Buffer 1 # Canned cycle recall for record position and sequence number - buffer 2 wc2 : 1 #Initial count for write buffer 2 rc2 : 1 #Initial count for read buffer 2 rc2sav2 : 0 #Buffer 2 save write position size2 : 0 #Buffer 2 size cctool1_2 : 0 #Buffer 2 cctool2_2 : 0 #Buffer 2 frc_toolcc1: 0 #Buffer 2 frc_toolcc2: 0 #Buffer 2 ng70s2 : 0 #Buffer 2 ng70e2 : 0 #Buffer 2 rc3s_2 : 0 #Buffer 2 rc3e_2 : 0 #Buffer 2 ccss1_2 : 0 #buffer 2 cancc1 : 0 #Set canned cycle sequence one flag cancc4 : 0 #Set canned cycle sequence four flag fbuf 2 0 11 0 #Buffer 2 # Finish canned cycle pass - buffer 3 wc3 : 1 #Initial count for write buffer 3 rc3 : 1 #Initial count for read buffer 3 size3 : 0 #Buffer 3 size rc3ssav1 : 0 #Saved start record for write to buffer 2 rc3ssav2 : 0 #Saved start record for write to buffer 2 rc3esav2 : 0 #Saved end record for write to buffer 2 gcode3 : 0 #Buffer 3 ccomp3 : 0 #Buffer 3 xi3 : 0 #Buffer 3 zi3 : 0 #Buffer 3 xa3 : 0 #Buffer 3 za3 : 0 #Buffer 3 i3 : 0 #Buffer 3 k3 : 0 #Buffer 3 xc3 : 0 #Buffer 3 zc3 : 0 #Buffer 3 arcrad3 : 0 #Buffer 3 fr3 : 0 #Buffer 3 cantext3 : 0 #Buffer 3 cancycseq3 : 0 #Buffer 3 fbuf 3 0 14 0 #Buffer 3 # Comparison pass for G70 recall - buffer 5 wc5 : 1 #Initial count for write buffer 5 rc5 : 1 #Initial count for read buffer 5 size5 : 0 #Buffer 5 size rc5sav : 0 #Buffer 5 save start G70 position rc5esav : 0 #Buffer 5 save end G70 position gcode5 : 0 #Buffer 5 ccomp5 : 0 #Buffer 5 xi5 : 0 #Buffer 5 zi5 : 0 #Buffer 5 xa5 : 0 #Buffer 5 za5 : 0 #Buffer 5 i5 : 0 #Buffer 5 k5 : 0 #Buffer 5 arcrad5 : 0 #Buffer 5 fr5 : 0 #Buffer 5 cantext5 : 0 #Buffer 5 com5 : 0 #Buffer 5 fbuf 5 0 12 0 #Buffer 5 # Post string - buffer 6 wc6 : 1 #Initial count for write buffer 6 rc6 : 1 #Initial count for read buffer 6 string6 #Buffer 6 sblank fbuf 6 0 80 0 #Buffer 6 # -------------------------------------------------------------------------- # FORMULAS - global formulas # -------------------------------------------------------------------------- arcradm = arcrad #Negative arcrad spdlsel = fsg3 ( spdir1 ) #+ ( fsg2 ( coolant ) * 3 ) #Remove '#' for coolant cycseq2 = frac ( abs (cancycseq1) * .1) * 10 #Sequence cyctype2 = int ( abs (cancycseq1 * .1)) #Type # -------------------------------------------------------------------------- # Lookup table definitions - for math functions FLOOK and FRANGE # -------------------------------------------------------------------------- # Define the gear selection code flktbl 4 3 # Lookup table definitions - table no. - no. entries 40 0 # Low gear range 41 400 # Med gear range 42 2250 # Hi gear range # -------------------------------------------------------------------------- # Parameter lookup table function # -------------------------------------------------------------------------- fprmtbl 101 4 #Rough cut parameters 10200 depth_r 10202 xstck_r 10203 zstck_r 10204 angle_r fprmtbl 102 8 #Finish cut parameters 10100 ncuts_f 10101 depth_f 10102 xstck_f 10103 zstck_f 11001 zentv_f 11002 xentv_f 11011 zretv_f 11012 xretv_f fprmtbl 103 6 #Groove cut parameters 10301 depth_g 10304 vert_g 11001 zentv_g 11002 xentv_g 11011 zretv_g 11012 xretv_g # -------------------------------------------------------------------------- # String functions - string select and definitions # -------------------------------------------------------------------------- # Motion G code selection sg00 G0 #Rapid sg01 G1 #Linear feed sg02 G2 #Circular interpolation CW sg03 G3 #Circular interpolation CCW sg04 G4 #Dwell sgcode #Target for string fstrsel sg00 gcode sgcode # -------------------------------------------------------------------------- # Cutter compensation G code selection scc0 #Cutter compensation state not changed sg40 #Cancel cutter compensation sg41 G41 #Cutter compensation left sg42 G42 #Cutter compensation right sg140 G40 #Last linear move cancel cutter comp sccomp #Target for string fstrsel scc0 ccompsav sccomp # -------------------------------------------------------------------------- # Select canned cycle type, profile is direction of finish profile vector sg70 G73 #Cycle type G73 sg71 G71 #Cycle type based on cut direction sg72 G71 #Cycle type " sg73 G71 #Cycle type " sg74 G71 #Cycle type " sg75 G72 #Cycle type " sg76 G72 #Cycle type " sg77 G72 #Cycle type " sg78 G72 #Cycle type " sg79 G74 #G74 selector sg80 G75 #G75 selector scangcode #Target for string fstrsel sg70 cyctyp scangcode # -------------------------------------------------------------------------- # Feed type G code selection sg99 G99 #IPR sgxx sg98 G98 #IPM sgfeed #Target for string fstrsel sg99 frsel sgfeed # -------------------------------------------------------------------------- sm03 M4 # Spindle reverse - no coolant sm04 M5 # Spindle off - no coolant sm05 M3 # Spindle forward - no coolant sm13 M14 # Spindle reverse - coolant sm14 M05 # Spindle off - coolant sm15 M13 # Spindle forward - coolant spindle fstrsel sm03 spdlsel spindle # -------------------------------------------------------------------------- # Coolant M code selection sm09 M9 #Coolant off sm08 M8 #Coolant on 1 sm07 M7 #Coolant on 2 scoolant #Target for string fstrsel sm09 coolant scoolant # -------------------------------------------------------------------------- # Tailstock M code selection sm25 M25 #Tailstock in sm26 M26 #Tailstock out stlstk #Target for string fstrsel sm25 tlstk stlstk # -------------------------------------------------------------------------- # Chute M code selection sm73 M73 #Chute in sm74 M74 #Chute out schute #Target for string fstrsel sm73 chute schute # -------------------------------------------------------------------------- # POSTLINE STATEMENTS # -------------------------------------------------------------------------- pparameter #Information from parameter file (function must be turned on in #NC configuration settings for canned cycles found = one if cyctype2 = one | cyctype2 = 4 | sof = one, found = fprm (opcode) # -------------------------------------------------------------------------- # Buffer read # -------------------------------------------------------------------------- preadbuf1 #Read from buffer 1 gcode1 = rbuf ( one, rc1 ) ccompsav = abs (ccomp1) preadbuf2 #Read canned cycle motion rough tool path cctool1_2 = rbuf ( two, rc2 ) preadbuf3 #Read canned cycle motion finish tool path gcode3 = rbuf ( 3, rc3 ) gcode = gcode3 ccomp = ccomp3 xi = xi3 zi = zi3 xa = xa3 za = za3 i = i3 k = k3 xc = xc3 zc = zc3 arcrad = arcrad3 fr = fr3 cantext = cantext3 preadbuf5 #Read comparison motion G70 recall gcode5 = rbuf ( 5, rc5 ) gcode = gcode5 ccomp = ccomp5 xa = xa5 za = za5 xi = xi5 zi = zi5 i = i5 k = k5 arcrad = arcrad5 fr = fr5 cantext = cantext5 rc6 = com5 # -------------------------------------------------------------------------- # Buffer write # -------------------------------------------------------------------------- pwritbuf2 #Write canned cycle rough tool path cctool1_2 = wbuf ( 2, wc2 ) pwritbuf3 #Write canned cycle finish tool path gcode3 = gcode ccomp3 = ccomp xi3 = xi zi3 = zi xa3 = xa za3 = za i3 = i k3 = k xc3 = xc zc3 = zc arcrad3 = arcrad fr3 = fr cantext3 = cantext gcode3 = wbuf ( 3, wc3 ) # -------------------------------------------------------------------------- # Canned cycle, direction vector # -------------------------------------------------------------------------- ptx1sav #Save value for comparison test position 1 txa1 = xa tza1 = za ptx2sav #Save value for comparison test position 2 txa2 = xa tza2 = za prupdbuf3 #Canned cycle contour record read update rc3 = rc3ssav2 gcode3 = rbuf ( 3, rc3 ) pwupdbuf3 #Canned cycle contour record write update wc3 = rc3ssav2 gcode3 = wbuf ( 3, wc3 ) wc3 = rc3esav2 pfindstrt_f #Canned cycle first contour position mtchflag = zero mtchflag2 = one prupdbuf3 cancycseq3 = cycseq2 pwupdbuf3 pfindstrt_v2 #Canned cycle first contour position with vector ptx1sav rc3ssav2 = wc3 cancycseq3 = -cycseq2 pfindstrt_v #Canned cycle first contour position with vector if xentv_f <> xi | zentv_f <> zi, pfindstrt_v2 else, pfindstrt_f pfindstrt_n2 #Canned cycle first contour position with no vector ptx1sav rc3ssav2 = wc3 cancycseq3 = -cycseq2 pfindstrt_n #Canned cycle first contour position with no vector if gcode = zero, pfindstrt_n2 else, pfindstrt_f pfindstrt #Canned cycle first contour position if xentv_f <> zero | zentv_f <> zero, pfindstrt_v else, pfindstrt_n pfindend_f #Canned cycle last contour position mtchflag = zero mtchflag2 = zero cancycseq3 = -cycseq2 pfindend_v #Canned cycle last contour position with vector if xretv_f <> xi | zretv_f <> zi, ptx2sav else, pfindend_f pfindend_n #Canned cycle last contour position with no vector if gcode <> zero, ptx2sav else, pfindend_f pfindend #Canned cycle last contour position if xretv_f <> zero | zretv_f <> zero, pfindend_v else, pfindend_n pbuffer3_setg #Set canned cycle output flags for groove if (xentv_g <> zero | zentv_g <> zero | xretv_g <> zero | zretv_g <> zero), "ERROR - DO NOT USE THE ENTRY-EXIT VECTORS WITH GROOVE CYCLE", e cyctyp = 9 if vert_g = zero, cyctyp = 10 xentv_f = zero zentv_f = zero xretv_f = zero zretv_f = zero pbuffer3_set #Set canned cycle output flags mtchflag = one mtchflag2 = zero cyctyp = orient if cyctyp = one | cyctyp = two | cyctyp = 5 | cyctyp = 6, rtnx = one else, rtnx = -1 if cyctyp = one | cyctyp = 4 | cyctyp = 5 | cyctyp = 8, rtnz = one else, rtnz = -1 if opcode = 103, pbuffer3_setg pbuffer3 #Set canned cycle output and write to buffer 3 cancycseq3 = cycseq2 rc3esav2 = wc3 if cycseq2 = 5 & prvgcode >= 1000, pbuffer3_set if mtchflag = one, pfindstrt if mtchflag2 = one, pfindend if mtchflag = zero & mtchflag2 = zero & cycseq2 = 5, cancycseq3 = -cycseq2 pwritbuf3 pwritbuf5 #Write canned cycle finish for comparison G70 recall gcode5 = gcode ccomp5 = ccomp xi5 = xi zi5 = zi xa5 = xa za5 = za i5 = i k5 = k arcrad5 = arcrad fr5 = fr cantext5 = cantext gcode5 = wbuf ( 5, wc5 ) com5 = zero g70skip = one # -------------------------------------------------------------------------- # Canned cycle, direction G71/G73 # -------------------------------------------------------------------------- pfix2_8 #G71/73 canned cycle cycle select fix if cyctyp = 6, cyctyp = 2 if cyctyp = 4, cyctyp = 8 pfix1_7 #G71/73 canned cycle cycle select fix if cyctyp = 5, cyctyp = 1 if cyctyp = 3, cyctyp = 7 pfix3_5 #G71/73 canned cycle cycle select fix if cyctyp = 7, cyctyp = 3 if cyctyp = 1, cyctyp = 5 pfix4_6 #G71/73 canned cycle cycle select fix if cyctyp = 8, cyctyp = 4 if cyctyp = 2, cyctyp = 6 pg71cyctyp #G71/73 canned cycle cycle select test txi2 = txa2 - txa1 tzi2 = tza2 - tza1 if txi2 > zero & tzi2 > zero, pfix2_8 if txi2 > zero & tzi2 < zero, pfix1_7 if txi2 < zero & tzi2 > zero, pfix3_5 if txi2 < zero & tzi2 < zero, pfix4_6 pg73vec #G73 canned cycle direction, vector g73dst = ncuts_f * depth_f g73xa2 = vsa ( g73dst, test ) pg73rh #G73 canned cycle direction, RH vector test = vrh ( txi2 ) pg73vec pg73lh #G73 canned cycle direction, LH vector test = vlh ( txi2 ) pg73vec pg73dir #Calculate canned cycle routine direction and depth if cyctyp = one | cyctyp = 3 | cyctyp = 6 | cyctyp = 8, pg73lh else, pg73rh g73cnt = ncuts_f pg71dir #G71 canned cycle direction angle_r = abs (fmtrnd (angle_r * rad2deg)) if not (angle_r = zero | angle_r = 90 | angle_r = 180 | angle_r = 270 | angle_r = 360), "ERROR-CUT DIRECTION MUST BE ALONG AN AXIS", e # -------------------------------------------------------------------------- # Canned cycle, buffer read loop # -------------------------------------------------------------------------- pcancycset #Reset canned cycle flags g71cnt = zero g71seq = zero canccout = zero cyctype = zero cyctyp = zero cancc1 = zero cancc4 = zero ptoolstrt2c #Apply rapid position to tool start with no point and comp txa1 = xrsav3 tza1 = zrsav3 ptoolstrt2 #Apply rapid position to tool start with no point txa1 = xr_fsav tza1 = zr_fsav if canccflag = one, ptoolstrt2c ptoolstart #Apply rapid position to tool start if canccpnt <> one, ptoolstrt2 xrapid = txa1 zrapid = tza1 xsav = txa1 zsav = tza1 xr = xsav ss = ss1 pspindle pxrsav3 #Apply rapid position for cutter compensation xrsav3 = xr_fsav + ( canccxz * rtnx ) zrsav3 = zr_fsav + ( canccxz * rtnz ) pxr_savz #Apply rapid positions to cycle start, feed in z xr_fsav = txa2 zr_fsav = tza1 pxrsav3 pxr_savx #Apply rapid positions to cycle start, feed in x xr_fsav = txa1 zr_fsav = tza2 pxrsav3 pmodg73 #Modification G73 variables xstck = xstck_f zstck = zstck_f g73xa2 = g73xa2 + ( xstck * rtnx ) g73za2 = g73za2 + ( zstck * rtnz ) g70cc_d = depth_f pmodg71 #Modification G71 variables xstck = xstck_r zstck = zstck_r g70cc_d = depth_r pccmod #Modification of output variables if cycsign2 = zero, pmodg73 else, pmodg71 xstck = xstck * rtnx * dia_mult zstck = zstck * rtnz if cyctyp = one | cyctyp = two | cyctyp = 3 | cyctyp = 4, pxr_savz else, pxr_savx if cycsign2 = zero, cyctyp = zero pg71endpos #Update of canned cycle end position xa = xr_fsav za = zr_fsav pxzout !xa, !za pg70seq #Calculate start and end number of canned cycle, branch if omitseq = zero, ng70s = n + seqinc else, ng70s = ng70e + seqinc if omitseq = zero, ng70e = ng70s + ( ( g71cnt - one ) * seqinc ) else, ng70e = ng70s + seqinc pforcseq2 #Force sequence numbers if g71seq = zero, *n g71seq = g71seq + one if g71seq = g71cnt, *n pforcseq #Force sequence numbers if cancycseq3 = 5, pforcseq2 pg71nc2 #Output of canned cycle routines, pnc_out call cancycseq = 2 if rc3 <= rc3esav2, preadbuf3 if omitseq = one, pforcseq if cancycseq3 = 5, pnc_out if rc3 > rc3esav2, loop = zero pg71nc #Output of canned cycle routines, call cancycseq = 1, 3, 4, 5 if cancycseq3 = 5, g71cnt = g71cnt + one #sequence numbers if rc3 <= rc3esav2, preadbuf3 if cancycseq3 = ccseq, pnc_out if rc3 > rc3esav2, loop = zero # -------------------------------------------------------------------------- # Canned cycle toolchange and G70 recall # -------------------------------------------------------------------------- pg71ccomp2 #Setup for comp output with canned cycle gcode = one fr = 100 canccout = one pg71strtpos #Output of canned cycle start position if canccflag = one, pg71ccomp2 xa = xr_fsav za = zr_fsav pnc_out canccout = zero fr = fr1 prv_gcode = -1 pg71ccomp #Output of G71/G73 canned cycle if ccompsav = two | ccompsav = 3, canccflag = one else, canccflag = zero pg70strtpos #Output of canned cycle start position xa = xr_fsav za = zr_fsav pxzout @xout, @zout if xout <> prv_xout | zout <> prv_zout, pnc_out canccout = zero fr = fr1 prv_gcode = -1 pcang70ftl #Output for canned cycle finish tool pg70strtpos n, "G70", *ng70s, *ng70e, e prv_xout = c9k prv_zout = c9k pg71tlchg #Output of G71/G73 canned cycle tool change for finish pg71ccomp canccpnt = cancc4 txa1 = xrsav2 tza1 = zrsav2 ptoolstart ptoolchange # -------------------------------------------------------------------------- # Canned cycle, G71, G72 and G73 # -------------------------------------------------------------------------- pg71old #Output of canned cycle routines, old style g70cc_d0 = g70cc_d g73cnt0 = g73cnt g73xa20 = g73xa2 g73za20 = g73za2 pg70seq if cyctyp = zero, n, *scangcode, *ng70s, *ng70e, *g73xa20, *g73za20, *xstck, *zstck, *g73cnt0, pfr, e else, n, *scangcode, *ng70s, *ng70e, *xstck, *zstck, *g70cc_d0, pfr, e pg71new #Output of canned cycle routines, new style if cyctyp = zero, n, *scangcode, *g73xa2, *g73za2, *g73cnt, e if cyctyp > zero & cyctyp <= 4, n, *scangcode, *g70cc_d, *g70clr, e if cyctyp > 4, g70cc_d_72 = g70cc_d if cyctyp > 4, n, *scangcode, *g70cc_d_72, *g70clr, e pg70seq n, *scangcode, *ng70s, *ng70e, *xstck, *zstck, pfr, e pg71output #Output of G71/G73 canned cycle come1s = come1 coms1s1 = abs ( coms1s1 ) size3 = rbuf ( 3, 0 ) rc3 = rc3ssav1 if cycsign2 = zero, pg73dir else, pg71dir #Read buffer 2 to obtain tools used with cycle preadbuf2 rc1 = cctool1_2 preadbuf1 if mr3_1 <> zero, g70clr = mr3_1 if coms1s1 >= coms1 & coms1s1 < come1 & cyctype = two, coms1s1 = coms1s1 else, coms1s1 = zero if coms1s1 <> zero, come1 = coms1s1 pg71ccomp pccmod canccpnt = cancc1 txa1 = xrsav1 tza1 = zrsav1 ptoolstart if frc_toolcc1 = one, ptoolchange else, pcomread rc3 = rc3ssav1 loop = one ccseq = one while loop = one, pg71nc pg71strtpos n, psgfeed, e if old_new_sw = zero, pg71old else, pg71new if cyctyp = zero, prv_xout = c9k #Always use for Type II comp. (X and Z) if cyctyp = zero, prv_zout = c9k prv_fipr = c9k prv_speed = c9k prv_frsel = one speed = abs (ccss1_2) rc3 = rc3ssav1 loop = one while loop = one, pg71nc2 pg71endpos rc3 = rc3ssav1 loop = one ccseq = 3 while loop = one, pg71nc if frc_toolcc2 = one, pretract rc1 = cctool2_2 preadbuf1 if coms1s1 <> zero, coms1 = coms1s1 if coms1s1 <> zero, come1 = come1s if frc_toolcc2 = one, pg71tlchg else, pcomread rc3 = rc3ssav1 loop = one ccseq = 4 while loop = one, pg71nc if cyctype = 3, pcang70ftl pg71endpos rc3 = rc3ssav1 loop = one ccseq = 6 while loop = one, pg71nc #Write the buffer 3 record and sequence numbers to buffer 2 rc2sav2 = rc2 rc2 = rc2sav2 - one preadbuf2 ng70s2 = ng70s ng70e2 = ng70e rc3s_2 = rc3ssav1 rc3e_2 = rc3esav2 wc2 = rc2sav2 - one pwritbuf2 rc2 = rc2sav2 pcancycset # -------------------------------------------------------------------------- # Canned cycle, G74 # -------------------------------------------------------------------------- pg74to75 #Modification of output variables G74 to G75 xstck = g70cc_d zstck = g74peck g70cc_d = zstck g74peck = xstck pg74outold #Output G74/G75 canned cycle g74cc_d0 = g70cc_d g74peck0 = g74peck g70clr0 = g70clr n, psgfeed, e n, *scangcode, *g74x, *g74z, *g74cc_d0, *g74peck0, *g70clr0, pfr, e pg74outnew #Output G74/G75 canned cycle n, *scangcode, *g70clr, e n, *scangcode, psgfeed, *g74x, *g74z, *g74cc_d, *g74peck, pfr, e pg74output #Output of G74/G75 canned cycle come1s = come1 size3 = rbuf ( 3, 0 ) rc3 = rc3ssav1 g74x = txa2 * dia_mult g74z = tza2 #Read buffer 2 to obtain tools used with cycle preadbuf2 rc1 = cctool2_2 preadbuf1 if mr3_1 <> zero, g70clr = mr3_1 if mr4_1 <> zero, g74peck = abs ( mr4_1 ) canccflag = zero canccpnt = cancc1 xr_fsav = txa1 zr_fsav = tza1 txa1 = xrsav1 tza1 = zrsav1 ptoolstart if frc_toolcc2 = one, ptoolchange else, pcomread loop = one ccseq = one while loop = one, pg71nc fr = fr1 if vert_g = zero, pg74to75 if old_new_sw = zero, pg74outold else, pg74outnew pg71endpos rc3 = rc3ssav1 loop = one ccseq = 6 while loop = one, pg71nc pcancycset # -------------------------------------------------------------------------- # G70 recall comparison # -------------------------------------------------------------------------- pg70cmpr5t #Add values for loop g70mtch2 = g70mtch2 + test pg70cmpr5 #G70 recall, buffer 5, read till match or end if rc5 <= size5, gcode5 = rbuf ( 5, rc5 ) g70mtch2 = zero test = gcode3 - gcode5 pg70cmpr5t test = ccomp3 - ccomp5 pg70cmpr5t test = xa3 - xa5 pg70cmpr5t test = za3 - za5 pg70cmpr5t test = i3 - i5 pg70cmpr5t test = k3 - k5 pg70cmpr5t test = arcrad3 - arcrad5 pg70cmpr5t if g70mtch2 <> zero, g70mtch1 = one if rc5 > size5, g70mtch2 = zero if rc5 > size5, g70mtch1 = -1 pg70mtch3_5b #G70 recall, buffer 3 and 5 comparison, level 2 g70mtch1 = zero gcode3 = rbuf ( 3, rc3 ) if cancycseq3 = 5, pg70cmpr5 if cancycseq3 <> 5, g70mtch1 = -2 if rc3 > rc3e_2, g70mtch1 = -3 pg70mtch3_5a #G70 recall, buffer 3 and 5 comparison, level 2 g70mtch1 = zero if rc3 <= size3, gcode3 = rbuf ( 3, rc3 ) pg70cmpr5 while g70mtch1 = zero, pg70mtch3_5b pg70mtch3_5 #G70 recall, buffer 3 and 5 comparison rc5sav = rc5 - one pg70mtch3_5a pg70cmpr3 #G70 recall, buffer 3, find start values if rc3 <= size3, gcode3 = rbuf ( 3, rc3 ) if cancycseq3 = 5 | rc3 > size3, loop = one pg70cmpr1 #G70 recall, buffer 1, find rc3 start/end, level 2 if rc2 <= size2, preadbuf2 if rc3s_2 > zero | rc2 > size2, loop = one pg70cmpr #Comparison for G70 recall, buffer 1 and 3, find rc3 start/end loop = zero while loop = zero, pg70cmpr1 rc3 = rc3s_2 loop = zero while loop = zero, pg70cmpr3 rc5 = one g70mtch2 = one while g70mtch2 <> zero, pg70cmpr5 if g70mtch1 = -1, g70mtch2 = one if g70mtch1 = -1, g70mtch1 = zero if g70mtch2 = zero, pg70mtch3_5 if g70mtch1 <> zero, rc2 = size2 + one pg70read5 #G70 canned cycle output preadbuf5 pnc_out pg70mtch0 #G70 canned cycle recall routine, G70 not found while rc5 <= size5, pg70read5 pg70mtch1 #G70 canned cycle recall routine, G70 found while rc5 <= rc5sav, pg70read5 ng70s_r = ng70s2 ng70e_r = ng70e2 n, "G70", *ng70s_r, *ng70e_r, e prv_xout = c9k prv_zout = c9k rc5 = rc5esav + one pg70mtch0 pg70 #G70 canned cycle recall routine, comparison rc2sav2 = rc2 rc2 = one size2 = rbuf ( two, 0 ) size3 = rbuf ( 3, 0 ) size5 = wc5 - one mtchflag = zero while rc2 <= size2, pg70cmpr mtchflag = fsg2 ( g70mtch1 ) if mtchflag = one, rc5esav = rc5 - one rc5 = one if mtchflag = zero, pg70mtch0 if mtchflag = one, pg70mtch1 rc2 = rc2sav2 pg70skip #Call routines at end of tool for G70 recall if g70skip = one, pg70 g70skip = zero pg70recall #Comparison for G70 recall, buffer 5 if opcode = 102 & cycseq2 = zero, pwritbuf5 # -------------------------------------------------------------------------- # Comments # -------------------------------------------------------------------------- pcomwrit #Comment buffer 6 write scomm = wbuf ( 6, wc6 ) scomm = sblank #Must clear scomm before exit pcomment11 #Comments for toolchange coms1s2 = wc6 pcomwrit come1 = wc6 pcomment00 #Comments for toolpath if g70skip = one, com5 = wc6 if g70skip = one, pcomwrit if g70skip = zero, n, "(", *scomm, ")", e pcomment0 #Comments for toolpath if cycseq2 <> zero, pcomment11 else, pcomment00 pcomment1 #Comment from manual entry, must have booleans out of pcomment if nextop = 1011 | nextop = 1014 | sof = one, pcomment11 #1014 patch else, pcomment0 pcomment #Comment from manual entry pcomment1 pcomread1 #Comment, buffer 6 output if rc6 >= one, string6 = rbuf ( 6, rc6 ) if rc6 >= one, n, "(", *string6, ")", e pcomread #Comment, buffer 6 output rc6 = coms1 while rc6 < come1, pcomread1 coms1 = come1 # -------------------------------------------------------------------------- # Cutter compensation output # -------------------------------------------------------------------------- pcancc #Cancel cutter compensation if next tool is a toolchange if ccompsav = two | ccompsav = 3, ccompsav = 4 sccomp pccomp #Cutter compensation output change, does not read cancel if ccomp1 = two | ccomp1 = 3, ccompsav = ccomp if cycseq2 = zero, sccomp if canccout = one, *sccomp # -------------------------------------------------------------------------- # Position calculations # -------------------------------------------------------------------------- ps_prvx #Incremental calculations, start xa = fmtrnd(x) za = fmtrnd(z) xi = xa - prvx zi = za - prvz pe_prvx #Incremental calculations, end prvx = xa prvz = za prvgcode = gcode !x, !z pxzhout #Position calculations for home position, gauge not applied xout = xh1 * dia_mult zout = zh1 pxzout #Position calculations for x and z outputs xout = xa * dia_mult zout = za pikout #Position calculations for i and k outputs iout = i kout = k if arctype = one, iout = i * dia_mult if arctype = one, kout = k parc2 #Arc output for R w/ sign over 180 degree sweep if abs ( sweep ) <= 180, *arcrad else, *arcradm parc1 #Arc output for R w/ no sign *arcrad parc0 #Arc output for IK iout = i if dia_mult < 0, iout = -iout *iout, *k parc #Select the arc output if arcoutput = zero, parc0 if arcoutput = one, parc1 if arcoutput = two, parc2 # -------------------------------------------------------------------------- # Canned text routines # -------------------------------------------------------------------------- pdwell1 #Dwell output gcode = 4 n, *sgcode, *dwell, e pdwell #Dwell output dwell = dwelltxt if mr6 <> zero, dwell = mr6 pdwell1 pcan1 #Canned text - cantext = 0, 1, 2...10 if cantext = two, chute = zero if cantext = 3, chute = one if cantext = 4, tlstk = zero if cantext = 5, tlstk = one stlstk, schute pcan2 #Canned text - cantext = 3 if cantext = one, pdwell if opcode1 = 105 & dwell <> zero & gcode = one, pdwell1 # -------------------------------------------------------------------------- # Gear selection control # -------------------------------------------------------------------------- pgear2 #Find spindle gear and output if x_min = zero, x_min = .001 if metric = zero, gear_spd = ( 12 * abs(ss1) ) / ( pi * abs(x_min) * two ) else, gear_spd = ( 100 * abs(ss1) ) / ( pi * abs(x_min) * two ) if ss1 > 0, gear_spd = strt_spd gear = frange ( 4, gear_spd ) *gear pgear #Find spindle gear if use_gear = one, pgear2 # -------------------------------------------------------------------------- # Feed outputs # -------------------------------------------------------------------------- pfr #Output feedrate fipr = abs ( fr ) fipm = fr if frsel = zero, fipr if frsel = two, fipm !fipr !fipm psgfeed #Output feed 'mode': G99(IPR) or G98(IPM) frsel = fsg3 ( fr ) sgfeed # -------------------------------------------------------------------------- # Spindle calculations # -------------------------------------------------------------------------- ptapdir #Output reverse spindle direction for tap spdir1 = -spdir1 spindle prpm #Output for start spindle if ss1 < 0, n, "G50", *maxss, e if ss1 <> 0, n, "G97", *strt_spd, *spindle, pgear, e if ss1 = zero, n, *spindle, e pcss #Output Constant surface speed if ss1 < 0, n, "G96", *speed, e # -------------------------------------------------------------------------- # Toolchange canned cycle, capture values # -------------------------------------------------------------------------- pxrsav1 #Save rapid position at start POINT of cycle xrsav1 = fmtrnd (xr) zrsav1 = fmtrnd (zr) cancc1 = one pxrsav2 #Save rapid position at start POINT of finish cycle xrsav2 = fmtrnd (xr) zrsav2 = fmtrnd (zr) cancc4 = one pcancycsav #Calls to canned cycle flags at the toolchange g70clr = g70clrs g74peck = g74pecks dwelltxt = dwelltxts if cycseq2 <> zero, g70test = one if cycseq2 = 3, coms1s1 = -coms1s2 if coms1s1 >= zero & cycseq = 5, coms1s1 = coms1s2 if cycseq2 = one, pxrsav1 if cycseq2 = 4, pxrsav2 prvgcode = gcode # -------------------------------------------------------------------------- # Retract output blocks # -------------------------------------------------------------------------- prtrod #Retract motion for O.D. tools if xrapid < xsav, !xout prtrid #Retract motion for I.D. tools if xrapid > xsav, !xout prtrz+ #Retract motion for Z retract plus if zrapid <= zsav, !zout prtrz- #Retract motion for Z retract negative if zrapid >= zsav, !zout pr_xr_t_zr #Retract to rapid position xr then zr n, pcancc, sgcode, xout, e n, pcancc, sgcode, zout, e pr_zr_t_xr #Retract to rapid position zr then xr n, pcancc, sgcode, zout, e n, pcancc, sgcode, xout, e pr_xr_a_zr #Retract to rapid position xr and zr n, pcancc, sgcode, xout, zout, e pretract2 #Retract to rapid position from contour based on orientation if orient2 = one | orient2 = 5, pr_xr_a_zr if orient2 = two | orient2 = 3 | orient2 = 6, pr_xr_t_zr if orient2 = 4 | orient2 = 7 | orient2 = 8, pr_zr_t_xr pretract1 #Retract to rapid position from contour setup gcode = zero xsav = xa zsav = za xa = xrapid za = zrapid pxzout if orient2 = one | orient2 = two | orient2 = 5 | orient2 = 6 | orient2 = 7 | orient2 = 8, prtrod if orient2 = 3 | orient2 = 4, prtrid prtrz+ @xout, @zout if xout <> prv_xout | zout <> prv_zout, pretract2 else, n, pcancc, e pg28call #Retract to G28 if app_retr = one, pretract1 else, n, pcancc, e coolant = zero n, scoolant, e n, "G28", "U0.", "W0.", "M5", e n, *toolno, e if eof = zero, n, "M01", e phomecall #Retract to home if app_retr = one, pretract1 else, n, pcancc, e pxzhout coolant = zero n, scoolant, e n, "G0", *xout, *zout, "M5", e n, *toolno, e if eof = zero, n, "M01", e pretract #Branch to tool change on mi1 value with frc_retr toolno = tool1 / 100 if mi1_1 = zero, pg28call if mi1_1 > 0 & mi1 < 3, phomecall if mi1_1 >= 3, pg28call # -------------------------------------------------------------------------- # Approach output blocks # -------------------------------------------------------------------------- pxr_t_zr #Approach to rapid position xr then zr n, pwcs, sgcode, pccomp, *xout, scoolant, e n, *zout, e pzr_t_xr #Approach to rapid position zr then xr n, pwcs, sgcode, pccomp, *zout, scoolant, e n, *xout, e pxr_a_zr #Approach to rapid position xr and zr n, pwcs, sgcode, pccomp, *xout, *zout, scoolant, e pmaporient #Orientation is mapped if cut position is on negative side #for gang tools and gear select if orient1 = one, orient2 = 4 if orient1 = two, orient2 = 3 if orient1 = 3, orient2 = two if orient1 = 4, orient2 = one if orient1 = 5, orient2 = 8 if orient1 = 6, orient2 = 7 if orient1 = 7, orient2 = 6 if orient1 = 8, orient2 = 5 x_min = abs (x_max) papproach #Approach to rapid position on orientation and cut position if gcode = 81, gcode = zero if orient2 = one | orient2 = 5, pxr_a_zr if orient2 = two | orient2 = 6, pzr_t_xr if orient2 = 3 | orient2 = 4 | orient = 7 | orient2 = 8, pxr_t_zr presetcc #Initialize variables for buffer 5 G70 compare i = zero k = zero arcrad = zero wc5 = one preset_2 #Initialize variables at all tool changes xrapid = xa zrapid = za xsav = xa zsav = za preset #Initialize variables at all tool changes if cycseq2 = zero, preset_2 x = xh1 #home position is always start of inc. z = zh1 toolno = (tool1 * 100 + tloffno1) / 10000 strt_spd = strt_spd1 speed = abs ( ss1 ) if coolant1 < 0, prv_coolant = -1 maxss = maxss1 prv_frsel = one prv_fipr = zero prv_fipm = zero prv_xout = c9k prv_zout = c9k prv_spdlsel = one prv_gcode = zero frc_tool = zero com5 = zero pwcs #Tool change g53 position call if mi1 >= 3, wcs pg50call #Tool change G50 WCS pcomread pxzhout n, "G50", *xout, *zout, e n, "G0", *toolno, e if mi3_1 <> zero, tlstk = one if mi3_1 <> zero, n, stlstk, e prpm xa = xsav za = zsav pxzout papproach pcss prapcall #Tool change rapid position call pcomread pxzhout n, "G0", *xout, *zout, e n, "G0", *toolno, e if mi3_1 <> zero, tlstk = one if mi3_1 <> zero, n, stlstk, e prpm xa = xsav za = zsav pxzout papproach pcss pg53call #Tool change g53 position call prv_wcs = -1 wcs = mi1_1 + 50 pcomread n, "G28", "U0.", "W0.", e n, "G0", *toolno, e if mi3_1 <> zero, tlstk = one if mi3_1 <> zero, n, stlstk, e prpm xa = xsav za = zsav pxzout papproach pcss ptoolchange #Branch to tool change on mi1 value with frc_tool if opcode = 104, gcode = zero if app_retr = zero, orient2 = one x_min = x_min1 if x_min1 < -(tcr * 10), pmaporient else, orient2 = orient1 preset if mi1_1 = zero, pg50call if mi1_1 > 0 & mi1 < 3, prapcall if mi1_1 >= 3, pg53call # -------------------------------------------------------------------------- # Toolchange postline calls # -------------------------------------------------------------------------- pheader #Call prior to NCI read psof0 #Start of file for tool number zero psof psof #Start of file for non-zero tool number (see ptoolchange) frc_tool2 = one pcancyctest plast_recd rc1 = one preadbuf1 pcancycsav ng70e = seqno - seqinc rc3ssav1 = one "%" *progno, "(", progname, ")" pspindle if metric = one, n, "G21" else, n, "G20" sof = zero presetcc ptlchg0 #Call from NCI null tool change (tool number repeats) if cycseq2 = zero, pcomread pcancycsav strt_spd = strt_spd1 speed = abs ( ss1 ) toolno = (tool1 * 100 + tloffno1) / 10000 presetcc ptlchg #Call from NCI tool change (see ptoolchange) prv_x = c9k prv_z = c9k pcancycsav presetcc ptoolendcc #End of tool path, calls when canned cycle is active rc1sav1 = rc1 cyctype = cyctype2 cycsign2 = fsg3 ( cancycseq1 ) frc_retr2 = frc_retr if cycledone = one, pg71cyctyp if cycledone = one & (cyctype2 = two | cyctype2 = 3), pg71output if cycledone = one & cyctype2 = 4, pg74output rc1 = rc1sav1 frc_retr = frc_retr2 ptoolend2 #End of tool path, filter for retract motion if frc_retr = one, pretract else, pcancc ptoolend1 #End of tool path, filter for read buffer gcode = zero dwell = zero cycledone2 = cycledone if cycseq2 <> zero, ptoolendcc else, pg70skip if cycledone2 = one | cycseq2 = zero, ptoolend2 if cycseq2 = zero | cycledone2 = one, rc3ssav1 = wc3 cycledone2 = zero ptoolend #End of tool path ptoolend1 preadbuf1 peof0 #End of file for tool zero peof peof #End of file for non-zero tool if cyctype2 >= two, cycledone = one eof = one ptoolend1 n, "M30" "%" # -------------------------------------------------------------------------- # Axis motion postlines # -------------------------------------------------------------------------- prapidbr #Rapid linear movement if g70test = one, pg70recall if g70skip = zero, pnc_out prapid #Rapid linear movement ps_prvx if cyctype = 4, pfindend if cycseq2 <> zero | cycseq2 <> two, pbuffer3 if cycseq2 = zero, prapidbr pe_prvx plin #Linear line movement - at feedrate prapid pcir #Circular interpolation prapid # -------------------------------------------------------------------------- # NC output, Linear and arc output # -------------------------------------------------------------------------- psspeed #Speed output conditions if cyctype > zero & cyctype < 4 & ccss1_2 < zero, speed prapidout #Rapid linear movement if frc_tool = one, ptoolchange else, n, sgcode, pccomp, xout, zout, psspeed, !x, !z, pcan1, e plinout #Linear line movement - at feedrate if frc_tool = one, ptoolchange else, n, psgfeed, sgcode, pccomp, xout, zout, !x, !z, pfr, pcan1, e pcirout #Circular interpolation pikout if frc_tool = one, "FIRST MOVE IS AN ARC - NOT ALLOWED" else, n, psgfeed, sgcode, xout, zout, !x, !z, parc, pfr, pcan1, e pnc_out #NC motion branching pxzout pcomread if gcode = zero, prapidout if gcode = one, plinout if gcode > one & gcode < 4, pcirout pcan2 # -------------------------------------------------------------------------- # Threading postlines, only abs # -------------------------------------------------------------------------- pm23 #Chamfer code M23 if mi5 = one, n, "M23", e pm24 #Chamfer code M24 if mi5 = one, n, "M24", e pthdext1 #Find THDFLAT for external 60 deg. thread thddepth = thdlead * .61343 #Calc. thread depth thdflat = thdlead * .1667 #Calc. thread flat root = thdx2 - thddepth #Root thdncuts = mi6 pthdext #Find THDFLAT for external 60 deg. thread if thdmaj = one, pthdext1 pthdint1 #Find THDFLAT for internal 60 deg. thread thddepth = thdlead * .54127 #Calc. thread depth thdflat = thdlead * .125 #Calc. thread flat root = thdx2 + thddepth #Root thdncuts = mi6 pthdint #Find THDFLAT for internal 60 deg. thread if thdmaj = one, pthdint1 pthdmajg76 #Thread calculations 'thdmaj' override thdncuts = one if thdx1 > thdx2, pthdext if thdx1 < thdx2, pthdint if thdx1 > thdx2, thdxr = thdx2 + thdpulloff if thdx1 < thdx2, thdxr = thdx2 - thdpulloff thdxg76 = root * dia_mult x = thdxr xa = thdxr pthread0 #Thread calculations thdfrsts = thdfirst thdlasts = thdlast thdrdlt = thdx2 - thdx3 thdxdlt = ( thdx3 - thdx2 ) * dia_mult thdxg76 = thdx2 * dia_mult thdang = rad2deg * thda1 thdht = abs ( thdx1 - thdx2 ) if thdx1 > thdx2, thdxr = thdx1 + thdpulloff if thdx1 < thdx2, thdxr = thdx1 - thdpulloff if thdz1 > thdz2, thdzr = thdz1 + thdzclr + sin (thda1 * rad2deg) * thdht if thdz1 < thdz2, thdzr = thdz1 - thdzclr - sin (thda1 * rad2deg) * thdht x = thdxr z = thdzr xa = thdxr za = thdzr xsav = thdxr zsav = thdzr if frc_tool = one, ptoolchange pthrdend #Thread retraction prv_gcode = -1 thdflg = zero !xout, !zout, !z, !x pg92_1 #G92 threading zout = z xout = thdxr * dia_mult if thdflg = zero, n, xout, zout, !z, e if thdflg = zero, pm23 xout = x * dia_mult if thdflg = zero, n, "G92", *xout, !x, *thdz2, thdrdlt, *thdlead, e if thdflg = one, n, *xout, !x, e thdflg = one ptpr32 #Taper code output for G32 if thdxdlt <> 0, *thdxdlt pg32_1 #G32 threading zout = z xout = x * dia_mult n, *zout, e n, *xout, e n, "G99G32", ptpr32, *thdz2, *thdlead, e xout = thdxr * dia_mult n, "G0", *xout, e thdflg = one pg32 #Switch G32 or G92 if thdlead <= zero, "ERROR - PROGRAM IN THREADS PER INCH", e if thdmaj = one & thdflg = zero, pthdmajg76 if mi4 = zero, pg32_1 if mi4 = one, pg92_1 thdflg = one pg32e # End G32 threading xa = thdxr pxzout if mi4 = one, pm24 if mi4 = one, n, "G0", xout, e pthrdend pg76old #G76 threading old style (complex) thdang0 = thdang thdrdlt0 = thdrdlt thdht0 = thdht thdfrsts0 = thdfrsts n, "G76", *thdxg76, *thdz2, *thdrdlt0, *thdht0, *thdfrsts0, *thdang0, *thdlead, e pg76new #G76 threading new style (complex) n, "G76", *nspring, *mr5, *thdang, *thdlasts, *thdfinish, e n, "G76", *thdxg76, *thdz2, *thdht, *thdfrsts, *thdrdlt, *thdlead, e pg76 #G76 threading (complex) if thdlead <= zero, "ERROR - ENTER IN INCH PER THREAD" if thdmaj = one, pthdmajg76 pxzout n, xout, zout pm23 if old_new_sw = zero, pg76old else, pg76new pm24 pthrdend # -------------------------------------------------------------------------- # Drilling / Custom Definition, only abs # -------------------------------------------------------------------------- pdrilltool #Tool call for the drill if frc_tool = one, ptoolchange pdrill #Simple Drill Cycle ppeck #Peck Drill Cycle pchpbrk #Chip Break Drill Cycle ptap #Tap Cycle za = initht xa = xdrl pxzout pdrilltool if frplunge >= zero, "ERROR - ENTER IN INCH PER THREAD", e prv_fipr = c9k fr = frplunge if refht = initht, n, xout, zout, e if refht <> initht, n, xout, *refht, e n, psgfeed, "G1", *depth, pfr, e n, "M5", e n, "G4", *dwell, e if refht <> initht, z = refht zout = z n, "G1", *zout, ptapdir, e n, "G4", *dwell, e n, "M5", e n, ptapdir pbore1 #Canned Bore #1 Cycle pbore2 #Canned Bore #2 Cycle pg74doutold #Output G74 drill cycle g74cc_d0 = g70cc_d g74peck0 = g74peck n, psgfeed, e n, *scangcode, *g74z, *g74cc_d0, *g74peck0, *g70clr0, pfr, e pg74doutnew #Output G74 drill cycle n, *scangcode, *g70clr, e n, *scangcode, psgfeed, *g74z, *g74cc_d, *g74peck, pfr, e pmisc1 #Canned Misc #1 Cycle za = initht xa = xdrl pxzout pdrilltool if refht = initht, n, xout, zout, e if refht <> initht, n, xout, *refht, e cyctyp = 9 prv_fipr = c9k fr = frplunge g70cc_d = zero g74peck = peck1 if mr3_1 <> zero, g70clr = mr3_1 g74z = depth if old_new_sw = zero, pg74doutold else, pg74doutnew pmisc2 #Canned Misc #2 Cycle pdrill_2 #Canned Drill Cycle ppeck_2 #Canned Peck Drill Cycle pchpbrk_2 #Canned Chip Break Cycle ptap_2 #Canned Tap Cycle pbore1_2 #Canned Bore #1 Cycle pbore2_2 #Canned Bore #2 Cycle pmisc1_2 #Canned Misc #1 Cycle pmisc2_2 #Canned Misc #2 Cycle pcanceldc #Cancel canned drill cycle pcancelcc #Cancel cutter compensation # -------------------------------------------------------------------------- # Tooltable look ahead routine # -------------------------------------------------------------------------- pspindle2 #Spindle speed calculations for CSS if speedx < 0.001, speedx = 0.001 if metric = zero, strt_spd1 = ( 12 * speed ) / ( pi * speedx * two ) else, strt_spd1 = ( 100 * speed ) / ( pi * speedx * two ) strt_spd = strt_spd1 pspindle1 #Spindle speed calculations for CSS speedx = abs ( xr ) if opcode = 105, speedx = abs ( tcr ) pspindle2 pspindle #Spindle speed calculations for RPM if maxss = zero, maxss = max_speed if maxss > max_speed, maxss = max_speed speed = abs ( ss ) if ss < 0, pspindle1 if ss > 0, strt_spd1 = speed if strt_spd1 > maxss, strt_spd1 = maxss if strt_spd1 < min_speed, strt_spd1 = min_speed if opcode = 104 | opcode = 105, ss = strt_spd1 #Convert to RPM # -------------------------------------------------------------------------- pcancycseq #Canned cycle flag calculation cancycseq = (cyctype * 10 + cycseq) * cycsign pcancycdone_2 #Canned cycle is done pwritbuf2 cycledone2 = one cycsign = one cyctype = one cycseq = zero frc_toolcc1 = zero frc_toolcc2 = zero pcancycdone #Canned cycle is done? if opcode = 106 & cycseq = 6 & frc_tool2 = one, pcancycdone_2 if opcode <> 106 & (cycseq = 6 & (frc_tool2 = one | mi2 = zero | opcode = 101 | opcode = 102 | opcode = 103)), pcancycdone_2 pcycseq0 #Canned cycle initial condition if frc_tool2 <> zero, frc_toolcc1 = frc_tool2 cycseq = one pcycseq1 #Canned cycle position points to rough cycseq = two if opcode = 103, cycseq = 5 pcycseq2_2 #Canned cycle rough passes if opcode = 102, cycsign = -1 cyctype = one cctool1_2 = wc1 pcycseq2 #Canned cycle rough passes if opcode = 106, cycseq = 3 else, pcycseq2_2 pcycseq3_2 #Canned cycle position points from rough if frc_tool2 = one, cycseq = 4 pcycseq3 #Canned cycle position points from rough if opcode = 106, pcycseq3_2 else, cycseq = 5 pcycseq4_2 #Canned cycle position points to finish if frc_tool2 <> zero, frc_toolcc2 = frc_tool2 pcycseq4 #Canned cycle position points to finish if opcode = 106, pcycseq4_2 else, cycseq = 5 pcycseq5_2 #Canned cycle finish pass motion if frc_tool2 <> zero, frc_toolcc2 = frc_tool2 if opcode = 103 & frc_toolcc1 <> zero, frc_toolcc2 = one cctool2_2 = wc1 ccss1_2 = ss cyctype = two if frc_toolcc2 = one | mi2 = two, cyctype = 3 if opcode = 103, cyctype = 4 pcycseq5 #Canned cycle finish pass motion if opcode = 106, cycseq = 6 else, pcycseq5_2 pcancyctest #Canned cycle branch point, update previous record each loop pcancycseq if cycseq = two, cycseq = 3 #Promote flag if rough pass if cycseq = 5, cycseq = 6 #Promote flag if finish pass pcancycdone if cycseq = zero & mi2 <> zero, pcycseq0 if cycseq = one & opcode <> 106, pcycseq1 if cycseq = two, pcycseq2 if cycseq = 3, pcycseq3 if cycseq = 4, pcycseq4 if cycseq = 5, pcycseq5 if cycseq = one, cancc1 = one if cycseq = 4, cancc4 = one # -------------------------------------------------------------------------- p106_recd2 #Update the point move, put stuff to update in prv_ !ccomp1, !tcr1, !opcode1, !maxss1, !ss1, !fr1, !spdir1, !x_min1, !x_max1, !strt_spd1, !mi1_1, !mi3_1, !mr3_1, !mr4_1 rc1 = upd_106 gcode1 = rbuf ( one, rc1 ) ccomp1 = prv_ccomp1 tcr1 = prv_tcr1 opcode1 = prv_opcode1 maxss1 = prv_maxss1 ss1 = prv_ss1 fr1 = prv_fr1 spdir1 = prv_spdir1 x_min1 = prv_x_min1 x_max1 = prv_x_max1 strt_spd1 = prv_strt_spd1 mi1_1 = prv_mi1_1 mi3_1 = prv_mi3_1 mr3_1 = prv_mr3_1 mr4_1 = prv_mr4_1 rc1 = upd_106 #rc1 is used to write also gcode1 = wbuf ( one, rc1 ) upd_106 = zero p106_recd #Update the point move if null or cancel if toolchange if gcode1 > 1000, upd_106 = zero else, p106_recd2 plast_recd #Update the last record(s) for min-max and point rc1 = wc1 - one gcode1 = rbuf ( one, rc1 ) x_min1 = x_min x_max1 = x_max cancycseq1 = cancycseq if cycledone2 = one, cycledone = one if frc_tool2 = one, frc_retr = one else, frc_retr = zero rc1 = wc1 - one #rc1 is used to write also gcode1 = wbuf ( one, rc1 ) if upd_106 <> 0 & prv_opcode <> 106, p106_recd #test for point move update cycledone = zero cycledone2 = zero pcur_recd #Write to the current tool record mi2_1 = mi2 if opcode = 104 | opcode = 105, mi2_1 = zero gcode1 = gcode ccomp1 = zero if cc = 41, ccomp1 = two if cc = 42, ccomp1 = 3 if cc <> prv_cc, ccomp1 = -ccomp1 if opcode = 104 | opcode = 105, ccomp1 = zero tcr1 = tcr opcode1 = opcode tool1 = abs (t) tloffno1 = tloffno maxss1 = maxss orient1 = orient ss1 = ss fr1 = fr coolant1 = coolant if coolant <> prv_coolant, coolant1 = -coolant1 xr1 = xr zr1 = zr xh1 = xh zh1 = zh spdir1 = spdir pspindle #strt_spd1 frc_tool = frc_tool2 mi1_1 = mi1 mi3_1 = mi3 mi4_1 = mi4 mi6_1 = mi6 mr3_1 = mr3 mr4_1 = mr4 mr6_1 = mr6 gcode1 = wbuf ( one, wc1 ) pwrtt #Buffer toolchange information if gcode>1000 | (gcode=1000 & tloffno<>prv_tloffno & mi7=1), frc_tool2 = one else, frc_tool2 = zero pcancyctest #Set the canned cycle flags if gcode <> 1001, plast_recd pcur_recd if gcode > 1000 & opcode = 106, upd_106 = wc1 - one !cc, !tloffno, !coolant, !opcode #previous for comparison # -------------------------------------------------------------------------- # Numbered questions for Mastercam # -------------------------------------------------------------------------- 38. Rapid feedrate? 300.0 80. Communications port number for receive and transmit (1 or 2) ? 2 81. Data rate (110,150,300,600,1200,2400,4800,9600,14400,19200,38400)? 300 82. Parity (E/O/N)? E 83. Data bits (7 or 8)? 7 84. Stop bits (1 or 2)? 2 85. Strip line feeds? N 86. Delay after end of line (seconds)? 0 87. Ascii, Eia, or Binary (A/E/B)? A 88. Echo keyboard to screen in terminal emulation? n 89. Strip carriage returns? N 90. Drive and subdirectory for NC files? 91. Name of executable post processor? MPL 92. Name of reverse post processor? RPL 93. Reverse post PST file name? RPLABS 100. Number of places BEFORE the decimal point for sequence numbers? 3 101. Number of places AFTER the decimal point for sequence numbers? 0 103. Maximum spindle speed? 5000 108. Name of associated Mill post (read runclath.doc)? 110. Default tool library? LMATL.DOC # -------------------------------------------------------------------------- # Default Miscellaneous Real Values # -------------------------------------------------------------------------- 201. Default miscellaneous real variable 1 (mr1)? 0.0 202. Default miscellaneous real variable 2 (mr2)? 0.0 203. Enter the value for G71-73 and G74/75 clearance? 0.0 204. Enter the value for G74/75 peck? 0.0 205. Enter chamfer value in G76 threading? 1.0 206. Enter the default dwell? 0.5 207. Default miscellaneous real variable 7 (mr7)? 0.0 208. Default miscellaneous real variable 8 (mr8)? 0.0 209. Default miscellaneous real variable 9 (mr9)? 0.0 210. Default miscellaneous real variable 10 (mr10)? 0.0 # -------------------------------------------------------------------------- # Default Miscellaneous Integer Values # -------------------------------------------------------------------------- 301. WCS, 0=G50, 1-2=home, 3=G53, 4=G54,...? 4 302. Can Cycle(0=OFF,1=Ruff,2=Ruff/Finish)? 0 303. Output tailstock at start? 0 304. Thread output (G32 = 0 or G92 = 1)? 0 305. Thread chamfer code (0=OFF,1=ON)? 0 306. Thread number of cuts(0=OFF,1...=ON,thdmaj=yes)? 0 307. Toolchange on offset number? 0 308. Miscellaneous integer variable 8 (mi8)? 0 309. Miscellaneous integer variable 9 (mi9)? 0 310. Miscellaneous integer variable 10 (mi10)? 0 # -------------------------------------------------------------------------- # Configuration File association parameters (default is "y") # -------------------------------------------------------------------------- 400. Name of associated cfg file? 401. Read SYSTEM COLORS section? y 402. Read ALLOCATIONS section? y 403. Read TOLERANCES section? y 404. Read DATA PATHS section? y 405. Read COMMUNICATIONS section? y 406. Read DRAFT SETTINGS section? y 407. Read MISCELLANEOUS section? y 408. Read NC SETTINGS section? y 409. Read DIALOG SCRIPTS section? y 410. Read DESIGN SETTINGS section? y 411. Read PLOTTER SETTINGS section? y 412. Read ALT-KEY ASSIGNMENTS section? y