Mpbasic
Mpbasic
# Control Model: Basic # Machine Model: GENERIC # PST File Name: MPBASIC.PST # Executable : MP.EXE 2.10 # --------------#| FEATURES: | # -----------------------------------------------------------------------# This post has extended work offsets and is a standard FANUC Post. # --------------#| REVISION LOG | # -----------------------------------------------------------------------# 12/03/98 msf 1. Updated spindle, cutter compensation and coolant to new form at. # 2. Updated drilling to take advantage of V7 inc. format. # # 03/30/93 msf 1. Tested with PSTTST.NCI # 2. Initial release # # -------------------------------------------------------------------------# Format Statements - i=incr, n=nonmodal, l=leave ldg, t=leave trlg, d=delta # -------------------------------------------------------------------------fs 1 0.4 fs 2 1.4d fs 3 4 0 fs 4 2 0n fs 5 3.1 fs 6 5 0n fs 7 4 0 fs 8 1.4t # -------------------------------------------------------------------------# Format Assignments # fmt X 1 x - x, y, z, i, j, k, xh, yh, zh, xr, yr, zr # are init. fs 1, with 'normal' prefix letter # -------------------------------------------------------------------------fmt B 1 a # Rotary axis - substituted for Y fmt B 2 baxis # B Axis Output fmt B 2 c # Tool Plane Output fmt M 3 cc # Cutter Comp. fmt 3 ccomp # Modal format for ccomp fmt C 4 coolant # Coolant Format fmt 6 day # Initialized Day fmt 4 dirchg # Initialize fmt Z 1 depth # Depth (canned cycles) fmt 6 drillcyc # Make string 'sgdrlcyc' non-modal fmt Q 1 dwell # Dwell fmt P 6 extofst # Extra Offset for G54 fmt T 6 first_tool # Format for 1st tool fmt F 5 fr # Feedrate fmt F 5 frplunge # Plunge rate (canned cycles) fmt 3 gcode # Format linear G-code selector for modality only fmt I 2 i # Arc centers, format with a delta for incremental fmt Z 1 initht # Initial height fmt J 2 j # Arc centers, format with a delta for incremental fmt K 2 k # Arc centers, format with a delta for incremental fmt 6 month # Initialized Month fmt N 6 n # Line number fmt N 6 nast # N represented as tool number fmt T 4 next_tool # Next tool call
fmt Q 1 peck1 # First peck increment fmt Q 1 peck2 # First peck increment fmt 5 plane # Modal plane code selector fmt O 6 progno # Program Number fmt R 1 refht # Reference height fmt S 3 ss # Spindle Speed fmt M 4 sscode # Spindle Speed Code (M59 - M77 from tbl 1) fmt M 4 ssrange # Spindle Speed Range (mi2 - M42 = hi, M43 = low) fmt T 4 t # Tool number fmt 8 tcr # Tool Radius fmt 8 tldia # Tool Diameter fmt L 1 tlgth # Tool length fmt H 4 tlngno # Tool length offset number fmt D 4 tloffno # Tool diameter offset number fmt 6 year1 # Initialized Year - 1900 fmt G 6 workofs # Make Work Coord. string 'sgwcs' non-modal # -------------------------------------------------------------------------# Formulas - Use ':' instead of '=' to initialize variables # -------------------------------------------------------------------------arctype : 2 # Arc center 1=abs, 2=inc, 3=st-cen, 4=unsigned inc. do_full_arc : 0 #Allow full circle output? 0=no, 1=yes helix_arc : 0 #Support helix arc output, 0=no, 1=all planes, 2=XY plane on ly baxis = a # B Axis format bldnxtool : yes # Tool table on breakarcs : 0 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max a rcs drlgsel : -1 # Drill select initialize frrapid : 708 # Rapid feedrate? 300.0 frmax : 196 # Maximum feedrate? 300.0 g : -1 # G code initialize gcode : 0 initht : 999.999 i : 0 # Initialize I for pcir j : 0 # Initialize J for pcir k : 0 # Initialize K for pcir ldrcode : 65 # Leader character dec. equiv. nast = t # Line number = tool ncldr : 20 # No. of leader characters omitseq : yes # Omit sequence no.? plane : 0 # Initialize plane code to suppress first G17 rotaxtyp : 0 # Initialize axis rotation seqmax : 9999 # Max. sequence no. spaces : 1 # Spaces in .nc file spdir1 = spdir + 1 # format spdir to positive number sscode = frange(1,ss) # Spindle speed code ssmax : 4500 # Maximum spindle speed? 3000 ssrange = mi2 # Spindle range tooltable : yes # Build next tool table wcs = mi1 # Work coord. system whatno : yes # Ignore whatline branches to plin1 etc.? # V9 updates strtool_v7 : 2 #Use Version 7 toolname, 1= path components, 2=string get_1004 : 1 #Find gcode 1004 with getnextop? rpd_typ_v7 : 1 #Use Version 7 style contour flags? # -------------------------------------------------------------------------# USE CANNED CYCLES? # -------------------------------------------------------------------------usecandrill : yes
usecanpeck : yes usecanchip : yes usecantap : yes usecanbore1 : yes usecanbore2 : yes usecanmisc1 : no usecanmisc2 : no # -------------------------------------------------------------------------# DEBUG - Switches for debugging purposes # -------------------------------------------------------------------------bug1 : 2 # 0=No display, 1=Generic list box, 2=Editor bug2 : 40 # Add postline label to each line at column 'bug2' bug3 : 50 # Add whatline to each line? yes/no bug4 : 0 # Add -.nci line no. to each line? yes/no # -------------------------------------------------------------------------# Strings - String labels must start with 's' - they are not pre-assigned # -------------------------------------------------------------------------# Linear and circular G codes sg00 sg01 sg02 sg03 sgcode G0 G1 G2 G3 # # # # # Linear movement at rapid feedrate G code Linear movement at feedrate G code Circular interpolation CW G code Circular interpolation CCW G code Target string for linear/circular motion G code
fstrsel sg00 gcode sgcode # Select motion G code string # -------------------------------------------------------------------------# Spindle codes sm04 M4 # Spindle reverse - no coolant "M04" sm05 M5 # Spindle off - no coolant "M05" sm03 M3 # Spindle forward - no coolant "M03" spindle # Target Spindle-on M-string # coolant - 0 = off, 1 = on fstrsel sm04 spdir1 spindle # -------------------------------------------------------------------------# Coolant M code selection sm09 M9 #Coolant Off sm08 M8 #Coolant Flood sm08_1 M8 #Coolant Mist sm08_2 M8 #Coolant Tool scoolant #Target for string fstrsel sm09 coolant scoolant # -------------------------------------------------------------------------# Plane codes sg17 sg19 sg18 sgplane G17 G19 G18 # # # # XY plane code XZ plane code YZ plane code Workplane G code
fstrsel sg17 plane sgplane # Select work plane G code # -------------------------------------------------------------------------# 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
# -------------------------------------------------------------------------# Drill cycle G codes # 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 sgdrill # 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 sgdrill # Drill cycle G string select # -------------------------------------------------------------------------# User-defined Postline labels starting with 'p' # End a line with ',' to continue on the next line # -------------------------------------------------------------------------pwcs # Work Offsets if workofs < 10, workofs = workofs + 54 if workofs = 10, workofs = 10 *workofs pxyz # Plane Change Force X, Y, Z if plane = 0, *x, *y if plane = 1, *y, *z if plane = 2, *x, *z # Plane Change Force I, J, K if plane = 0, *i, *j if plane = 1, *j, *k if plane = 2, *i, *k # Tool length compensation "G43", *zr, *tlngno, scoolant # Don't output neg. feedrate if fr > 0, fr
pijk
ptllncomp pfr
# -------------------------------------------------------------------------# Postline - Names are pre-assigned except for partial lines which are # called from pre-assigned lines (Ex. pt) # -------------------------------------------------------------------------pheader # File header "%" if progno = 0, progno = 1000 progno, "(", progname, ")" spaces = 0
"( PROGRAM DATE - ", mon, "," ,day, "," ,year, " )" spaces = 1 psof0 # Start of file for tool zero n, "G90 G80 G40", *sgplane, "G00" n, pwcs, *xr, *yr, *ss, spindle n, ptllncomp # Start of file for non-zero tool number n, "M06", t n, "G90 G80 G40", *sgplane, "G00" n, pwcs, *xr, *yr, *ss, spindle n, ptllncomp # Null tool change if workofs <> prv_workofs, n, pwcs, *x, *y # Tool change n, scoolant n, "G91 G28 Z0" n, "G90", t, "M06" n, sgplane, pwcs, *xr, *yr, *ss, spindle n, ptllncomp # End of file for tool zero n, scoolant peof # End of file for non-zero tool n, scoolant n, "G91 G28 Y0 Z0" if first_tool <> t, n, first_tool, "M6" n, "G90" n, "M30" "%" # Linear line movement - at rapid feedrate n, sgplane, sgcode, x, y, z, !fr # Linear movement in Z axis only - at rapid feedrate n, sgplane, sccomp, sgcode, z, !fr # Linear line movement - at feedrate n, sccomp, sgcode, x, y, z, pfr # Linear movement in Z axis only - at feedrate n, ptllncomp, sgcode, z, pfr # Circular interpolation n, sgplane, *sgcode, pxyz, pijk, pfr # Canned Drill Cycle if initht <> prv_z, n, initht n, *sgdrill, *x, *y, *depth, *refht, dwell, *frplunge # Canned Peck Drill Cycle if initht <> prv_z, n, initht n, *sgdrill, *x, *y, *depth, *refht, dwell, *peck1, *frplunge
psof
ptlchg0
ptlchg
peof0
peof
ppeck
pchpbrk
# Canned Chip Break Cycle if initht <> prv_z, n, initht n, *sgdrill, *x, *y, *depth, *refht, dwell, *peck1, *frplunge # Canned Tap Cycle if initht <> prv_z, n, initht n, *sgdrill, *x, *y, *depth, *refht, dwell, *frplunge # Canned Bore #1 Cycle pdrill # Canned Bore #2 Cycle pdrill # Canned Misc #1 Cycle # Canned Misc #2 Cycle # Canned Drill Cycle if initht > refht, n, "G80 G0", *initht if initht > refht, n, *sgdrill, *x, *y, *depth, *refht, dwell, *fr if initht <= refht, n, sgdrill, x, y, depth, refht, dwell, frplung
ptap
# Canned Peck Drill Cycle if initht > refht, n, "G80 G0" *initht if initht > refht, n, *sgdrill, *x, *y, *depth, *refht, dwell, *pe ck2, *frplunge if initht <= refht, n, sgdrill, x, y, depth, refht, dwell, peck2, frplunge pchpbrk_2 ptap_2 pbore1_2 pbore2_2 pmisc1_2 pmisc2_2 pcanceldc # Canned Chip Break Cycle ppeck_2 # Canned Tap Cycle pdrill_2 # Canned Bore #1 Cycle ppeck_2 # Canned Bore #2 Cycle ppeck_2 # Canned Misc #1 Cycle ppeck_2 # Canned Misc #2 Cycle ppeck_2 # Cancel canned drill cycle if initht = 999.999, initht = refht n, "G80", *initht # Tool table line format # Axis Rotation Format n, "Z10.", scoolant, e n, c, "( TABLE ROTATION )", e
ptooltbl prot1
n, sgplane, pwcs, *xr, *yr, *ss, spindle, e n, ptllncomp, scoolant, e prot0 prot pcomment # Single-axis rotation prot # Single-axis rotation if c <> prv_c, prot1 # Manual Entry scomm
# -------------------------------------------------------------------------# Numbered questions for Mastercam # -------------------------------------------------------------------------80. Communcations port number for receive and transmit (1 or 2) ? 1 81. Baud rate (110, 150, 300, 600, 1200, 2400, 4800, 9600)? 9600 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.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 Material file? # -------------------------------------------------------------------------# Switches to Enable OR Disable toolpath parameter screen buttons # -------------------------------------------------------------------------161. Enable Home Position button? y 162. Enable Reference Point button? y 163. Enable Misc. Values button? y 164. Enable Rotary Axis button? y 165. Enable Tool Plane button? y 166. Enable Construction Plane button? y 167. Enable Tool Display button? y 168. Check tplane during automatic work origin creation? y 201. Miscellaneous real variable 1 (mr1)? 0.0 # -------------------------------------------------------------------------# Default Miscellaneous Real Values (METRIC) # -------------------------------------------------------------------------1601. Default miscellaneous real variable 1 (mr1) (metric)? 0.0 1602. Default miscellaneous real variable 2 (mr2) (metric)? 0.0 1603. Default miscellaneous real variable 3 (mr3) (metric)? 0.0 1604. Default miscellaneous real variable 4 (mr4) (metric)? 0.0 1605. Default miscellaneous real variable 5 (mr5) (metric)? 0.0 1606. Default miscellaneous real variable 6 (mr6) (metric)? 0.0 1607. Default miscellaneous real variable 7 (mr7) (metric)? 0.0 1608. Default miscellaneous real variable 8 (mr8) (metric)? 0.0 1609. Default miscellaneous real variable 9 (mr9) (metric)? 0.0 1610. Default miscellaneous real variable 10 (mr10) (metric)? 0.0 # -------------------------------------------------------------------------# Enable/Disable Miscellaneous Real Variable switches # -------------------------------------------------------------------------1611. Enable miscellaneous real variable 1? y 1612. Enable miscellaneous real variable 2? y
3? y 4? y 5? y 6? y 7? y 8? y 9? y 10? y
301. Default Work Coordinate System (0=G54, 1=G55 to 5=G59)? 0 # -------------------------------------------------------------------------# Enable/Disable Miscellaneous Integer Variable switches # -------------------------------------------------------------------------1621. Enable miscellaneous integer variable 1? y 1622. Enable miscellaneous integer variable 2? y 1623. Enable miscellaneous integer variable 3? y 1624. Enable miscellaneous integer variable 4? y 1625. Enable miscellaneous integer variable 5? y 1626. Enable miscellaneous integer variable 6? y 1627. Enable miscellaneous integer variable 7? y 1628. Enable miscellaneous integer variable 8? y 1629. Enable miscellaneous integer variable 9? y 1630. Enable miscellaneous integer variable 10? y # -------------------------------------------------------------------------# Configuration File association parameters (default is 'y') # -------------------------------------------------------------------------1630. Enable miscellaneous integer variable 10? y 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 413. Read CAD section? y 414. Read START/EXIT section? y 415. Read SCREEN section? y 416. Read FILE NAMES section? y 1500. Chook to execute from 'Misc. values' button? 1501. Insert parameter information in the ascii NCI? n 1502. Write operation information to binary file (.ops)? n 1520. Display a warning when cutter compensation in control simulation finds an error? n # Do NOT manually change the answer for Q.1999 ! 1999. Product major version number that post supports? 9 3001. Machine acceleration? 2 3002. timing size? .1