# MASTERCAM MP POST PROCESSOR # CNC Software, Inc. # Control Model: Denford # Machine Model: Denford # PST File Name: MPLDENFL.PST # Executable : MPL.EXE # FEATURES: # This post uses mi1 for gear selection rather than thread pass override. # Thread pass override is mi2 # -------------------------------------------------------------------------- # Revisions Log MIKE ALL LINES THAT HAVE BEEN EDITED BY AIDEX DURING 1999/2000 # ARE IN CAPS AND ALL #'S COLUMNS IN THOSE LINES ARE OFFSET TO THE LEFT TO FIND EASIER # -------------------------------------------------------------------------- # 1/21/98 msf Initial release # # The # before sextnc must be deleted otherwise it is a comment only. # sextnc fnc This extension,.FNC is for all other Denford machines Such as the mills. # sextnc "fnl" # THIS IS THE CORRECT FILE EXTENTION FOR DENFORD'S NOVATURN LATHES # # This will change the .NC file extension to.FNL # Without this extension, the user will have to edit the file in Mastercam # with the following keystrokes. # Main Menu: File: Edit: Other. Select the directory and then select the # filename with the FNC file extension. # -------------------------------------------------------------------------- # FORMAT STATEMENTS - I=INCR., N=NONMODAL, L=LEAVE LDG., # T=LEAVE TRLG., D=DELTA fs 1 0.4t fs 2 0.4dt fs 3 4 0 fs 4 2 0ln fs 6 3 0l fs 7 0.4n fs 8 0 4n fs 9 0.5n fs 10 2 0l fs 11 4.4 fs 12 0.4 fs 13 1.4d fs 14 2 0l # FORMAT ASSIGNMENTS # fmt X 1 x - x,z,i,j are init. fs 1, with 'normal' prefix letter fmt R 1 arcrad fmt S 3 maxss fmt 13 mr1 fmt 12 g4 fmt U 1 dwell fmt X 1 xh fmt Z 1 zh fmt X 1 x2 Scale x * 2 at output only fmt Z 1 z_extra # used in threading fmt R 1 arcrad # CHANGED FROM FORCED I,J,K's fmt I 2 i # I,J have 'delta' format fmt J 2 j fmt K 2 k fmt N 6 n fmt T 3 t fmt 14 t00 # "00" to cancel offset fmt 4 tloffno fmt 4 tlngno fmt F 11 fr fmt F 11 fipr fmt F 11 fipm fmt M 3 cc # Cutter Comp. fmt S 3 ss # Spindle Speed fmt S 3 sstemp # Spindle Speed fmt 6 wcs # make Work Coord. string 'sgwcs' non-modal fmt 6 drillcyc # make string 'sgdrlcyc' non-modal fmt M 4 ssrange # Spindle Speed Range (mi2 - M42 = hi, M43 = low) fmt M 4 sscode # Spindle Speed Code (M59 - M77 from tbl 1) fmt 10 gcode # Format linear G-code selector for modality only fmt C 4 coolant fmt Q 8 thdfirst # amount of first cut fmt F 7 thdlead # thread lead fmt F 9 lead76 # thread lead fmt P 7 depth76 # thread depth fmt 4 thda1 # Infeed Angle fmt 7 thdpass # Number of thread passes fmt 7 thdncuts fmt Q 7 thdlast # Amount of last cut fmt R 7 thdfinish # Finish allowance fmt P 4 nspring fmt 4 p2 fmt 4 p3 fmt 7 thdflat fmt Z 7 thdlng # thread length fmt X 7 rootdia fmt Z 7 thdz1 # thread entry in Z fmt X 7 thdx2 # inner diameter of thread fmt Z 7 thdz2 # Z end position of thread fmt Z 7 zentry # Entry point for G76 thread fmt U 7 uword # first pass diameter - root diameter fmt P 7 thddepth # Depth per pass fmt X 7 g32retr # Retract amount in threading fmt X 7 xentry # Entry point for G76 thread fmt 7 peck1 fmt W 7 peck2 # peck increment fmt Z 7 depth # hole depth fmt X 7 initht # initial height fmt 7 ext # ext = 1 for external thread ext = 0 for internal thread fmt 1 xh1 fmt 1 pcoolon fmt 1 pcooloff # FORMULAS - USE ':' INSTEAD OF '=' TO INITIALIZE VARIABLES arcrad : 0 # CHANGED FROM FORCED I,J,K's TO ARCRADS scalex : 2 frsel : 1 t1 : 0 tfr : 0 maxss : 4000 flag2 : 0 dx : 0 dz : 0 dmove : 0 tcode : 0 spaces : 1 seqmax : 9999 # Max. sequence no. omitseq : YES # Omit sequence no.? **** I CHANGED TO YES *** frrapid : 300 # Rapid feedrate? 300.0 frmax : 300 # Maximum feedrate? 300.0 fipm : 0 # Feed IPM fipr : 0 # Feed IPR breakarcs : no # Break arcs into quadrants? no arctype : 2 # Arc center 1=abs, 2=inc, 3=st-cen, 4=unsigned inc. ncldr : 20 # No. of leader characters ldrcode : 65 # Leader character dec. equiv. bldnxtool : no # Build next tool table t00 = t # Cancel offset for tool lathe : 1 # is this a lathe post ssrange = mi2 sscode = frange(1,ss) # Spindle speed code g32retr = 2 * thdx1 - thdx2 + abs(thdx3 - thdx2) # retact above the thread # by half the thread arccheck : 3 # CONVERT SMALL ARCS TO LINEAR MOVES 1=LTOL,2=ATOL,3=BOTH # USE CANNED CYCLES? usecandrill : no # use canned drill cycle usecanpeck : no # use canned pecking drill cycle usecanchip : no usecantap : no usecanbore1 : no usecanbore2 : no usecanmisc1 : no usecanmisc2 : no # BUGS USED IN CUSTOMIZING POST bug1 : 1 # 1 = Output post to screen - 2 = output leader to screen bug2 : 0 # Add postline label to each line bug3 : 0 # Add whatline to each line bug4 : 0 # Output nci line number bug8 : 999 whatno : yes # Ignore whatline branches to plin1 etc.? ncino : yes atol : 8 # ANGLE TOL FOR ARCS ltol : .015 # LENGTH TOL FOR ARCS arclen : 0 # STRINGS - STRING LABELS MUST START WITH 'S' - THEY ARE NOT PRE-ASSIGNED # G code sg00 G00 # Linear movement at rapid feedrate G code sg01 G01 # Linear movement at feedrate G code sg02 G02 # Circular interpolation CW G code sg03 G03 # Circular interpolation CCW G code sgcode # Target string for linear/circular motion G code fstrsel sg00 gcode sgcode # Select motion G code string # Coolant sm09 M09 # Coolant off "M09" sm08 M08 # Coolant on "M08" smcool # Coolant code target string fstrsel sm09 coolant smcool # Boolean handles modality # coolant = 0 - coolant off # coolant = 1 - coolant on # Spindle sm04 M03 # Spindle reverse - no coolant "M04" sm05 M05 # Spindle off - no coolant "M05" sm03 M03 # Spindle forward - no coolant "M03" sm04c M03 # Spindle reverse - with coolant "M04" sm05c M05 # Spindle off - with coolant "M05" sm03c M03 # Spindle forward - with coolant "M03" spdlon # Target Spindle-on M-string spdlsel = coolant * 3 + fsg3(ss) # Spindle on selector based on # coolant - 0 = off, 1 = on fstrsel sm04 spdlsel spdlon # Canned drill cycle G-strings sg81 G81 # drill - no dwell sg82 G82 # drill - with dwell sg83 G83 # peck drill - no dwell sg83d G83 # peck drill - with dwell sg73 G73 # chip break - no dwell sg73d G73 # chip break - with dwell sg84 G84 # tap sg84d G84 # tap # must be here for selector to work sg85 G85 # bore #1 - no dwell sg89 G89 # bore #1 - with dwell sg86 G86 # bore #2 - no dwell sg86d G86 # bore #2 - with dwell sgm1 GGG # misc #1 - no dwell sgm1d GGG # misc #1 - with dwell sgm2 GGG # misc #2 - no dwell sgm2d GGG # misc #2 - with dwell sgdrlcyc # Target drill cycle G code drlgsel = drillcyc*2 + fsg2(dwell) # 16 possible combinations: # drillcyc = 0..7 # dwell = 0 or non-zero (2 states) fstrsel sg81 drlgsel sgdrlcyc # Drill cycle G string select # Feed Type sg95 G95 # Feed Per Miniute sgxx sg94 G94 # Feed Per Rotation sgfeed # Target for string fstrsel sg95 frsel sgfeed # USER DEFINED POSTLINES # User-defined Postline labels starting with 'p' # End a line with ',' to continue on the next line psgfeed # Feed at Inch Per Minute or Inch Per Rev frsel = fsg3 (fr) sgfeed pinit # Initialized Variables prv_fr = 999.999 prv_frplunge = 999.999 !gcode pthdlead # thread feed rate tfr = thdlead if tfr <> prv_thdlead, thdlead pfr # No feedrate output unless fr is positive (Mult. bool. example) fipr = abs(fr) fipm = fr if frsel = 0, fipr if frsel = 2, fipm !fipr !fipm pss # Spindle Speed - Positive RPM , Negative CSS sstemp = ss sstemp = abs(sstemp) # get rid of sign from NCI if ss > 0, "G97", *sstemp # if ss < 0, "G96", *sstemp I ADDED THE # TO THIS LINE TO MAKE # IT A COMMENT LINE. pcancelcc # Cancel cutter compensation #"cancelcc" pcc # Cutter comp - output only if non-zero (G40, G41, G42) if cc <> 0, cc pcoolon # Coolant on if coolant = 1, n, "M08", !coolant pcooloff # Coolant off if prv_coolant = 1, n, "M09", !coolant # PREDEFINED POSTLINES # Postline - Names are pre-assigned except for partial lines which are # called from pre-assigned lines (Ex. pt) pheader # File header # % SIGN HAS BEEN REMOVED FOR DENFORD LATHE psof0 # Start of file for tool zero 1001 psof psof # Start of file for non-zero tool number 1001 ss = abs(ss) pinit n, "[BILLET " n, "M06",t, *t00 n, sg00, xr n, zr n, "G97", *ss, *spdlon pcoolon flag2 = 1 # This flag is for M24 in threading ptlchg0 # Null tool change 1002 flag2 = 1 # This flag is for M24 in threading ptlchg # Tool change 1002 ss = abs(ss) pinit n, "G90", pcooloff n, sg00, xr n, zr n, "M06",t, *t00 n, "G97", *ss, *spdlon pcoolon flag2 = 1 # This flag is for M24 in threading peof0 # End of file for tool zero 1003 peof peof # End of file for non-zero tool 1003 pcooloff n, sg00, *xr n, *zr n, prv_t, *t00 n, "M05" n, "M30" prapid # Linear line movement - at rapid feedrate 0 n, sgcode, x, z plin # Linear line movement - at feedrate 1 n, pcc, psgfeed, sgcode, x, z, pfr pcir # CIRCULAR INTERPOLATION CHANGED FROM FORCED I,J,K's TO ARCRADS n, psgfeed, *sgcode, x, z,arcrad, pfr pdrill # Canned Drill Cycle n, "G00X0.0Z", initht n, "Z", refht n, "G01", z, pfr n, "G00Z", initht ppeck # Canned Peck Drill Cycle (USE NOT CANNED) pchpbrk # Canned Chip Break Cycle (USE NOT CANNED) ptap # Canned Tap Cycle n, "G00X0.0Z", initht n, "Z", refht n, "G32", z, fr n, "M04" n, "G32Z", refht n, "M03" pbore1 # Canned Bore #1 Cycle pbore2 # Canned Bore #2 Cycle pmisc1 # Canned Misc #1 Cycle pmisc2 # Canned Misc #2 Cycle pdrill_2 # Canned Drill Cycle pdrill ppeck_2 # Canned Peck Drill Cycle gcode = 1 n, sgcode, *x, *z, *depth, *refht, *dwell, pfr 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 n, "G80" ptooltbl # Tool table line format pthdext # Find THDFLAT for external 60 deg. thread thddepth = thdlead * .61343 thdflat = thdlead * .1667 thdncuts = mi2 rootdia = thdx2 * 2 ext = 1 pthdint # Find THDFLAT for internal 60 deg. thread thddepth = thdlead * .54127 thdflat = thdlead * .125 thdncuts = mi2 rootdia = thdx1 * 2 ext = 0 pg32 # G32 threading (simple) if flag2 = 1, n, "M24" n, "G92",*x2, !x, thdz2, pthdlead n, "G00",*z flag2 = 0 pg32e # End G32 threading pg76 # G76 threading (complex) xentry = 2 * (thdx1 + abs(thdx1 - thdx2)) zentry = thdz1 + .4 #extra clearance p2 = 10 * thdpulloff/thdlead p3 = thda1 * rad2deg #radians to degrees lead76 = thdlead depth76 = abs(thdx1 - thdx2) n, xentry, zentry n, "G76", *nspring, *p2, *p3, thdlast, thdfinish n, "G76", rootdia, thdz2, *depth76, *thdfirst, *lead76 pcomment # Manual Entry - COMMENTS (on a block by itself) 1005,1006 # "comment string" is passed to .PST in 'scomm' scomm # NUMBERED QUESTIONS FOR MASTERCAM 38. Rapid feedrate? 100.0 42. Arc center A= ABS B=INC C=ST-cen D=Unsigned-inc E= RADIUS ? E 70. Chaining tolerance? 0.0002 80. Communcations port number for receive and transmit (1 or 2) ? 1 81. Baud rate (110, 150, 300, 600, 1200, 2400, 4800, 9600)? 1200 82. Parity (E/O/N)? E 83. Data bits (7 or 8)? 7 85. Strip line feeds? N 86. Delay after end of line (seconds)? 0.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 programs? 91. Name of executable post processor? MPL 92. Name of reverse post processor? UNIVREV 93. Drive and subdirectory for tools and Material file? 97. Number of places after decimal for analyze (2-6)? 5 98. Number of places after decimal for NCI files (3-7)? 7 102. Display positive x Below or Above z axis (A/B)? a # Misc. Reals 201 = mr1 etc. 201. Default Dwell(mr1)? 0.1 202. Default Miscellaneous real (mr2)? 0.0 210. Default Miscellaneous real (mr10)? 0.0 # Misc. Intergers 301 = mi1 etc. 301. Default Gear Range (0 = M41, 2 = M42)? 1 302. Override number of thread passes? 0 310. Default Misc. integers (mi10)? 0