nrc fagor 8055_1

Download NRC FAGOR 8055_1

If you can't read please download the document

Upload: wesley-ferreira

Post on 29-Oct-2015

59 views

Category:

Documents


5 download

TRANSCRIPT

# Post Name : MPMASTER_FAGOR # Product : MILL # Machine Name : MM-430 VMC # Control Name : FAGOR 8050/8055 M CNC # Description : NRC VMC G-CODE POST # 4-axis/Axis subs. : YES # 5-axis : NO # Subprograms : YES # Executable : MP v9.10 # # WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO # THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE. # # -------------------------------------------------------------------------# Revision log: # -------------------------------------------------------------------------# Programmers Note: # IHS 01/30/02 - Mpmaster based on CNC Software's V8/V9 Mpfan, dat # IHS 01/30/02 - Initial post update for V9, dat # IHS 04/01/02 - Comments repeated in translational subs, dat # IHS 05/01/02 - lock_codes logic tweak, dat # IHS 05/07/02 - arccheck set to 3, dat # IHS 05/17/02 - Removed null comment from subs, dat # IHS 05/24/02 - Rotary subprograms mod, dat # IHS 07/17/02 - Incremental drilling calculation mod, dat # IHS 07/25/02 - Switch added to control rotary index move retracts, dat # IHS 03/14/03 - Synched with updates to Mpfan from V9.1, dat # NRC 10/04/07 - #"X0." Stripped out X movement @ end of program mm # NRC 10/04/07 - Tool length offset variable D added to tool call mm # NRC 10/18/07 - Changed & placed parc (I,J,) before Z move on G02 call for cir cular interpolation @ motion NC O/P mm # NRC 10/18/07 -added G05 to first program block "Start of File and Toolchange Setup" mm # NRC 11/02/07 -Changed rigid tapping cycle from R0 to R1 mm # -------------------------------------------------------------------------# Features: # -------------------------------------------------------------------------# This post supports Generic Fagor code output for 3 and 4 axis milling. # It is designed to support the features of Mastercam Mill V9. # # Following Misc. Integers are used: # mi2 - Absolute or Incremental positioning at top level # 0 = absolute # 1 = incremental # # mi9 - Lock on First WCS - Set in first operation # 0 = No # 1 = Yes # # mi10 - M00 before operation # 0 = No # 1 = Yes # # Work offsets: # wcstype - Work coordinate system # 0 = Reference return is generated and G92 with the # X, Y and Z home positions at file head. # 1 = Reference return is generated and G92 with the # X, Y and Z home positions at each tool. # 2 = WCS of G54, G55.... based on Mastercam settings.# 0 thru 5 = The WCS of G54 thru G59 respectively. # 6 and up = The WCS of G54.1 P1 and up. # 3 = Off # #Canned text: # Entering cantext on a contour point from within Mastercam allows the # following functions to enable/disable. # Cantext value: # 1 = Stop = output the "M00" stop code # 2 = Ostop = output the "M01" optional stop code # 3 = Bld on = turn on block delete codes in NC lines # 4 = bLd off = turn off block delete codes in NC lines # 5 = Dwell = Input G04 K100 command # #Milling toolpaths (4 axis) #Layout: # The term "Reference View" refers to the coordinate system associated # with the Top view (Alt-F9, the upper gnomon of the three displayed). # Create the part drawing with the axis of rotation about the axis # of the "Reference View" according to the setting you entered for # 'vmc' (vertical or horizontal) and 'rot_on_x' (machine relative # axis of rotation). # vmc = 1 (vertical machine) uses the top toolplane as the base machine # view. # vmc = 0 (horizontal machine) uses the front toolplane as the base machine # view. # Relative to the machine matrix # Rotation zero position is on the Z axis for rotation on X axis. # Rotation zero position is on the Z axis for rotation on Y axis. # Rotation zero position is on the X axis for rotation on Z axis. # The machine view rotated about the selected axis as a "single axis # rotation" are the only legal views for 4 axis milling. Rotation # direction around the part is positive in the CCW direction when # viewed from the plus direction of the rotating axis. Set the variable # 'rot_ccw_pos' to indicate the signed direction. Always set the work # origin at the center of rotation. # #Toolplane Positioning: # Create the Cplane and Tplane as the rotation of the machine view about # the selected axis of rotation. The toolplane is used to calculate # the position of the rotary axis. This is the default setting. # #3 Axis Rotary (Polar) # Polar positioning is offered in Mastercam 3 axis toolpaths through the # rotary axis options dialog. The selected toolpath is converted to angle # and radius position. The axis of rotation is forced to zero. # #Axis substitution: # Use the Rotary axis substitution by drawing the geometry flattened # from the cylinder. The rotary axis button must be active for axis # substitution information to be output to the NCI file. The radius of # the rotary diameter is added to all the Z positions at output. # #Simultaneous 4 Axis (11 gcode): # Full 4 axis toolpaths can be generated from various toolpaths under the # 'multi-axis' selection (i.e. Rotary 4 axis). All 5 axis paths are # converted to 4 axis paths where only the angle about the rotation axis # is resolved. # #Drill:# All drill methods are supported in the post. See Simultaneous 4 Axis. # #Additional Notes: # 1) Disable 4 axis by setting the numbered question 164. to 'n'. # 2) G54 calls are generated where the work offset entry of 0 = G54, # 1 = G55, etc. # 3) Metric is applied from the NCI met_tool variable. # 4) Incremental mode calculates motion from home position at toolchanges. # The home position is used to define the last position of the tool # for all toolchanges. # 5) The variable 'absinc' is now pre-defined, set mi2 (Misc. Integer) for # the 'top level' absolute/incremental program output. Subprograms are # updated through the Mastercam dialog settings for sub-programs. # 6) Always avoid machining to the center of rotation with rotary axis! # 7) Transform subprograms are intended for use with G54.. workshifts. # # END_HEADER$ # # -------------------------------------------------------------------------# General Output Settings # -------------------------------------------------------------------------spaces : 1 #Number of spaces to add between fields omitseq : no #Omit sequence numbers? seqmax : 9999 #Max. sequence number arcoutput : 0 #0 = IJK, 1 = R no sign, 2 = R signed neg. over 180 arctype : 2 #Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc. breakarcs : 2 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs do_full_arc : 0 #Allow full circle output? 0=no, 1=yes helix_arc : 1 #Support helix arc output, 0=no, 1=all planes, 2=XY plane on ly maxrad : 999 #Maximum arc radius hel_2100 : no #Acramatic 2100 style helical moves, 0=no, 1=yes usecanned : yes #Use canned drilling cycles? Set to no for long output. wcstype : 2 #0 = G92 at start, 1 = G92 at toolchanges, 2 = G54, 3 = Off force_wcs : yes #Force WCS output at every toolchange? stagetool : 0 #0 = Do not pre-stage tools, 1 = Stage tools tool_table : 1 #Tool table, 0=no, 1=yes, 2=Predator VCNC, 3=MetaCut View output_z : yes #Output Z Min and Z Max values (yes or no) cool_zmove : yes #Coolant off with last move use_pitch : 0 #0 = Use feed for tapping, 1 = Use pitch for tapping maxfeedpm : 600 #Limit for feed in inch/min maxfeedpm_m : 15000 #Limit for feed in mm/min use_gear : 0 #Output gear selection code, 0=no, 1=yes max_speed : 8000 #Maximum spindle speed changed 10 2007 by mm @ nrc min_speed : 50 #Minimum spindle speed sextnc .PIM #NC extension override # -------------------------------------------------------------------------# Rotary Axis Settings # -------------------------------------------------------------------------# Typical Vertical srotary "A" #Rotary axis prefix vmc : 1 #0 = Horizontal Machine, 1 = Vertical Mill rot_on_x : 1 #Default Rotary Axis Orientation, See ques. 164. #0 = Off, 1 = About X, 2 = About Y, 3 = About Z # Typical Horizontal #srotary "B" #Rotary axis prefix #vmc : 0 #0 = Horizontal Machine, 1 = Vertical Mill #rot_on_x : 2 #Default Rotary Axis Orientation, See ques. 164. # #0 = Off, 1 = About X, 2 = About Y, 3 = About Zrot_ccw_pos ret_on_indx s) index ctable one_rev lock_codes use_frinv rot_feed maxfrdeg maxfrinv frc_cinit ctol ixtol frdegstp: 1 : 1 : : : : : : : : : : : :#Axis signed dir, 0 = CW positive, 1 = CCW positive #Machine home retract on rotary index moves, (0 = no, 1 = ye0 #Use index positioning, 0 = Full Rotary, 1 = Index only 5 #Degrees for each index step with indexing spindle 0 #Limit rotary indexing between 0 and 360? (0 = No, 1 = Yes) 0 #Use rotary axis unlock/lock M-Codes? (0 = No, 1 = Yes) 0 #Use Inverse Time Feedrates in 4 Axis, (0 = no, 1 = yes) 1 #Use calculated rotary feed values, (0 = no, 1 = yes) 2000 #Limit for feed in deg/min 999.99#Limit for feed inverse time 1 #Force C axis reset at toolchange 225 #Tolerance in deg. before rev flag changes .01 #Tolerance in deg. for index error 10 #Step limit for rotary feed in deg/min# -------------------------------------------------------------------------# Debugging and Factory Set Program Switches # -------------------------------------------------------------------------fastmode : yes #Posting speed optimizition bug1 : 2 #0=No display, 1=Generic list box, 2=Editor bug2 : 60 #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) # -------------------------------------------------------------------------# Additional General Output Settings # -------------------------------------------------------------------------ldrcode : 0 # Leader character dec. equiv. (fleader outputs code) ncldr : 20 # No. of leader characters (fleader outputs code) nobrk : no # Omit breakup of x/y & z rapid moves LEAVE AS NO!!! omitcrlf : no # Omit CR/LF #eob : 42 # End of block nobrk progname sub_level sub_seq_typ arccheck atol ltol vtol mtol ltol_m vtol_m tooltable m_one zero one two three four five c9k : : : : : : : : : : : : : : : : : : : : no #Omit breakup of x, y & z rapid moves 1 #Use uppercase for program name (sprogname) 1 #Enable automatic subprogram support 1 #Enable subprogram sequence number reset at sub call 1 #Check for small arcs, convert to linear .01 #Angularity tolerance for arccheck = 2 .002 #Length tolerance for arccheck = 1 .0001 #System tolerance .000001 #Avoid internal rounding assuming 6 dec NCI .05 #Length tolerance for arccheck = 1, metric .0025 #System tolerance, metric 1 #Read for tool table and pwrtt - use tool_table to disable -1 0 1 2 3 4 5 9999 #Define #Define #Define #Define #Define #Define #Define #Define constant constant constant constant constant constant constant constantskp_lead_flgs : 1 get_1004 : 1 rpd_typ_v7 : 0#Do NOT use v9 style contour flags #Find gcode 1004 with getnextop? #Use Version 7 style contour flags/processing?strtool_v7 tlchng_aft cant_tlchng newglobal getnextop error_msg err_file s: : : : : : :2 2 1 1 1 1 1#Use Version 7+ toolname? #Delay call to toolchange until move line #Ignore cantext entry on move with tlchng_aft #Error checking for global variables #Build the next variable table #0=file and prompt, 1=to screen, 2=one to screen #0=fatal, 1=all errors, 2=inc mprint, 3=inc prompts, 4=alway# -------------------------------------------------------------------------# Enable Canned Drill Cycle Switches # -------------------------------------------------------------------------usecandrill : yes #Use canned cycle for drill usecanpeck : yes #Use canned cycle for Peck usecanchip : yes #Use canned cycle for Chip Break usecantap : yes #Use canned cycle for Tap usecanbore1 : yes #Use canned cycle for Bore1 usecanbore2 : yes #Use canned cycle for Bore2 usecanmisc1 : yes #Use canned cycle for Misc1 usecanmisc2 : yes #Use canned cycle for Misc2 # -------------------------------------------------------------------------# Common User-defined Variable Initializations (not switches!) # -------------------------------------------------------------------------xia : 0 #Formated absolute value for X incremental calculations yia : 0 #Formated absolute value for Y incremental calculations zia : 0 #Formated absolute value for Z incremental calculations cia : 0 #Formated absolute value for C incremental calculations cuttype : 0 #Cut type flag #0 = Tool Plane, 1 = Axis Subs, 2 = Polar, 3 = 4/5 axis #Block delete active #Return value for functions #Save spaces #Gcode saved #Absolute/Incremental Saved Value #Coolant saved #Saved work offset #Force work offset flag saved #Saved program number #Saved sequence number #Saved sequence number #Rotary configuration saved #On a toolchange flag #Copy for safe spindle direction calculation #Drill Select Initialize #Select drill reference #Fractional percent to reduce peck2 when usecan.. : no #Save Gcode in drill #Drill gcode savedbld : 0 result : 0 sav_spc : 0 sav_gcode : 0 sav_absinc : 0 sav_coolant : 0 sav_workofs : 0 sav_frc_wcs : 0 sav_progno : 0 #sav_n1 : 0 #sav_n2 : 0 sav_rot_on_x : 0 toolchng : 1 spdir2 : 1 #Drill variables drlgsel : -1 drillref : 0 peckacel : 0 drlgcode : 0 sav_dgcode : 0#Subprogram variables mr_rt_actv : 0 #Flag to indicate if G51/G68 is active #0=Off, 1=Toolchange, 2=Subprogram call/start, G68 #3=Absolute start, both rt_csav : 0 #C saved value end_sub_mny : 0 #Many tool setting captured at transform sub end#Rotary/Index variables csav : 0 #C saved value prvcabs : 0 #Saved cabs from pe_inc_calc, #Used for rotary feed and direction calculations cdelta : 0 #Calculation for angle change rev : 0 #Calculation for deg/min sav_rev : 0 #Saved revolution counter indx_out : c9k #Rotation direction calculation fmt 16 indx_mc #Rotation direction calculation #Vector Constants for Rotatary Calculations aaxisx : 1 #A axis rotation vector constant aaxisy : 0 #A axis rotation vector constant aaxisz : 0 #A axis rotation vector constant baxisx : 0 #B axis rotation vector constant baxisy : 1 #B axis rotation vector constant baxisz : 0 #B axis rotation vector constant caxisx : 0 #C axis rotation vector constant caxisy : 0 #C axis rotation vector constant caxisz : 1 #C axis rotation vector constant #Feedrate calculation variables frdelta : 0 #Calculation for deg/min frinv : 0 #Feedrate inverse time frdeg : 0 #Feedrate deg/min actual prvfrdeg : 0 #Feedrate deg/min actual ldelta : 0 #Calculation for deg/min, linear cldelta : 0 #Calculation for deg/min, linear and rotary circum : 0 #Calculation for deg/min ipr_type : 0 #Feedrate for Rotary, 0 = UPM, 1 = DPM, 2 = Inverse #Misc variables tcnt : 0 # toolcount : 1 # toolcountn : 0 # toolcountp : 0 # tooltotal : 0 # nexttool : 0 # nexttp : 0 # prvtp : 0 # counter : 0 # nstrlen : 0 # last_op_id : 0 # last_cuttype : 0 # stock_typ : 0 # cyl_typ : 0 # z_min : 99999 # z_tmin : 99999 # z_max : -99999# z_tmax : -99999# tapflg : 0 # sav_mi9 : 0 # numpeck : 0 # Count the number of tool changes Tool counter for logic control Next tool counter for logic control Previous tool counter for logic control Tool tool count Next actual tool Next tool plane Previous tool plane Counter Length of string Previous internal operation id Previous cuttype Predator Stock Type Predator Cyl Stock Type Min Z Overall min Z Max Z Overall max Z Flag for tap cycle Saved mi9 value Number of pecks# -------------------------------------------------------------------------# FORMULAS - global formulas # -------------------------------------------------------------------------toolcountn = toolcount + 1 # Index! toolcountp = toolcount - 1 # Index!# -------------------------------------------------------------------------# Format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta # -------------------------------------------------------------------------#Default english/metric position format statements fs2 1 0.7 0.6 #Decimal, absolute, 7 place, default for initialize (:) fs2 2 0.4 0.3 #Decimal, absolute, 4/3 place fs2 3 0.4 0.3d #Decimal, delta, 4/3 place #Common format statements fs2 4 1 0 1 0 #Integer, not leading fs2 5 2 0 2 0l #Integer, force two leading fs2 6 3 0 3 0l #Integer, force three leading fs2 7 4 0 4 0l #Integer, force four leading fs2 8 5 0 5 0l #Integer, force five leading fs2 9 0.1 0.1 #Decimal, absolute, 1 place fs2 10 0.2 0.2 #Decimal, absolute, 2 place fs2 11 0.3 0.3 #Decimal, absolute, 3 place fs2 12 0.4 0.4 #Decimal, absolute, 4 place fs2 13 0.5 0.5 #Decimal, absolute, 5 place fs2 14 0.3 0.3d #Decimal, delta, 3 place fs2 15 0.2 0.1 #Decimal, absolute, 2/1 place fs2 16 1 0 1 0n #Integer, forced output fs 17 1.4lt #Decimal, absolute, four trailing # -------------------------------------------------------------------------#String and string selector definitions for NC output # -------------------------------------------------------------------------#Numbered question 164. string to detect Rotary axis y/n sq164 #Address string definitions stri "I" strj "J" strk "K" strm "M" strn "N" stro "O" strp "P" srad "R" srminus "R-" sblank strz "Z" #Cantext string definitions (spaces must be padded here) sm00 "M00" sm01 "M01" scant5 "G04 P1" strtextno strcantext #Transform mirror and rotate codes strns_mir_on "G51.1" #Programmable mirror image code strns_mir_off "G50.1" #Programmable mirror image cancel code strns_rot_on "G68" #Coordinate System Rotation strns_rot_off "G69" #Coordinate System Rotation Cancel # -------------------------------------------------------------------------# Error messages # -------------------------------------------------------------------------saxiswarn "WARNING-POST ROTARY AXIS ASSIGNMENT ('rot_on_x') OVERWRITTEN BY OPE RATION"saxisoff saxiserror TION" sindxerror stlorgerr G" shomeserror GRAM" sprgnerror"ERROR-POST ROTARY AXIS ASSIGNMENT ('rot_on_x') IS DISABLED" "ERROR-INVALID ROTARY AXIS ASSIGNMENT ('rot_on_x') FOR CURRENT OPERA "WARNING-INDEX ANGLE DOES NOT MATCH POST SETTING ('ctable')" "ERROR-TOOL ORIGIN DOES NOT MATCH CENTER OF ROTATION IN POLAR MILLIN "ERROR-G92 WORK OFFSET ('wcstype') DOES NOT SUPPORT TRANSFORM SUBPRO "ERROR-SUBPROGRAM NUMBER MATCHES THE MAIN PROGRAM NUMBER"# -------------------------------------------------------------------------# Misc strings # -------------------------------------------------------------------------snull "" # Null character string sdot "." # dot string stest1 "" # Test string 1 stilde "~" # Tidle string snocomm "DEFINE TOOL NAMES" stoper "" # String for tool notes spostname "" # Post name snullop "UNDEFINED OPERATION" slicense "GTL/M07 MACHINE SHOP" #replaced with NRC # -----------------------------------------------------------------------# Parameter Tables # -----------------------------------------------------------------------fprmtbl 13 2 # Multisurf Finish 10010 stock # Amount of stock to leave on drive surfs 10227 check # Amount of stock to leave on check surfs fprmtbl 14 10010 10227 2 stock check # Multisurf Rough # Amount of stock to leave on drive surfs # Amount of stock to leave on check surfs# -------------------------------------------------------------------------# Buffer 3 - Holds the variable 'tlplnno' for each toolpath segment # -------------------------------------------------------------------------rc3 : 1 wc3 : 1 fbuf 3 0 1 0 # Buffer 3 # -------------------------------------------------------------------------# Buffer 4 - Holds the variable 't' for each toolpath segment # -------------------------------------------------------------------------rc4 : 1 wc4 : 1 fbuf 4 0 1 0 # Buffer 4 # -------------------------------------------------------------------------# Buffer 5 - Min / Max # -------------------------------------------------------------------------b5_gcode : 0 b5_zmin : 0 b5_zmax : 0 rc5 : 2 wc5 : 1 size5 : 0 fbuf 5 0 3 0 #Min / Max# -------------------------------------------------------------------------# Question format statements # -------------------------------------------------------------------------fq 1 stock_typ Predator Stock [0=Box,1=Cylindrical] fq 2 cyl_typ Cylindrical Stock Axis [1=X,2=Y,3=Z] # -------------------------------------------------------------------------# Strings - String labels must start with 's' - they are not pre-assigned # -------------------------------------------------------------------------#Select operation note sop00 "NULL......." # String definition sop01 "CONTOUR...." # " " sop02 "CONTOUR...." # " " sop03 "DRILL/MISC." # " " sop04 "POCKET....." # " " sop05 "RULED......" # " " sop06 "2D-SWEPT..." # " " sop07 "3D-SWEPT..." # " " sop08 "REVOLVED..." # " " sop09 "LOFT......." # " " sop10 "COONS......" # " " sop11 "FILLET....." # " " sop12 "FLOWLINE..." # " " sop13 "M.FINISH..." # " " sop14 "M.ROUGH...." # " " sop15 "POINT......" # " " sop16 "DRILL5AX..." # " " sop17 "CURVE5AX..." # " " sop18 "SWARF5AX..." # " " sop19 "FACING....." # " " sop20 "OP20......." # " " sopnote # Target string fstrsel sop00 opcode sopnote # -------------------------------------------------------------------------#Select operation note sdr00 "DRILL/CBORE" # String definition sdr01 "PECK DRILL." # " " sdr02 "CHIP BREAK." # " " sdr03 "TAP........" # " " sdr04 "BORE 1....." # " " sdr05 "BORE 2....." # " " sdr06 "FINE BORE.." # " " sdr07 "MISC 2....." # " " sdr08 "CUST 9....." # " " sdr09 "CUST 10...." # " " sdr10 "CUST 11...." # " " sdr11 "CUST 12...." # " " sdr12 "CUST 13...." # " " sdr13 "CUST 14...." # " " sdr14 "CUST 15...." # " " sdr15 "CUST 16...." # " " sdr16 "CUST 17...." # " " sdr17 "CUST 18...." # " " sdr18 "CUST 19...." # " " sdr19 "CUST 20...." # " " sdrnote # Target stringfstrsel sdr00 nextdc sdrnote # -------------------------------------------------------------------------# Select month smon00 "" smon01 "JAN" smon02 "FEB" smon03 "MAR" smon04 "APR" smon05 "MAY" smon06 "JUN" smon07 "JUL" smon08 "AUG" smon09 "SEP" smon10 "OCT" smon11 "NOV" smon12 "DEC" smonth fstrsel smon00 month smonth # -------------------------------------------------------------------------# General G and M Code String select tables # -------------------------------------------------------------------------# Motion G code selection sg00 G00 #Rapid sg01 G01 #Linear feed sg02 G02 #Circular interpolation CW sg03 G03 #Circular interpolation CCW sg04 G04 #Dwell sgcode #Target for string fstrsel sg00 gcode sgcode # -------------------------------------------------------------------------# Select work plane G code sg17 G17 #XY plane code sg19 G19 #YZ plane code sg18 G18 #XZ plane code sgplane #Target string fstrsel sg17 plane sgplane # -------------------------------------------------------------------------#Select english/metric code sg20 G70 #Inch code sg21 G71 #Metric code smetric #Target string fstrsel sg20 met_tool smetric # -------------------------------------------------------------------------# Cutter compensation G code selection scc0 G40 #Cancel cutter compensation scc1 G41 #Cutter compensation left scc2 G42 #Cutter compensation right sccomp #Target for string fstrsel scc0 cc_pos sccomp # -------------------------------------------------------------------------# Canned drill cycle string select sg81 G81 #drill - no dwell sg81d G82 #drill - with dwellsg83 sg83d sg73 sg73d sg84 sg84d sg85 sg85d sg86 sg86d sgm1 sgm1d sgm2 sgm2d sgc9 sgc9d sgdrillG83 G83 G69 G69 G84 G84 G89 G89 G86 G86 G85 G85 G81 G82 G81 G82#peck drill #peck drill #chip break #chip break #tap #tap #bore #1 #bore #1 #bore #2 #bore #2 #misc #1 #misc #1 #misc #2 #misc #2 #custom #9 #custom #9 #Target for- no dwell - with dwell - no dwell - with dwell - right hand - left hand - no dwell - with dwell - no dwell - with dwell - no dwell - with dwell - no dwell - with dwell - no dwell - with dwell stringfstrsel sg81 drlgsel sgdrill # -------------------------------------------------------------------------# Select incremental or absolute G code sg90 G90 #Absolute code sg91 G91 #Incremental code sgabsinc #Target string fstrsel sg90 absinc sgabsinc # -------------------------------------------------------------------------# Feed mode G code selection sg94 G94 #UPM sg94d G94 #DPM, See pfcalc_deg if you use another gcode sg93 G93 #Inverse sgfeed #Target for string fstrsel sg94 ipr_type sgfeed # -------------------------------------------------------------------------#Canned drill cycle reference height sg98 G98 #Reference at initht sg99 G99 #Reference at refht sgdrlref #Target for string fstrsel sg98 drillref sgdrlref # Drill cycle G string select # -------------------------------------------------------------------------# Generate string for spindle sm04 M04 #Spindle reverse sm05 M05 #Spindle off sm03 M03 #Spindle forward spindle #Target for string fstrsel sm04 spdir2 spindle # -------------------------------------------------------------------------# Coolant M code selection sm09 M09 #Coolant Off (Use sm09_0 through sm09_2) sm08 M08 #Coolant Flood sm08_1 M07 #Coolant Mist sm08_2 M08 #Coolant Tool sm09_0 M09 #Coolant Flood Off sm09_1 M09 #Coolant Mist Off sm09_2 M09 #Coolant Tool Off scoolant #Target for stringfstrsel sm09 coolant scoolant # -------------------------------------------------------------------------# Table unlock and lock codes slock M10 #Axis lock sunlock M11 #Axis unlock # -------------------------------------------------------------------------# Table rotation direction # Table rotation direction, index sindx_cw M22 #Rotate CW code sindx_ccw M21 #Rotate CCW code sindx_mc #Target for string fstrsel sindx_cw indx_mc sindx_mc # -------------------------------------------------------------------------# Define the gear selection code flktbl 1 3 #Lookup table definition - table no. - no. entries 40 0 #Low gear range 41 400 #Med gear range 42 2250 #Hi gear range # -------------------------------------------------------------------------# Toolchange / NC output Variable Formats # -------------------------------------------------------------------------fmt T 4 t #Tool No fmt T 4 first_tool #First Tool Used fmt T 4 next_tool #Next Tool Used fmt D 4 tloffno #Diameter Offset No fmt D 4 tlngno #Length Offset No fmt G 4 g_wcs #WCS G address fmt P 4 p_wcs #WCS P address fmt S 4 speed #Spindle Speed fmt M 4 gear #Gear range # -------------------------------------------------------------------------fmt N 4 n #Sequence number fmt X 2 xabs #X position output fmt Y 2 yabs #Y position output fmt Z 2 zabs #Z position output fmt X 3 xinc #X position output fmt Y 3 yinc #Y position output fmt Z 3 zinc #Z position output fmt A 11 cabs #C axis position fmt A 14 cinc #C axis position fmt A 4 indx_out #Index position fmt R 14 rt_cinc #C axis position, G68 fmt I 3 i #Arc center description in X fmt J 3 j #Arc center description in Y fmt K 3 k #Arc center description in Z fmt K 2 lead #Helical lead fmt R 2 arcrad #Arc Radius fmt F 15 feed #Feedrate fmt K 4 dwell #Dwell fmt K 4 dwell_out #Dwell fmt M 5 cantext #Canned text # -------------------------------------------------------------------------#Move comment (pound) to output colon with program numbers fmt 8 progno #Program number fmt 4 main_prg_no #Program number fmt P 4 sub_prg_no #Program number fmt P 4 sub_prg_call#Program number fmt X 2 sub_trnsx #Rotation pointfmt Y 2 sub_trnsy #Rotation point fmt Z 2 sub_trnsz #Rotation point # -------------------------------------------------------------------------fmt I 2 peck1 #First peck increment (positive) fmt R 2 peck2 #Second or last peck (positive) fmt C 2 peckclr #Safety distance fmt H 2 retr #Retract height fmt J 4 shftdrl #Fine bore tool shift fmt Z 2 zdrl #Depth of drill point fmt Z 2 tosz #Drilling top of stock fmt N 4 n_tap_thds #Number of threads per inch (tpi) fmt F 2 pitch #Tap pitch (inches per thread) fmt Z 2 refht_a #Reference height fmt Z 2 refht_i #Reference height fmt J 4 numpeckint #Number of pecks fmt B 2 bval #Peck value fmt D 2 dval #Refht to zdrl # -------------------------------------------------------------------------fmt "TOOL - " 4 tnote # Note format fmt " DIA. OFF. - " 4 toffnote # Note format fmt " LEN. - " 4 tlngnote # Note format fmt " DIA. - " 1 tldianote # Note format # -------------------------------------------------------------------------fmt D 17 tldia # Note format fmt R 17 tcr # Note format fmt D 2 tldia_pred # Predator VCNC format fmt C 2 tcr_pred # Predator VCNC format fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt D R F L A TD CD CL SD C 2 2 2 2 2 2 2 2 2 4 tldia_meta tcr_meta flute_meta oa_meta ta_meta td_meta cd_meta cl_meta sd_meta tipcomp # # # # # # # # # # MetaCut MetaCut MetaCut MetaCut MetaCut MetaCut MetaCut MetaCut MetaCut MetaCut View View View View View View View View View View format format format format format format format format format formatfmt 2 slot fmt 2 tool_type fmt 2 matl_type fmt 2 corner_rad_type fmt 2 diameter fmt 2 corner_rad fmt 2 threads fmt A 2 tip_angle fmt 2 dia_off fmt 2 len_off fmt 2 tool_feed fmt 2 plunge fmt 2 retract fmt 2 rpm fmt 2 coolant1 fmt 2 n_flutes1 fmt A 2 tip_angle_ch fmt fmt fmt 2 cut_ability 2 step_r_xy 2 step_r_z# 20004 Parameter line# 20006 Parameter linefmt fmt fmt fmt fmt2 2 2 2 2step_f_xy step_f_z tip_dia min_dia thd_ang # 20007 Parameter linefmt 2 pilot_dia fmt H 2 flute_len fmt 2 oa_len fmt 2 shldr_len fmt 2 arbor_dia fmt 2 hldr_dia fmt 2 hldr_len fmt 2 spindle_ccw fmt 2 sfm fmt 2 fpt fmt 2 metric fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt fmt 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2S L W H D X Y Z X Y Z X Y Z OX OY OZ X X Y Y Z Z Z Zstock # Amount of Stock left on drive surfs check # Amount of Stock left on check surfs cyl_typ # Predator Cylindral Stock Type stck_ht stck_wdth stck_thck stck_diam stck_x stck_y stck_z stck_x_min stck_y_min stck_z_min stck_meta_ht stck_meta_wdth stck_meta_thck stck_meta_ox stck_meta_oy stck_meta_oz x_tmin x_tmax y_tmin y_tmax z_tmin z_tmax min_depth max_depth # # # # # # # # Total x_min Total x_max Total y_min Total y_max Total z_min Total z_max Tool z_min Tool z_max # Mastercam version # Minor version number2 vers_no 2 m_vers_no# -------------------------------------------------------------------------# Tool Comment / Manual Entry Section # -------------------------------------------------------------------------ptoolcomment #Comment for tool tnote = t toffnote = tloffno tlngnote = tlngno tldianote = tldia ";", pstrtool, *tnote, *toffnote, *tlngnote, *tldianote, epstrtool #Comment for tool if strtool sblank, [ strtool = ucase(strtool) *strtool, " " ] pcomment #Comment from manual entry (must call pcomment2 if booleans) pcomment2 pcomment2 #Comment from manual entry spaces = 0 scomm = ucase (scomm) #1005 - Comment option 1 #1006 - Comment option 2 #1007 - Define comment with output line #1008 - Define NC parameter comment #1026 - ? if gcode = 1005, pbld, n, pspc, ";", scomm if gcode = 1006, pbld, n, pspc, ";", scomm #Comments #if gcode = 1006, pbld, n, pspc, scomm #Codes if gcode = 1007, ";", scomm if gcode = 1008, pbld, n, pspc, ";", scomm if gcode = 1026, pbld, scomm if gcode 1007 & gcode 1026, e spaces = sav_spc ptoolcomm # Comments from tool library spaces = 0 strtool=ucase(strtool) if strtoolsnull, pspc1, ";", *strtool, e else, pspc1, ";", "DEFINE TOOL NAMES", e spaces = sav_spc plistcomm # Comments from tool library strtool=ucase(strtool) if strtoolsnull, *strtool else, "DEFINE TOOL NAMES" if strtool=snull, stest1=snocomm+stilde else, stest1=strtool+stilde nstrlen = strstr(stilde,stest1)-1 counter = 1 while counter max_speed, speed = maxss if speed < min_speed, speed = min_speed ] spdir2 = fsg3(spdir) pq #Setup post based on switch settings sav_spc = spaces if stagetool = one, bldnxtool = one #Rotaxtyp = 1 sets initial matrix to top#Rotaxtyp = -2 sets initial matrix to front if vmc, rotaxtyp = one else, rotaxtyp = -2 #Shut off rotary axis if, Q164. Enable Rotary Axis button? n if ucase(sq164) = strn, rot_on_x = zero if arctype = one | arctype = four, [ result = newfs(two, i) result = newfs(two, j) result = newfs(two, k) ] else, [ result = newfs(three, i) result = newfs(three, j) result = newfs(three, k) ] if usecanned = yes, pusecannedyes else, pusecannedno pheader #Call before start of file if met_tool = one, #Metric constants and variable adjustments [ ltol = ltol_m vtol = vtol_m maxfeedpm = maxfeedpm_m ] result = nwadrs(srotary, cabs) result = nwadrs(srotary, cinc) result = nwadrs(srotary, indx_out) spaces=0 #"%99996" #if progno = 0, progno = 99999 #"%", *progno, e "%", *progname, ",MX,", e spathnc = ucase(spathnc) smcname = ucase(smcname) #";PROGRAM NAME - ", sprogname, e #";DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, e ";MASTERCAM - V", *vers_no, e ";MC9 FILE - ", smcpath, smcname, smcext, e ";POST - ", spostname, e stck_matl = ucase(stck_matl) ";MATERIAL - ", stck_matl, e ";PROGRAM - ", sprogname, sextnc, e ";DATE - ", *smonth, "-", *day, "-", *year, e ";TIME - ", *time, e ";POST DEV - ", *slicense, e spaces=sav_spc if seqno = 0, omitseq = yes sav_rot_on_x = rot_on_x rot_on_x = 0 sav_progno = progno #seqno = 10 #seqinc = 10 #n = seqnoptoolend #End of tool path, before reading new tool data !speed, !spdir2 ptlchg1002 #Call at actual toolchange, end last path hereif op_id last_op_id, [ sav_rev = rev #Axis Sub does not update to rev if one_rev = one, sav_rev = 0 ] pspindle whatline = four #Required for vector toolpaths if gcode = 1000, [ #Null toolchange ] else, [ #Toolchange and Start of file if gcode = 1002, [ #Actual toolchange pretract ] if stagetool = one, prv_next_tool = m_one prv_xia = vequ(xh) prv_feed = c9k ] # -------------------------------------------------------------------------# Motion NC output # -------------------------------------------------------------------------#The variables for absolute output are xabs, yabs, zabs. #The variables for incremental output are xinc, yinc, zinc. # -------------------------------------------------------------------------prapidout #Output to NC of linear movement - rapid pcan1, pbld, n, sgplane, `sgcode, sgabsinc, pccdia, pxout, pyout, pzout, pcout, strcantext, scoolant, e plinout #Output to NC of linear movement - feed pcan1, pbld, n, sgfeed, sgplane, `sgcode, sgabsinc, pccdia, pxout, pyout, pzout, pcout, `feed, strcantext, scoolant, e pcirout #Output to NC of circular interpolation if hel_2100 = one, pcirout2 else, pcirout1 pcirout1 #Output to NC of circular interpolation pcan1, pbld, n, `sgfeed, sgplane, sgcode, sgabsinc, pccdia, pxout, pyout, parc, pzout, pcout,feed, strcantext, scoolant, e hanged & placed parc before Z move pcirout2 #Output to NC of circular interpolation if (plane = zero & abs(zinc)>=0.0005) | (plane = one & abs(xinc)>=0.0005) | (plane = two & abs(yinc)>=0.0005), phelout else, pcirout1 phelout #Output to NC of helical interpolation if plane = zero,#c[ result = nwadrs(strk, lead) lead = abs(zinc/sweep*360) ] if plane = one, [ result = nwadrs(stri, lead) lead = abs(xinc/sweep*360) ] if plane = two, [ result = nwadrs(strj, lead) lead = abs(yinc/sweep*360) ] pcan1, pbld, n, `sgfeed, sgplane, sgcode, sgabsinc, pccdia, pxout, pyout, pzout, *lead, pcout, parc, feed, strcantext, scoolant, e pcom_moveb #Common motion preparation routines, before pxyzcout ps_inc_calc pncoutput #Movement output pcom_moveb comment if coolant 0 & coolant sav_coolant, [ pbld, n, sm09, e sav_coolant = coolant ] if coolant = 1, sm09 = sm09_0 if coolant = 2, sm09 = sm09_1 if coolant = 3, sm09 = sm09_2 if cool_zmove = yes & (nextop=1003 | (nextop=1011 & tabs(nexttool))), co olant = zero pcan if cuttype = zero, ppos_cax_lin #Toolplane rotary positioning if gcode = zero, prapidout if gcode = one, plinout if gcode > one & gcode < four, pcirout if mr_rt_actv, #Restore absolute/incremental for G51/G68 [ absinc = sav_absinc mr_rt_actv = zero ] pcom_movea pcom_movea #Common motion preparation routines, after pcan2 pe_inc_calc result = nwadrs(strz,zabs) result = nwadrs(strz,zinc) pdwl_spd #Call from NCI gcode 4 pspindle comment pspindchng pcan if fmtrnd(dwell), pcan1, pbld, n, *sgcode, *dwell, strcantext, e else, pcan1, pbld, n, strcantext, e pcan2prapid pncoutput#Output to NC of linear movement - rapidpzrapid #Output to NC of linear movement - rapid Z only pncoutput plin pncoutput pz pncoutput pmx pncoutput pcir pncoutput #Pre-process rotary motion control flags pmx0 #5 axis gcode setup if drillcur = zero, [ if fr = -2, gcode = zero else, gcode = one ] plin0 pmotion_su pcir0 pmotion_su # -------------------------------------------------------------------------# Motion output components # -------------------------------------------------------------------------pbld #Canned text - block delete if bld, '/' pfbld "/" pccdia #Cutter Compensation #Force Dxx# if prv_cc_pos cc_pos & cc_pos, prv_tloffno = c9k sccomp if cc_pos, tloffno #Force X axis output if absinc = zero, *xabs, !xinc else, *xinc, !xabs #X output if absinc = zero, xabs, !xinc else, xinc, !xabs #Force Y axis output #Force - block delete #Circular interpolation, mill arc motion test #Linear movement, mill motion test #Output to NC of circular interpolation #Output to NC of vector NCI #Output to NC of linear movement - feed Z only #Output to NC of linear movement - feedpfxoutpxoutpfyoutif absinc = zero, *yabs, !yinc else, *yinc, !yabs pyout #Y output if absinc = zero, yabs, !yinc else, yinc, !yabs #Force Z axis output if absinc = zero, *zabs, !zinc else, *zinc, !zabs #Z output if absinc = zero, zabs, !zinc else, zinc, !zabs #Force C axis output if index = zero & rot_on_x, [ if absinc = zero, *cabs, !cinc else, *cinc, !cabs ] #C axis output if index = zero & rot_on_x, [ if absinc = zero, cabs, !cinc else, cinc, !cabs ] #Index output if index & rot_on_x, [ if fmtrnd(prv_indx_out) fmtrnd(indx_out), [ if lock_codes = 1, pbld, n, *sunlock, ";UNLOCK", e pbld, n, `sindx_mc, indx_out, e if lock_codes = 1 & cuttype = 0, pbld, n, *slock, ";LOCK", e ] !cabs, !cinc ] #Select the arc output if arcoutput = zero | full_arc_flg | arc_pitch, [ #Arc output for IJK # If you do NOT want to force out the I,J,K values, # remove the "*" asterisks on the *i, *j, *k 's below... if plane = zero, *i, *j, k #XY plane code - G17 if plane = one, i, *j, *k #YZ plane code - G19 if plane = two, *i, j, *k #XZ plane code - G18 ] else, [ #Arc output for R if abs(sweep) maxfrinv, frinv = maxfrinv feed = frinv ] ] else, [ #Feedrate deg/min control and calculation ipr_type = zero #Change to ipr_type = one to force new DPM frdeg = abs(cdelta/cldelta) * abs(fr_pos * (360/circum)) if abs(frdeg - prvfrdeg) > frdegstp | ipr_type prv_ipr_type, [ #Control output of frdeg if rot_feed & opcode 3, [ prvfrdeg = frdeg feed = frdeg ] ] if frdeg > maxfrdeg & rot_feed, feed = maxfrdeg ] #Incremental calculations ps_inc_calc #Incremental calculations, start xia = fmtrnd(xabs) yia = fmtrnd(yabs) zia = fmtrnd(zabs) xinc = vsub (xia, prv_xia) ps_cinc_calc ps_cinc_calc #Incremental calculations, start rotary cia = fmtrnd(cabs) cinc = cia - prv_cia pe_inc_calc #Incremental calculations, end prvcabs = fmtrnd(cabs) #Avoid updating until called explicitly !xia, !yia, !zia, !cia !x, !y, !z # -------------------------------------------------------------------------# Tooltable Output # -------------------------------------------------------------------------pwrtt # Write tool table, scans entire file, null tools are negative if rotaxis > 0 | rotary_type > 0 | mill5 0, [ rot_on_x = sav_rot_on_x output_z = no ] #if vmc = 0 & tlplnno 2, rot_on_x = sav_rot_on_x #if vmc = 1 & tlplnno > 1, rot_on_x = sav_rot_on_x if tlplnno > 1, rot_on_x = sav_rot_on_x tlplnno = wbuf(3,wc3) #Buffers out tool plane values t = wbuf(4,wc4) #Buffers out tool number values if tool_table = 1, ptooltableif tool_table = 2, ppredtool if tool_table = 3, pmetatool if t >= zero, tcnt = tcnt + one ptravel pwritbuf5 ptooltable # Write tool table, scans entire file, null tools are negative tnote = t toffnote = tloffno tlngnote = tlngno spaces=0 if t >= zero, ";", *t, ptspace, " : ", plistcomm, " : ", *tldia, puni t, " : ", popnote #if t >= zero, # [ # if tcr>0, ";", *t, ptspace, " : ", plistcomm, " : ", *tlngno, phsp ace, " : ", *tloffno, pdspace, " : ", *tldia, punit, " : ", *tcr, " : ", popnote # if tcr=0, ";", *t, ptspace, " : ", plistcomm, " : ", *tlngno, phsp ace, " : ", *tloffno, pdspace, " : ", *tldia, punit, " : ", " : ", popnot e # ] #if t >= zero, # [ # if tcr>0, ";", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tl dia, " ", *tcr, " ", popnote # if tcr=0, ";", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tl dia, " ", popnote # ] spaces=sav_spc punit # Tool unit if met_tool, "mm", pdiamspc else, 34, pdiamspc # Tool travel limit calculation if x_min < x_tmin, x_tmin = x_min if x_max > x_tmax, x_tmax = x_max if y_min < y_tmin, y_tmin = y_min if y_max > y_tmax, y_tmax = y_max if z_min < z_tmin, z_tmin = z_min if z_max > z_tmax, z_tmax = z_max setup = 1, = 2, = 3, = 4, = 5, = 6, = 7, = 8, = 9, = 10, = 11, = 12, = 13, = 14, = 15, = 16, = 17, info for styp1 styp2 styp3 styp4 styp5 styp6 styp7 styp8 styp9 styp10 styp11 styp12 styp13 styp14 styp15 styp16 styp17 Predator Virtual CNC # CENTER DRILL 1 # SPOT DRILL 2 # DRILL 3 # TAP-RH 4 # TAP-LH 5 # REAMER 6 # BORING BAR 7 # COUNTER BORE 8 # COUNTER SINK 9 # END MILL FLAT 10 # END MILL SPHERE 11 # CHAMFER MILL 12 # FACE MILL 13 # SLOT MILL 14 # CORNER RAD MILL 15 # DOVETAIL MILL 16 # TAPER MILL 17 NTG/S4 S4 S4 S4 - MAX 179 ANGLE S4 - MAX 179 ANGLE S3/S1/S2 S3/S1/S2 NTG NTG/S4 S1 S2 S7/NTG S7/S9/NTG NTG/S1 S5/FLAT DOVETAIL/NTG S7/S9/S10ptravelppredtool # Write tool #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ #if tool_typ#if tool_typ = 18, styp18 #if tool_typ = 19, styp19 tcr_pred = tcr tldia_pred = tldia tip_angle_ch = tip_angle*2 spaces=0# LOLLIPOP MILL # END MILL BULL18 - S6 19 - S3if t >= zero, [ # CENTER DRILL if tool_typ = 1, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle, " ", *flute_len, " S4)" # SPOT DRILL if tool_typ = 2, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle, " ", *flute_len, " S4)" # DRILL if tool_typ = 3, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle, " ", *flute_len, " S4)" # TAP-RH if tool_typ = 4, [ if tip_angle 0 & tcr < tlrad, "(MTOOL ", *t, " ", *tldia_pred, " ", * tcr_pred, " ", *flute_len, " S3)" ] # COUNTER BORE if tool_typ = 8, [ if tcr = 0, "(MTOOL ", *t, " ", *tldia_pred, " ", *flute_len, " S 1)"if tcr = tlrad, "(MTOOL ", *t, " ", *tldia_pred, " ", *flute_len, " S2)" if tcr > 0 & tcr < tlrad, "(MTOOL ", *t, " ", *tldia_pred, " ", * tcr_pred, " ", *flute_len, " S3)" ] # COUNTER SINK if tool_typ = 9, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle, " ", *flute_len, " S4)" # END MILL FLAT if tool_typ = 10, "(MTOOL ", *t, " ", *tldia_pred, " ", *flute_len, " S1)" # END MILL SPHERE if tool_typ = 11, "(MTOOL ", *t, " ", *tldia_pred, " ", *flute_len, " S2)" # CHAMFER MILL if tool_typ = 12, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle_ ch, " ", *flute_len, " S7)" # FACE MILL if tool_typ = 13, "(MTOOL ", *t, " ", *tldia_pred, " ", *flute_len, " S1)" # SLOT MILL if tool_typ = 14, "(MTOOL ", *t, " ", *tldia_pred, " ", *flute_len, " S1)" # CORNER RAD MILL if tool_typ = 15, [ if tcr = 0, "(MTOOL ", *t, " ", *tldia_pred, " ", *flute_len, " S 1)" else, "(MTOOL ", *t, " ", *tldia_pred, " ", *tcr_pred, " ", *flut e_len, " S5)" ] # DOVETAIL MILL if tool_typ = 16, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle, " ", *flute_len, " S8)" # TAPER MILL if tool_typ = 17, [ if tcr = 0, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle, " " , *flute_len, " S7)" if tcr = tlrad, "(MTOOL ", *t, " ", *tldia_pred, " ", *tip_angle, " ", *flute_len, " S9)" if tcr > 0 & tcr < tlrad, "(MTOOL ", *t, " ", *tldia_pred, " ", * tcr_pred, " ", *tip_angle, " ", *flute_len, " S10)" ] # LOLLIPOP MILL if tool_typ = 18, "(MTOOL ", *t, " ", *tldia_pred, " S6)" # END MILL BULL if tool_typ = 19, "(MTOOL ", *t, " ", *tldia_pred, " ", *tcr_pred, " ", *flute_len, " S3)" ] spaces=sav_spc pmetatool # Write tool setup info for MetaCut View tcr_meta = tcr if tool_typ = 13 | tool_typ = 17, tldia_meta = tldia + (2 *(flute_len * tan(tip_angle))) else, tldia_meta = tldia if cctotip = 0, tipcomp = 1 else, tipcomp = 0 if tool_typ = 10 | opcode = 3, tipcomp = 0if tool_typ = 12, td_meta = tip_dia else, td_meta = 0 if tool_typ = 13 | tool_typ = 17, td_meta = tldia flute_meta = flute_len oa_meta = oa_len ta_meta = tip_angle cd_meta = hldr_dia cl_meta = hldr_len sd_meta = cd_meta #(NWDTOOL NAME"1/2 CHAMFER MILL" T1 D.5 R0. F2. L3. A45. TD.06 CD2. C L1. SD2. C0) # N = "Tool name" # T = Tool No. # D = Tool Dia. # R = Corner Radius # F = Flute Length # L = Tool over all length # A = Tip angle or Taper angle # TD = Tip Dia. # CD = Colllet/Holder Dia. # CL = Collet/Holder Height # SD = Spindle Dia. (set equal to Collet Diameter) # C = tip or center 0 = tip 1 = center spaces=0 if t >= zero, "(NWDTOOL N", 34, pmetacomm, 34, " ", *t, " ", *tldia_m eta, " ", [if tcr_meta > 0, *tcr_meta, " "], *flute_meta, " ", * oa_meta, " ", [if ta_meta180, *ta_meta, " "], [if td_meta > 0, *td _meta, " "], *cd_meta, " ", *cl_meta, " ", *sd_meta, " ", *tipcomp, ")" spaces=sav_spc # -------------------------------------------------------------------------# Buffer 5 Read / Write Routines # -------------------------------------------------------------------------pwritbuf5 # Write Buffer 1 b5_gcode = gcode b5_zmin = z_min b5_zmax = z_max b5_gcode = wbuf(5, wc5) preadbuf5 # Read Buffer 1 size5 = rbuf(5,0) b5_gcode = 1000 min_depth = 99999 max_depth = -99999 while rc5