mastercam9.的刀具清单功能

合集下载

Mastercam9.0 基本操作技巧

Mastercam9.0 基本操作技巧

第1章M a s t e r c a m基本操作本章重点介绍基础知识和最常用的操作命令。

通过本章的学习,用户可以了解Mastercam软件的功能特点以及最常用的操作。

Mastercam简介Mastercam X2工作界面快捷键文件管理系统规划饭盒模具设计实例饭盒模具型腔数控加工实例本章要点本章案例1.1 Mastercam简介Mastercam软件是美国CNC_Software有限公司开发的产品。

在国内外CAD/CAM领域,Mastercam是微机平台上装机量最多、应用最广泛的软件,成为CAD/CAM系统的行业标准。

Mastercam软件是最经济有效的CAD/CAM软件系统,包括美国在内的各工业大国皆一致采用本系统,作为设计、加工制造的标准。

Mastercam为全球PC级CAM,全球销售量第一名,是工业界及学校广泛采用的CAD/CAM系统。

Mastercam具有强大、稳定、快速的功能,使用户不论是在设计制图上,或是CNC铣床、车床和线切割等加工上,都能获得最佳的成果,而且Mastercam是一套兼容于PC平台下,配合Microsoft Windows操作系统,且支持中文操作,让用户在软件操作上更能无往不利。

Mastercam是一套全方位服务于制造业的软件,包括铣削、车削、实体、木雕、浮雕、线切割六大模块。

铣削功能模块用于生成铣削加工刀具路径,车削功能模块用于生成车削加工刀具路径,实体功能模块用于创建二维及三维工程图形,木雕功能模块用于木雕刀具路径,浮雕功能模块用于创建浮雕刀具路径,线切割功能模块用于创建电火花切割刀具路径。

本节重点介绍铣削模块以及结合实体模块设计模具两方面知识。

1.1.1 实体模块简介实体模块的主要功能及特点如下:●具有完整的曲线曲面建模功能,建立2D、3D几何模型十分方便。

●灵活、完整的曲线曲面编辑和分析功能,保证几何模型的精度。

●修改几何模型后,相关的尺寸标注自动更新。

●可在多个窗口内动态旋转、缩放几何图形。

车床加工Mastercam9.1数控车床加工教程(非常详细).

车床加工Mastercam9.1数控车床加工教程(非常详细).
Mastercam 16
2003.07.20
外径车削刀具的刀柄设置
内孔车削刀具的刀柄设置
2003.07.20
Mastercam
17
4. 切削刀具参数





各种车刀参数的设置都是一样的,可以通过 “参数”选项卡来进行刀具参数的设置。 参数选项卡的设置,主要包括以下参数: 程式参数:刀具号码、刀塔号码、刀具补正 号码和刀具背面补正号码参数。 预设的切削参数:进给率、主轴转速度、切 削速度等参数。 刀具路径参数:切削深度、重叠量及退刀量 等参数。 冷却液:选择加工中冷却的方式。 补正:设置刀具刀尖位置类型。

在采用不同的加工模组生成刀具路径时, 除了设置各模组的一组特有参数外,还需要设 置一组共同的刀具参数。车床加工模组的“刀 具参数”选项卡。
Mastercam 6
2003.07.20
“车床刀具管理”对话框及快 捷菜
2003.07.20 Mastercam 7
“简式刀具参数”选项
2003.07.20

10.1.1 车床坐标系 10.1.2 刀具参数 10.1.3 工件设置
Mastercam 2
2003.07.20
10.1.1 车床坐标系

一般数控车床使用X轴和Z轴两轴控制。其中Z 轴平行于机床主轴,+Z方向为刀具远离刀柄方向; X轴垂直于车床的主轴,+X方向为刀具离开主轴线 方向。当刀座位于操作人员的对面时,远离机床和 操作者方向为+X方向;当刀座位于操作人员的同 侧时,远离机床靠近操作者方向为+X方向。有些 车床有主轴角位移控制(C-axis),即主轴的旋转 转角度可以精确控制。
2003.07.20
2.刀片参数

MasterCAM9.1的刀具清单功能

MasterCAM9.1的刀具清单功能

MasterCAM9.1的刀具清单功能MasterCAM9.1后处理自动生成刀具清单,使用方法:将下面的容复制到记事本,并将其更名为Mpfan.pst,pst为后缀,再将该文件拷贝至MasterCAM9.1的安装目录C:\Mcam9\Mill\Posts,覆盖原文件,然后启动软件,可以在NC程序开头生成刀具清单。

经典版本,绝对好用!# Post Name : MPFAN# Product : MILL# Machine Name : FANUC# Control Name : 6M# Description : GENERIC FANUC 6M STYLE POST# Associated Post :# Mill/Turn : NO# 4-axis/Axis subs. : NO# 5-axis : NO# Executable : MP 4.03##******************************************************************* *****# *----------------------------------------------------------------------*# * POST PROCESSOR INTENDED FOR VERSION 6 BETA TESTING * # * *# * D O N O T D I S T R I B U T E ! ! ! *# *----------------------------------------------------------------------*#******************************************************************* *****## ---------------#| REVISION LOG |# ------------------------------------------------------------------------# Programmers Note:# CNC 8/15/2005 - grt - Updated for Mill Version 6## ---------------#| FEATURES: |# ------------------------------------------------------------------------# Users Note:## Following Misc_Reals & Misc_Integers are used:## mi1 - Work coordinate system# 0 = Reference return is generated and G92 with the# X, Y and Z home positions at file head.# 1 thru 3 = Reference return is generated and G92 with the # X, Y and Z home positions at each tool.# 4 thru 9 = The WCS of G54 thru G59 respectively at each tool.## Options / Usage:# It is recommended to start and end cutter compensation on a linear move.# Rotary axis assumes a "Z" plunge at feed into part, positionof the# substituted axis at absolute zero position and the retraction from path# by the post call to the G28 machine Z home position.# -------------------------------------------------------------------------- # DEBUG/PROGRAM SWITCHES, debugging and program switches# -------------------------------------------------------------------------- bug1 : 1 # 1 = Output post to screen, 2 = output leader to screenbug2 : 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?strtool_v7 : 2 #Use Version 7 toolname, 1= path components, 2=stringget_1004 : 1 #Find gcode 1004 with getnextop?rpd_typ_v7 : 1 #Use Version 7 style contour flags?arcoutput : 2 # 0 = IJK, 1 = R no sign, 2 = R signed neg. over 180breakarcs : 0 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcsstagetool : 0 # 0 = Do not pre-stage tools, 1 = Stage tools use_gear : no # Set to yes to output gear range codes# -------------------------------------------------------------------------- # FORMAT STATEMENTS - n=nonmodal, l=leading, t=trailing, i=inc, d=delta# -------------------------------------------------------------------------- fs 1 0.3 #Decimal, absolute, 4 placefs 2 0.4d #Decimal, deltafs 3 1 0 #Integer, not leadingfs 4 2 0l #Integer, two leadingfs 5 3 0l #Integer, three leadingfs 6 4 0l #Integer, four leadingfs 7 0.1 #Decimal, absolute, 1 placefs 8 0.2 #Decimal, absolute, 2 placefs 9 0.3 #Decimal, absolute, 3 placefs 10 0 4t #No decimal, absolute, four trailingfs 11 0.4t #Decimal, absolute, four trailing# -------------------------------------------------------------------------- # FORMAT ASSIGNMENTS# -------------------------------------------------------------------------- # Axis output formats - Linear# -------------------------------------------------------------------------- fmt X 1 x # X axis positionfmt Y 1 y # Y axis positionfmt Z 1 z # Z axis positionfmt X 1 xr # X rapid position from tool changefmt Y 1 yr # Y rapid position from tool changefmt Z 1 zr # Z rapid position from tool changefmt X 1 xh # X home positionfmt Y 1 yh # Y home positionfmt Z 1 zh # Z home position# -------------------------------------------------------------------------- # Axis output formats - Circular# -------------------------------------------------------------------------- fmt I 2 i # Arc center description in Xfmt J 2 j # Arc center description in Yfmt K 2 k # Arc center description in Zfmt R 1 arcrad # Arc Radiusfmt R- 1 arcradm # Arc Radius over 180 degree sweep# -------------------------------------------------------------------------- # Axis output formats - Rotary substitution # -------------------------------------------------------------------------- fmt A 9 xs # Linear to rotary calculation of X fmt B 9 ys # Linear to rotary calculation of Y# -------------------------------------------------------------------------- # Program & Sequence number format# -------------------------------------------------------------------------- fmt O 6 progno # Program numberfmt N 3 n # Sequence nos.# -------------------------------------------------------------------------- # Tool format# -------------------------------------------------------------------------- fmt T 3 t # Tool Nofmt T 3 first_tool# First Tool Used (bldnxtool: yes)fmt T 3 next_tool # Next Tool Used (bldnxtool: yes)fmt D 3 tloffno # Diameter Offset Nofmt H 3 tlngno # Length Offset Nofmt "T" 1 tnote # Note formatfmt "D-" 1 toffnote # Note formatfmt "H-" 1 tlngnote # Note formatfmt "Dia-" 2 tldia # Note format# -------------------------------------------------------------------------- # Spindle Speeds & Feedrate output formats # -------------------------------------------------------------------------- fmt S 6 speed # Spindle Speedfmt F 8 fr # Feedratefmt F 7 frdeg # Feedrate for rotaryfmt M 3 gear # Gear range# -------------------------------------------------------------------------- # Drill variable formats# -------------------------------------------------------------------------- fmt G 3 drillref # Initial / Reference Toggle (G98/G99) fmt P 10 dwell # Dwellfmt Z 1 initht # Initial Heightfmt R 1 refht # Reference Heightfmt Z 1 depth # Depthfmt Q 2 peck1 # First peck increment (positive)fmt 1 peck2 # Second or last peck (positive)fmt 1 peckclr # Safety distancefmt 1 retr # Retract heightfmt F 8 frplunge # Plunge feedrate in drill cycles# -------------------------------------------------------------------------- # Miscellaneous output formats# -------------------------------------------------------------------------- fmt M 5 ssrange # Spindle Speed Rangefmt C 4 coolant # Coolant# -------------------------------------------------------------------------- # INITIALIZE - initialize system variables and define user variables# -------------------------------------------------------------------------- qtoolpln : no # MP386 - Enable tool plane option qtoolopt : no # MP386 - Enable tool optimizationarctype : 2 # Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.do_full_arc : 0 #Allow full circle output? 0=no, 1=yeshelix_arc : 0 #Support helix arc output, 0=no, 1=all planes, 2=XY plane only bldnxtool : yes # Build next tool tableldrcode : 65 # 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 movesomitcrlf : no # Omit CR/LFomitrefht : no # Don't use reference height on first non-canned Z moveomitseq : yes # Omit sequence no.omitz : no # Omit first Z movement for non-canned-cycles progname : 1 # Use uppercase for program namescalex : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kscaley : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kscalez : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kseqmax : 9999 # Max. sequence no.skipmotest: no # Skip motion test in linearspaces : 1 # No. of spaces to add between fieldstooltable : 1 # Read for tool table and pwrttabsswp : 0 # Absolute sweepdrlgsel : -1 # Drill Select Initializemaxfrdeg : 9999 # Limit for feed in deg/minabsinc : 0 # Absolute/Incremental toggle for modalitytcnt : 0 # Count the number of tool changesadelta : 0 # Calculation for deg/minldelta : 0 # Calculation for deg/minzdelta : 0 # Calculation for deg/minalzdelta : 0 # Calculation for deg/minfrdelta : 0 # Calculation for deg/minfrdegcalc : 0 # Calculation for deg/mincircum : 0 # Calculation for deg/minrotstrt : 1 # Flag for first rotary positionnewglobal : 1 # Error Check (Leave this variable set to 1)# -------------------------------------------------------------------------- # FORMULAS - global formulas# -------------------------------------------------------------------------- ssrange = mi3 # Gear Range Selectspeed = abs ( ss ) # Absolute spindle speedarcradm = arcrad # Negative arcradspdlsel = fsg3(ss) # Spindle on selector based on pos. or neg. ss# -------------------------------------------------------------------------- # CANNED CYCLES - select long or short code # -------------------------------------------------------------------------- usecandrill : yes # Use canned cycle for drill usecanpeck : yes # Use canned cycle for Peckusecanchip : yes # Use canned cycle for Chip Breakusecantap : yes # Use canned cycle for Tapusecanbore1 : yes # Use canned cycle for Bore1usecanbore2 : yes # Use canned cycle for Bore2usecanmisc1 : yes # Use canned cycle for Misc1usecanmisc2 : yes # Use canned cycle for Misc2# -------------------------------------------------------------------------- # Lookup table definitions - for math functions FLOOK and FRANGE# -------------------------------------------------------------------------- flktbl 1 3 # Lookup table definitions - table no. - no. entries40 1000 # Low gear range41 2500 # Med gear range42 5000 # Hi gear range# -------------------------------------------------------------------------- # Strings - String labels must start with 's' - they are not pre-assigned# -------------------------------------------------------------------------- #Select operation notesop00 NULL # String definitionsop01 END-MIll # " "sop02 END-MIll # " "sop03 DRIll # " "sop04 END-MIll # " "sop05 S-MILL # " "sop06 2D-SWEPT.. # " "sop07 3D-SWEPT.. # " "sop08 REVOLVED.. # " "sop09 LOFT...... # " "sop10 COONS..... # " "sop11 TRIM ..... # " "sop12 FILLET.... # " "sop13 ROUGH..... # " "sop14 OP14...... # " "sop15 OP15...... # " "sopnote # Target stringfstrsel sop00 opcode sopnote# -------------------------------------------------------------------------- # Select motion G codesg00 G0 # Linear movement at rapid feedratesg01 G1 # Linear movement at feedratesg02 G2 # Circular interpolation CWsg03 G3 # Circular interpolation CCWsgcode # Target stringfstrsel sg00 gcode sgcode# -------------------------------------------------------------------------- # Select incremental or absolute G codesg90 G90 # Absolute G codesg91 G91 # Incremental G codesgabsinc # Target stringfstrsel sg90 absinc sgabsinc# -------------------------------------------------------------------------- # Select spindle startsm04 M4 # Spindle reversesm05 M5 # Spindle offsm03 M3 # Spindle forwardspdlon # Target stringfstrsel sm04 spdlsel spdlon# -------------------------------------------------------------------------- # Cutter compensation codescc0 "" # Cutter compensation state not changedsg40 G40 # Cancel cutter compensationsg41 G41 # Cutter compensation leftsg42 G42 # Cutter compensation rightsg140 G40 # Last linear move cancel cutter comp (see note) # Note: to cancel comp after last move, remove G40 string # with sg140 and remove "#" at the postline call "pcancelcc"sccomp # Target stringfstrsel scc0 ccomp sccomp# -------------------------------------------------------------------------- # Select work plane G codesg17 G17 # XY plane codesg19 G19 # XZ plane codesg18 G18 # YZ plane codesgplane # Target stringfstrsel sg17 plane sgplane# -------------------------------------------------------------------------- # Work coordinate systemsg50 G92 # Work coordinate system G codesg51 G92 # " " " " "sg52 G92 # " " " " "sg53 G92 # " " " " "sg54 G54 # " " " " "sg55 G55 # " " " " "sg56 G56 # " " " " "sg57 G57 # " " " " "sg58 G58 # " " " " "sg59 G59 # " " " " "sgwcs # Target stringfstrsel sg50 mi1 sgwcs# -------------------------------------------------------------------------- # Canned drill cycle string selectsg81 G81 # drill - no dwellsg81d G82 # drill - with dwellsg83 G83 # peck drill - no dwellsg83d G83 # peck drill - with dwellsg73 G73 # chip break - no dwellsg73d G73 # chip break - with dwellsg84 G84 # tap - no dwellsg84d G74 # tap - with dwell (selects left hand)sg85 G85 # bore #1 - no dwellsg85d G89 # bore #1 - with dwellsg86 G86 # bore #2 - no dwellsg86d G86 # bore #2 - with dwellsgm1 G81 # misc #1 - no dwellsgm1d G82 # misc #1 - with dwellsgm2 G81 # misc #2 - no dwellsgm2d G82 # misc #2 - with dwellsgdrill # Target stringdrlgsel = drillcyc * 2 + fsg2 ( dwell ) # 16 possible combinations:# drillcyc = 0..7# dwell = 0 or non-zero (2 states) fstrsel sg81 drlgsel sgdrill # -------------------------------------------------------------------------- # Generate 'sgear' stringsgear0 M** # auto gear rangesgear1 M41 # Low gear rangesgear2 M42 # Med gear rangesgear3 M43 # High gear range - selected in parameters by mi3sgearfstrsel sgear0 gear sgear# -------------------------------------------------------------------------- # POSTLINES, USER-DEFINED - Postline labels start with 'p'.# End a line with ',' to continue on the next line.# End a line with ', e' to generate carriage return and linefeed.# -------------------------------------------------------------------------- # Program general output control, user defined # -------------------------------------------------------------------------- pinit # Initialize Varsprv_fr = 999.999prv_frdeg = 999.999prv_frplunge = 999.999linarc = 0rotstrt = 1pabs # Absolute G code outputabsinc = 0sgabsincpinc # Incremental G code outputabsinc = 1sgabsincpcooloff # Coolant off "M" code outputif prv_coolant > 0, "M09"pcoolon # Coolant off "M" code outputif coolant = 1, "M08" # Floodif coolant = 2, "M07" # Mistpcoolnl # Coolant off "M" code outputif coolant = 0, "M09" # Offif coolant = 1, "M08" # Floodif coolant = 2, "M07" # Mistpfr # Feedrate W/O Negative Feedratesif fr > 0, frpcan # Canned text - cantext = 0, 1, 2, 3if cantext = 1, "M01" #optional stopif cantext = 2, " " #user optionif cantext = 3, " " #user option# -------------------------------------------------------------------------- # Work coordinate output, user defined# -------------------------------------------------------------------------- pg92_sof # G92 coordinate setting at start "/", n, pinc, "G28", "Z0.", e"/", n, "G28", "X0.", "Y0.", e"/", n, *sgwcs, *xh, *yh, *zh, epg92_out # G92 coordinate setting at tool change"/", n, "G28", "X0.", "Y0.", eif gcode <> 1003, "/", n, *sgwcs, *xh, *yh, *zh, epwcs # G54+ coordinate settingif mi1 >= 4, *sgwcs# -------------------------------------------------------------------------- # Gear selection control, user defined# -------------------------------------------------------------------------- pgear # Find spindle rangegear = frange ( 1, speed )*gearprange # Find spindle rangeif use_gear = 1, pgear# -------------------------------------------------------------------------- # Cutter comp. output control, user defined # -------------------------------------------------------------------------- pccdia2 # Cutter Compensation2if ccomp <> 4, tloffnopccdia # Cutter Compensationif ccomp <> 0, pccdia2# -------------------------------------------------------------------------- # Axis substitution motion, user defined# -------------------------------------------------------------------------- pdrlxyrot # Substitute Axis X/Y with Rotary axis w/ drillingif rotaxis = 0, x, yif rotaxis = 1, y, xsif rotaxis = 2, x, yspfrd # Feedrate W/O Negative Feedrates (deg/min)if frdeg > maxfrdeg, frdeg = maxfrdegif frdelta > .5, *frdeg #Value to exceed to output frdegprotaxis1a # Substitute Axis X/Y with Rotary axisif rotstrt = 0, n, sgcode, y, z, *xs, pfrd, pcan, eif rotstrt = 1, n, xs, eif rotstrt = 1, n, sgcode, y, z, pfrd, pcan, eprotaxis1 # Substitute Axis X/Y with Rotary axisif gcode = 0, n, sgcode, y, z, *xs, pcan, eif gcode = 1, protaxis1aprotaxis2a # Substitute Axis X/Y with Rotary axisif rotstrt = 0, n, sgcode, x, z, *ys, pfrd, pcan, eif rotstrt = 1, n, ys, eif rotstrt = 1, n, sgcode, x, z, pfrd, pcan, eprotaxis2 # Substitute Axis X/Y with Rotary axisif gcode = 0, n, sgcode, x, z, *ys, pcan, eif gcode = 1, protaxis2aprotaxis # Substitute Axis X/Y with Rotary axisif rotstrt = 1, !frif fr < 0, fr = prv_fr!frif rotaxis = 1, ldelta = abs ( y - prv_y )if rotaxis = 2, ldelta = abs ( x - prv_x )zdelta = abs ( z - prv_z )if rotaxis = 1, adelta = ( ( abs ( xs - prv_xs ) ) / 360 ) * circum if rotaxis = 2, adelta = ( ( abs ( ys - prv_ys ) ) / 360 ) * circum alzdelta = sqrt ( adelta^2 + ldelta^2 + zdelta^2 ) frdegcalc = fr * ( 360 / circum )if alzdelta <> 0, frdeg = ( adelta / alzdelta ) * frdegcalcif adelta = 0, frdeg = frfrdelta = abs ( frdeg - prv_frdeg )if rotaxis = 1, protaxis1if rotaxis = 2, protaxis2if gcode = 1, rotstrt = 0!x, !y, !zprotary # Rotary Moveif rotaxis = 1, xr = 0 #Force X to zeroif rotaxis = 2, yr = 0 #Force Y to zeroif rotaxis > 0, linarc = 1circum = rotdia * pi# -------------------------------------------------------------------------- # Axis linear/circular motion, user defined# -------------------------------------------------------------------------- parctyp2 # Arc output for R w/ sign over 180 degree sweepabsswp = abs ( sweep )!absswpif absswp <= 180, *arcradif absswp > 180, *arcradmparctyp1 # Arc output for R w/ no sign*arcradparctyp0 # Arc output for IJKif plane = 0, *i, *j, kif plane = 1, i, *j, *kif plane = 2, *i, j, *kparctyp # Select the arc outputif arcoutput = 0, parctyp0if arcoutput = 1, parctyp1if arcoutput = 2, parctyp2prapidm # Linear line movement - at rapid feedraten, sgplane, sccomp, pccdia, sgcode, x, y, z, pcanplinm # Linear line movement - at feedraten, sccomp, pccdia, sgcode, x, y, z, pfr, pcanpcirm # Circular interpolationn, sgplane, sccomp, pccdia, sgcode, x, y, z, parctyp, pfr, pcan # -------------------------------------------------------------------------- # Drilling, user defined# --------------------------------------------------------------------------pdrillref # Determine G98 or G99if initht <> refht, drillref = 98if initht = refht, drillref = 99pdwell # Determine whether to output dwellif dwell <> 0, *dwellptlchg0dr2 # Null tool change for drillinggcode = 0if zr < prv_zr, n, sgcode, *xr, *yr, en, sgcode, *zr, eptlchg0drl # Null tool change for drillingif prv_opcode = 3 & zr <> prv_zr, ptlchg0dr2# -------------------------------------------------------------------------- # POSTLINES, PRE-DEFINED - Postline names are pre-assigned.# Lines do not need to end with ', e' for carriage return and linefeed.# -------------------------------------------------------------------------- pcomment # Manual Entry - COMMENTS (on a block by itself) 1005,1006"(", scomm, ")"pheader # File header"%""(", progname,".NC)""(20",year,"-",month,"-",day,",", time, ")"psof0 # Start of file for tool zeropsofpsof # Start of file for non-zero tool number pinit!opcode, !coolantif tcnt = 1, stagetool = 2prognocommentn, "G40 G49 G80 G17 G21"n, "GO G91 G28 Z0."# if stagetool = 0, n, *t, "M6"protaryn, *t, "M6"if stagetool = 0, n, *next_tooln, *sg00,*sg90,*sg54,pabs, *xr, *yrn, *speed, *spdlon, prangen, "G43", tlngno, *zr, pcoolonptlchg0 # Null tool changeif opcode = 3, ptlchg0drlif prv_speed <> speed, n, speedif coolant <> prv_coolant, n, pcoolnl!opcode, !coolantptlchg # Tool changepinit!opcoden, pcooloffn,*sm05n, pinc, "G28", "Z0."if stagetool = 0, n, *t, "M6"if stagetool = 0, n, *next_tooln, "M01"commentprotaryn, *sg00,pabs,*sg54, *xr, *yrn, *speed, *spdlon, prangen, "G43", tlngno, *zr, pcoolon!coolantpeof0 # End of file for tool zeropeofpeof # End of file for non-zero tooln, pcooloffn, *sm05# n, pinc, "G30", "Z0."n, "G91 G28 Z0."n, "G91 G28 Y0."if stagetool = 0, n, *first_tool, "M6""%"# -------------------------------------------------------------------------- # Axis motion# -------------------------------------------------------------------------- prot0 # T oolplane postline - Custom post required prot # Toolplane postline - Custom post requiredprapid # Linear line movement - at rapid feedrateif rotaxis <> 0, protaxiselse, prapidmpzrapid # Linear movement in Z axis only - at rapid feedrate n, sgcode, zplin1 # First linear movement after SOF, whatno must be set plin2 # Second linear movement after SOF, whatno must be setplin # Linear line movement - at feedrateif rotaxis <> 0, protaxiselse, plinmpz # Linear movement in Z axis only - at feedraten, sgcode, z, pfrpcir1 # First circular movement after SOF, whatno must be setpcir2 # Second circular movement after SOF, whatno must be setpcir # Circular interpolationif rotaxis <> 0, protaxiselse, pcirm# -------------------------------------------------------------------------- # Drilling# -------------------------------------------------------------------------- pdrill # Canned Drill Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplunge ppeck # Canned Peck Drill Cyclen, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungepchpbrk # Canned Chip Break Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungeptap # Canned Tap Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *frplungepbore1 # Canned Bore #1 Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplunge pbore2 # Canned Bore #2 Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *frplunge pmisc1 # Canned Misc #1 Cycle (User Option)pdrillpmisc2 # Canned Misc #2 Cycle (User Option)pdrillpdrill_2 # Canned Drill Cyclen, pdrlxyrot, refht, depthppeck_2 # Canned Peck Drill Cyclepdrill_2pchpbrk_2 # Canned Chip Break Cyclepdrill_2ptap_2 # Canned T ap Cyclepdrill_2pbore1_2 # Canned Bore #1 Cyclepdrill_2pbore2_2 # Canned Bore #2 Cyclepdrill_2pmisc1_2 # Canned Misc #1 Cyclepdrill_2pmisc2_2 # Canned Misc #2 Cyclepdrill_2pcanceldc # Cancel canned drill cycle!gcoden, "G80"prv_z = inithtpcancelcc # Cancel cutter comp.#n, "G40"pwrtt # Write tool table, scans entire file, null tools are negativetnote = ttoffnote = tloffnotlngnote = tlngnoif t >= 0, "(", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldia, " ",*sopnote, ")"if t >= 0, tcnt = tcnt + 1# -------------------------------------------------------------------------- # Numbered questions for Mastercam -- Used by Mill 5# -------------------------------------------------------------------------- 38. Rapid feedrate? 10000.76. Name of associated CFG file? T400. Name of associated CFG file? T1538. Rapid feedrate (metric)? 20000.080. Communications port number for receive and transmit (1 or 2) ? 281. Data rate (110,150,300,600,1200,2400,4800,9600,14400,19200,38400)? 960082. Parity (E/O/N)? E83. Data bits (7 or 8)? 784. Stop bits (1 or 2)? 285. Strip line feeds? N86. Delay after end of line (seconds)? 087. Ascii, Eia, or Binary (A/E/B)? A88. Echo keyboard to screen in terminal emulation? n89. Strip carriage returns? N90. Drive and subdirectory for NC files?91. Name of executable post processor? MP92. Name of reverse post processor? RP93. Reverse post PST file name? RPABS100. Number of places BEFORE the decimal point for sequence numbers? 3101. Number of places AFTER the decimal point for sequence numbers? 0103. Maximum spindle speed? 8000107. Average time for tool change (seconds)? 1#110. Default tool library? TOOLS-MM.TL9# -------------------------------------------------------------------------- # Switches to Enable OR Disable toolpath parameter screen buttons# -------------------------------------------------------------------------- 161. Enable Home Position button? Y162. Enable Reference Point button? y163. Enable Misc. Values button? y164. Enable Rotary Axis button? N165. Enable Tool Plane button? y166. Enable Construction Plane button? y167. Enable Tool Display button? y168. Check tplane during automatic work origin creation? y # -------------------------------------------------------------------------- # Default Miscellaneous Real Values# -------------------------------------------------------------------------- 201. Default miscellaneous real variable 1 (mr1)? 0.0 202. Default miscellaneous real variable 2 (mr2)? 0.0203. Default miscellaneous real variable 3 (mr3)? 0.0204. Default miscellaneous real variable 4 (mr4)? 0.0205. Default miscellaneous real variable 5 (mr5)? 0.0206. Default miscellaneous real variable 6 (mr6)? 0.0207. Default miscellaneous real variable 7 (mr7)? 0.0208. Default miscellaneous real variable 8 (mr8)? 0.0209. Default miscellaneous real variable 9 (mr9)? 0.0210. Default miscellaneous real variable 10 (mr10)? 0.0# -------------------------------------------------------------------------- # Default Miscellaneous Real Values (METRIC) # -------------------------------------------------------------------------- 1601. Default miscellaneous real variable 1 (mr1) (metric)? 0.01602. Default miscellaneous real variable 2 (mr2) (metric)?0.01603. Default miscellaneous real variable 3 (mr3) (metric)?0.01604. Default miscellaneous real variable 4 (mr4) (metric)?0.01605. Default miscellaneous real variable 5 (mr5) (metric)?0.01606. Default miscellaneous real variable 6 (mr6) (metric)?0.01607. Default miscellaneous real variable 7 (mr7) (metric)?0.01608. Default miscellaneous real variable 8 (mr8) (metric)?0.01609. Default miscellaneous real variable 9 (mr9) (metric)?0.01610. Default miscellaneous real variable 10 (mr10) (metric)?0.0# ----------------------------------------------------------------。

cimatron E9.0指南_快速游历之加工

cimatron E9.0指南_快速游历之加工

Cimatron E7.0 指南这指南包含三部分,本章只介绍第一部分中的NC描述:一.获得开始.这一部分将引导你通过基本的cimatron.快速漫游介绍跟随着一步步的基本指南快速漫游,引导你通过主要的cimatron应用.跟随步骤步骤1_绘制这个零件步骤2_装配组件步骤3_草图步骤4_模具设计步骤5_电极步骤6_NC.继续前进到下一步开始这指南零件描述在这一章里我们将创建一个鼠标盖第一步_创建一个新零件文件从这文件目录,选择新建文件NC描述在这一章里你将创建一个鼠标盖型芯的NC程序.第一步_输出这个模型到NC文件打开鼠标盖型芯文件从文件目录,选择输出/到NC在这个输入特征向导上单击确定从这个工具棒图标,打开向导模式选择第二步_创建切削刀具我们现在将为使用的加工程序创建切削刀具从这个NC 工具棒,单击创建刀具图标这刀具和夹头对话框出现单击这刀具库按钮输入ball-10并选择它,单击这”添加刀具到选定刀具列表”箭头当使用向导模式时,在这些图解显示中自由空间数量是最大的.当创造或者编辑一个程序时, 在这个NC 工具棒或在NC 向导上适当的单击图标能分别的打开每一个对话框和参数表.这NC 向导能通过这个视图/面板/向导/加工向导选项访问.NC 工具棒, 在这个加工过程中左边的显示上出现那一个,你跟着准备合理的步骤,从开始到结束重复相同的步骤选择flat 16刀具单击确定确认并退出刀具库单击确定退出刀具和夹头对话框第三步_创建一个新的刀具路径单击这个创建新刀路图标注意在这个显示区域安全平面的出现接受缺省参数并且单击确定2.5轴,3轴,4轴,5轴刀路都是可利用的第四步_创建毛胚单击创建毛胚图标创建毛胚是3轴程序使用的描述从完成零件制造的毛胚材料同意缺省值并单击确定第五步_创建一个体积铣程序我们使用单独的NC工艺去加工这个零件,我们将开始粗加工环行铣程序单击这个创建一个程序图标接受主要选项中的体积铣和变化下一选项到粗加工环行铣单击刀具和夹头图标(下一步)继续选择刀具FLAT 16单击确定第六步_选择零件我们现在将选择零件单击这零件图标单击这编程助手图标然后对话框底部显示图片在显示区域单击右键,,选择所有显示对象并退出第七步_导入首选值查看单击刀路参数图标在这个刀路对话框里,单击这个导入首选值&查看图标单击是接受在跟着出现的信息上Cimatron缺省的首选值和查看显示了单击页底部圆圈里的图标显示参数隐藏参数所有参数显示,相同的一个标志隐藏仅仅参数标志显示,隐藏参数不显示随着参数进入单击机床参数图标继续接受这默认值为机床参数单击保存并计算图标在这个加工过程管理器中,注意创建这个程序变化这个刀路颜色到兰色第八步_创建一个曲面铣程序我们现在将创建一个曲面铣程序创建一个新程序单击这创建程序图标曲面铣根据角度精铣选择BALL10刀具,单击下一步箭头继续第八步_a_创建一个曲面铣程序选择零件:系统自动选择前一个程序选择的实体单击这个边界(可选)按钮拾取底部控制平面由中间鼠标按钮接受几何体选择并按退出(中间鼠标按钮)继续下一步在这刀路参数对话框,单击导入首选值&查看图标,单击是接受首选值.在毛胚管理与夹头检查上单击,选择高级参数并参考剩余毛胚参数当参考剩余毛胚参数设置为是,在产生刀具动作之前计算这剩余毛胚单击保存并计算图标,执行这程序在下面圆圈中单击隐藏/显示图标,隐藏体积铣程序,隐藏这曲面铣程序刀路第九步_创建一个局部精细加工程序创建一个新程序,同下面定义这工艺并按刀具和夹头图标在这个刀具和夹头对话框,选择刀具BALL 10并单击新建刀具图标在这刀具特性中为这个新刀具选择进入随着参数单击确定并按零件图标接受这零件选项为这清根铣程序选择首选值并查看保存并计算这程序第十步_仿真这程序单击高级仿真图标单击双箭头包括所有的程序到模拟里在这对话框里,检查验证这仿真选项并单击确定这NC仿真应用打开单击这开始图标这最后的练习结果可以看到文件里的Mouse cover core _nc.elt。

Master cam9.0线割编程说明书

Master cam9.0线割编程说明书

第25章模具加工应用实例在本章中通过对它在精密模具中的编程实例应用来说明此软件的用法。

本章实例所用的机床为夏米尔290P慢走丝线切割机。

25.1 凹模镶块加工(部分斜度)本例中使用图25.1所示的凹模镶块加工图形在夏米尔290P机床上加工一个级进模的凹模镶块,此镶块上有5个型腔,零件高13mm,要求在此凹模镶块的刀口处加工2mm高的直壁部分,其余部分为0.75°的落料斜度。

根据加工要求确定斜度部分切割2次,直壁部分切割3次。

外形一面留磨0.3~0.5mm,其余面3次切割加工到尺寸。

型腔程序以C1型腔为例进行说明,型腔的进丝孔位置位于每个型腔的固定位置上,在C1型腔的坐标原点处,图形为凸模尺寸,间隙在加工时根据要求在CMD文件中进行调整。

图25.125.1.1 文件准备(1) 从系统桌面单击Wire程序快捷方式启动软件。

(2) 从主菜单中选择File→Get(“文件”→“获取”)命令,从配书光盘中调入EX25-1.MC9文件。

(3) 从主菜单中选择Modify→Break→2 pieces(“修整”→“打断”→“两段”)命令,选择图25.1中的L1直线,再单击坐标原点作为打断点,将L1直线分段,此分段点将作为串连的起点,同时也是切割路径的进刀位置。

(4) 从主菜单中选择NC utils→Post Proc→Change(“NC实用”→“后处理”→“改变”)命令,弹出Specify File Name to Read(读取特定的文件名称)对话框,在其中选择MPWROBO.PST后处理程序,如图25.2所示,单击“打开”按钮返回,再单击MAIN MENU (主菜单)命令返回主菜单。

图25.225.1.2 生成切割路径(1) 从主菜单中选择Wirepaths→Contour(“线切割路径”→“轮廓”)命令,进入切割路径的串连选择菜单中,从图25.1中单击L1直线的下半部分,串连方向按顺时针方向,完成图形串连,如图25.3所示。

mastercam9.0最全中英菜单互译

mastercam9.0最全中英菜单互译

辅助菜单说明图形视角说明Analyze 分析命令File 文件管理命令NeW 开启新档建立新图形:消除屏幕上的图形,使系统回到开机时的状态Edit 编辑文件编辑:系统提供一功能强大的全屏幕编辑器(Mcedit)可在不退出系统的状态下编辑各类ASCII文件(NC﹑NCI﹑DOC﹑IGS﹑PST ﹑AUTOEXEC﹑OTHER)Get 取档调用图形文件,将其显示在屏幕上Merge 合并档案图形合并:读入另一个图形文件,并显示在屏幕上,原屏幕上图形保留List 列出列出ASCII文件内容,只能看,不能修改﹑编辑SAve 存档图形文件存盘:将屏幕上的几何图形储存为一图形文件Save some部分存档储存部分图形:将屏幕上的一部分几何图形储存为一图形文件Browse 浏览图形浏览:浏览已储存在指定目录的图形文件(*。

GE3),依次显示在屏幕上Forward 显示前一个图形Backup 显示后一个图形Auto 自动显示一个个图形DeLay 自动显示时,下一个图形显示的延时时间Keep 保留当前屏幕上的一个图形Delete 删除当前屏幕上的一个图形Converters 档案转换图形转换:完成不同格式图形文件的读﹑写双向转换。

图形数据交换标准ASCII 这里的ASCII文件是指用一系列点的XYZ坐标组成的数据文件。

系统可以把屏幕上的一组点,写成ASCII格式的数据文件。

也可以读取这种格式的文件,在屏幕上生成一组点、折线或样条曲线。

系统可双向读写。

STEP STEP是一个包含一系列应用协议的ISO标准格式。

它可以描述实体、曲面和线框。

这是一种最新的产品数据格式工业标准,包含了产品生命周期的所有信息。

系统可以读取STEP文件Autodesk 与由美国Autodesk公司开发的AutoCAD软件和Inventor软件的图形文件格式作图形转换。

包括可以写出二种类型的文件:DWG文件和DFX文件;读取四种类型的文件:DWG文件、DFX文件、IPT文件和IAM文件。

mastercam9.1教程

mastercam9.1教程

mastercam9.1教程Mastercam 9.1教程介绍:Mastercam是一款专业的CAD/CAM(计算机辅助设计与计算机辅助制造)软件,被广泛应用于各种机械加工行业中。

Mastercam 9.1是Mastercam软件系列的一部分,是一个功能强大的版本,提供了许多工具和功能来帮助用户进行精确的设计和制造。

本教程旨在向用户提供使用Mastercam 9.1的基本知识和技能,以便能够熟练地进行设计和制造任务。

无论您是刚刚开始使用Mastercam,或者需要进一步提高您的技能,本教程都将为您提供指导。

章节一:Mastercam 9.1的介绍在本章中,我们将介绍Mastercam 9.1软件及其主要功能。

我们将介绍软件界面、工具栏、菜单以及常用命令的用法。

您将了解到如何在Mastercam 9.1中创建、编辑和保存项目。

章节二:二维绘图本章将重点介绍在Mastercam 9.1中进行二维绘图的基本技巧。

我们将学习如何绘制直线、圆、多边形等常用图形,并掌握如何使用修剪、延伸、偏移等工具来修改图形。

您还将学习到如何添加文本、尺寸以及标记等注释。

章节三:三维建模在本章中,我们将学习使用Mastercam 9.1进行三维建模的方法。

我们将探索如何创建复杂的三维几何体,包括利用旋转、偏移、拉伸等功能。

此外,您将了解到如何应用不同的材质和纹理来增强模型的外观。

章节四:零件编程本章将重点介绍如何使用Mastercam 9.1进行零件编程。

我们将学习如何生成切削路径和刀具路径,以及选择合适的刀具、切削参数和加工策略。

您还将学习如何进行仿真和验证,以确保程序的准确性和安全性。

章节五:数控编程在本章中,我们将深入研究Mastercam 9.1中的数控编程功能。

您将学习使用G代码和M代码进行编程,并了解如何进行底片切削和多轴加工。

我们还将介绍如何进行自动化编程,以提高生产效率。

章节六:后处理和仿真本章将介绍如何进行后处理和仿真操作。

MasterCAM9.1的刀具清单功能(可编辑修改word版)

MasterCAM9.1的刀具清单功能(可编辑修改word版)

MasterCAM9.1 后处理自动生成刀具清单,使用方法:将下面的内容复制到记事本内,并将其更名为Mpfan.pst,pst 为后缀,再将该文件拷贝至MasterCAM9.1 的安装目录C:\Mcam9\Mill\Posts,覆盖原文件,然后启动软件,可以在NC 程序开头生成刀具清单。

经典版本,绝对好用!# Post Name : MPFAN# Product : MILL# Machine Name : FANUC# Control Name : 6M# Description : GENERIC FANUC 6M STYLE POST# Associated Post :# Mill/Turn : NO# 4-axis/Axis subs. : NO# 5-axis : NO# Executable : MP 4.03## ************************************************************************ # *----------------------------------------------------------------------*# * POST PROCESSOR INTENDED FOR VERSION 6 BETA TESTING *# * * # * D O N O T D I S T R I B U T E ! ! ! *# * ------------------------------------------------------------------------ *# ************************************************************************ ###| REVISION LOG |## Programmers Note:# CNC 8/15/2005 - grt - Updated for Mill Version 6###| FEATURES: |## Users Note:## Following Misc_Reals & Misc_Integers are used:## mi1 - Work coordinate system# 0 = Reference return is generated and G92 with the# X, Y and Z home positions at file head.# 1 thru 3 = Reference return is generated and G92 with the# X, Y and Z home positions at each tool.# 4 thru 9 = The WCS of G54 thru G59 respectively at each tool.## Options / Usage:# It is recommended to start and end cutter compensation on a linear move.# Rotary axis assumes a "Z" plunge at feed into part, position of the# substituted axis at absolute zero position and the retraction from path# by the post call to the G28 machine Z home position.## DEBUG/PROGRAM SWITCHES, debugging and program switches#bug1 : 1 # 1 = Output post to screen, 2 = output leader to screenbug2 : 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?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?arcoutput : 2 # 0 = IJK, 1 = R no sign, 2 = R signed neg. over 180 breakarcs : 0 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcsstagetool : 0 # 0 = Do not pre-stage tools, 1 = Stage toolsuse_gear : no # Set to yes to output gear range codes## FORMAT STATEMENTS - n=nonmodal, l=leading, t=trailing, i=inc, d=delta #fs 1 0.3 #Decimal, absolute, 4 placefs 2 0.4d #Decimal, deltafs 3 1 0 #Integer, not leadingfs 4 2 0l #Integer, two leadingfs 5 3 0l #Integer, three leadingfs 6 4 0l #Integer, four leadingfs 7 0.1 #Decimal, absolute, 1 placefs 8 0.2 #Decimal, absolute, 2 placefs 9 0.3 #Decimal, absolute, 3 placefs 10 0 4t #No decimal, absolute, four trailingfs 11 0.4t #Decimal, absolute, four trailing## FORMAT ASSIGNMENTS## Axis output formats - Linear#fmt X 1 x # X axis positionfmt Y 1 y # Y axis positionfmt Z 1 z # Z axis positionfmt X 1 xr # X rapid position from tool change fmt Y 1 yr # Y rapid position from tool change fmt Z 1 zr # Z rapid position from tool change fmt X 1 xh # X home positionfmt Y 1 yh # Y home positionfmt Z 1 zh # Z home position## Axis output formats - Circular#fmt I 2 i # Arc center description in Xfmt J 2 j # Arc center description in Yfmt K 2 k # Arc center description in Zfmt R 1 arcrad # Arc Radiusfmt R- 1 arcradm # Arc Radius over 180 degree sweep## Axis output formats - Rotary substitution#fmt A 9 xs # Linear to rotary calculation of X fmt B 9 ys # Linear to rotary calculation of Y## Program & Sequence number format#fmt O 6 progno # Program numberfmt N 3 n # Sequence nos.## Tool format#fmt T 3 t # Tool Nofmt T 3 first_tool# First Tool Used (bldnxtool: yes)fmt T 3 next_tool # Next Tool Used (bldnxtool: yes) fmt D 3 tloffno # Diameter Offset Nofmt H 3 tlngno # Length Offset Nofmt "T" 1 tnote # Note formatfmt "D-" 1 toffnote # Note formatfmt "H-" 1 tlngnote # Note formatfmt "Dia-" 2 tldia # Note format## Spindle Speeds & Feedrate output formats#fmt S 6 speed # Spindle Speedfmt F 8 fr # Feedratefmt F 7 frdeg # Feedrate for rotaryfmt M 3 gear # Gear range## Drill variable formats#fmt G 3 drillref # Initial / Reference Toggle (G98/G99)fmt P 10 dwell # Dwellfmt Z 1 initht # Initial Heightfmt R 1 refht # Reference Heightfmt Z 1 depth # Depthfmt Q 2 peck1 # First peck increment (positive)fmt 1 peck2 # Second or last peck (positive)fmt 1 peckclr # Safety distancefmt 1 retr # Retract heightfmt F 8 frplunge # Plunge feedrate in drill cycles## Miscellaneous output formats#fmt M 5 ssrange # Spindle Speed Rangefmt C 4 coolant # Coolant## INITIALIZE - initialize system variables and define user variables#qtoolpln : no # MP386 - Enable tool plane optionqtoolopt : no # MP386 - Enable tool optimizationarctype : 2 # Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.do_full_arc : 0 #Allow full circle output? 0=no, 1=yeshelix_arc : 0 #Support helix arc output, 0=no, 1=all planes, 2=XY plane only bldnxtool : yes # Build next tool tableldrcode : 65 # 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 movesomitcrlf : no # Omit CR/LFomitrefht : no # Don't use reference height on first non-canned Z move omitseq : yes # Omit sequence no.omitz : no # Omit first Z movement for non-canned-cycles progname : 1 # Use uppercase for program namescalex : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kscaley : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kscalez : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kseqmax : 9999 # Max. sequence no.skipmotest: no # Skip motion test in linearspaces : 1 # No. of spaces to add between fieldstooltable : 1 # Read for tool table and pwrttabsswp : 0 # Absolute sweepdrlgsel : -1 # Drill Select Initializemaxfrdeg : 9999 # Limit for feed in deg/minabsinc : 0 # Absolute/Incremental toggle for modalitytcnt : 0 # Count the number of tool changesadelta : 0 # Calculation for deg/minldelta : 0 # Calculation for deg/minzdelta : 0 # Calculation for deg/minalzdelta : 0 # Calculation for deg/minfrdelta : 0 # Calculation for deg/minfrdegcalc : 0 # Calculation for deg/mincircum : 0 # Calculation for deg/minrotstrt : 1 # Flag for first rotary positionnewglobal : 1 # Error Check (Leave this variable set to 1)## FORMULAS - global formulas#ssrange = mi3 # Gear Range Selectspeed = abs ( ss ) # Absolute spindle speedarcradm = arcrad # Negative arcradspdlsel = fsg3(ss) # Spindle on selector based on pos. or neg. ss## CANNED CYCLES - select long or short code#usecandrill : yes # Use canned cycle for drillusecanpeck : yes # Use canned cycle for Peckusecanchip : yes # Use canned cycle for Chip Breakusecantap : yes # Use canned cycle for Tapusecanbore1 : yes # Use canned cycle for Bore1usecanbore2 : yes # Use canned cycle for Bore2usecanmisc1 : yes # Use canned cycle for Misc1usecanmisc2 : yes # Use canned cycle for Misc2## Lookup table definitions - for math functions FLOOK and FRANGE #flktbl 1 3 # Lookup table definitions - table no. - no. entries40 1000 # Low gear range41 2500 # Med gear range42 5000 # Hi gear range## Strings - String labels must start with 's' - they are not pre-assigned ##Select operation notesop00 NULL # String definitionsop01 END-MIll # " "sop02 END-MIll # " "sop03 DRIll # " "sop04 END-MIll # " "sop05 S-MILL # " "sop06 2D-SWEPT.. # " "sop07 3D-SWEPT.. # " "sop08 REVOLVED.. # " "sop09 LOFT...... # " "sop10 COONS..... # " "sop11 TRIM ..... # " "sop12 FILLET.... # " "sop13 ROUGH..... # " "sop14 OP14...... # " "sop15 OP15...... # " "sopnote # Target stringfstrsel sop00 opcode sopnote## Select motion G codesg00 G0 # Linear movement at rapid feedratesg01 G1 # Linear movement at feedratesg02 G2 # Circular interpolation CWsg03 sgcode G3 # Circular interpolation CCW # Target stringfstrsel sg00 gcode sgcode## Select incremental or absolute G codesg90 G90 # Absolute G codesg91 G91 # Incremental G codesgabsinc # Target stringfstrsel sg90 absinc sgabsinc## Select spindle startsm04 M4 # Spindle reversesm05 M5 # Spindle offsm03 M3 # Spindle forwardspdlon # Target stringfstrsel sm04 spdlsel spdlon## Cutter compensation codescc0 "" # Cutter compensation state not changedsg40 G40 # Cancel cutter compensationsg41 G41 # Cutter compensation leftsg42 G42 # Cutter compensation rightsg140 G40 # Last linear move cancel cutter comp (see note)# Note: to cancel comp after last move, remove G40 stringsccomp # with sg140 and remove "#" at the postline call "pcancelcc" # Target stringfstrsel scc0 ccomp sccomp## Select work plane G codesg17 G17 # XY plane code sg19 G19 # XZ plane codesg18 G18 # YZ plane codesgplane # Target stringfstrsel sg17 plane sgplane## Work coordinate systemsg50 G92 # Work coordinate system G codesg51 G92 # " " " " "sg52 G92 # " " " " "sg53 G92 # " " " " "sg54 G54 # " " " " "sg55 G55 # " " " " "sg56 G56 # " " " " "sg57 G57 # " " " " "sg58 G58 # " " " " "sg59 G59 # " " " " "sgwcs # Target stringfstrsel sg50 mi1 sgwcs## Canned drill cycle string selectsg81 G81 # drill - no dwellsg81d G82 # drill - with dwellsg83 G83 # peck drill - no dwellsg83d G83 # peck drill - with dwellsg73 G73 # chip break - no dwellsg73d G73 # chip break - with dwellsg84 G84 # tap - no dwellsg84d G74 # tap - with dwell (selects left hand) sg85 G85 # bore #1 - no dwellsg85d G89 # bore #1 - with dwellsg86 G86 # bore #2 - no dwellsg86d G86 # bore #2 - with dwellsgm1 G81 # misc #1 - no dwellsgm1d G82 # misc #1 - with dwellsgm2 G81 # misc #2 - no dwellsgm2d G82 # misc #2 - with dwellsgdrill # Target stringdrlgsel = drillcyc * 2 + fsg2 ( dwell ) # 16 possible combinations:# drillcyc = 0..7# dwell = 0 or non-zero (2 states) fstrsel sg81 drlgsel sgdrill## Generate 'sgear' stringsgear0 M** # auto gear rangesgear1 M41 # Low gear rangesgear2 M42 # Med gear rangesgear3 M43 # High gear range - selected in parameters by mi3sgearfstrsel sgear0 gear sgear## POSTLINES, USER-DEFINED - Postline labels start with 'p'.# End a line with ',' to continue on the next line.# End a line with ', e' to generate carriage return and linefeed.## Program general output control, user defined#pinit # Initialize Varsprv_fr = 999.999prv_frdeg = 999.999prv_frplunge = 999.999linarc = 0rotstrt = 1pabs # Absolute G code outputabsinc = 0sgabsincpinc # Incremental G code outputabsinc = 1sgabsincpcooloff # Coolant off "M" code outputif prv_coolant > 0, "M09"pcoolon # Coolant off "M" code outputif coolant = 1, "M08" # Floodif coolant = 2, "M07" # Mistpcoolnl # Coolant off "M" code outputif coolant = 0, "M09" # Offif coolant = 1, "M08" # Floodif coolant = 2, "M07" # Mistpfr # Feedrate W/O Negative Feedratesif fr > 0, frpcan # Canned text - cantext = 0, 1, 2, 3if cantext = 1, "M01" #optional stopif cantext = 2, " " #user optionif cantext = 3, " " #user option## Work coordinate output, user defined#pg92_sof # G92 coordinate setting at start"/", n, pinc, "G28", "Z0.", e"/", n, "G28", "X0.", "Y0.", e"/", n, *sgwcs, *xh, *yh, *zh, epg92_out # G92 coordinate setting at tool change"/", n, "G28", "X0.", "Y0.", eif gcode <> 1003, "/", n, *sgwcs, *xh, *yh, *zh, epwcs # G54+ coordinate settingif mi1 >= 4, *sgwcs## Gear selection control, user defined#pgear # Find spindle rangegear = frange ( 1, speed )*gearprange # Find spindle rangeif use_gear = 1, pgear## Cutter comp. output control, user defined#pccdia2 # Cutter Compensation2if ccomp <> 4, tloffnopccdia # Cutter Compensationif ccomp <> 0, pccdia2## Axis substitution motion, user defined#pdrlxyrot # Substitute Axis X/Y with Rotary axis w/ drillingif rotaxis = 0, x, yif rotaxis = 1, y, xsif rotaxis = 2, x, yspfrd # Feedrate W/O Negative Feedrates (deg/min)if frdeg > maxfrdeg, frdeg = maxfrdegif frdelta > .5, *frdeg #Value to exceed to output frdegprotaxis1a # Substitute Axis X/Y with Rotary axisif rotstrt = 0, n, sgcode, y, z, *xs, pfrd, pcan, eif rotstrt = 1, n, xs, eif rotstrt = 1, n, sgcode, y, z, pfrd, pcan, eprotaxis1 # Substitute Axis X/Y with Rotary axisif gcode = 0, n, sgcode, y, z, *xs, pcan, eif gcode = 1, protaxis1aprotaxis2a # Substitute Axis X/Y with Rotary axisif rotstrt = 0, n, sgcode, x, z, *ys, pfrd, pcan, eif rotstrt = 1, n, ys, eif rotstrt = 1, n, sgcode, x, z, pfrd, pcan, eprotaxis2 # Substitute Axis X/Y with Rotary axisif gcode = 0, n, sgcode, x, z, *ys, pcan, eif gcode = 1, protaxis2aprotaxis # Substitute Axis X/Y with Rotary axisif rotstrt = 1, !frif fr < 0, fr = prv_fr!frif rotaxis = 1, ldelta = abs ( y - prv_y )if rotaxis = 2, ldelta = abs ( x - prv_x )zdelta = abs ( z - prv_z )if rotaxis = 1, adelta = ( ( abs ( xs - prv_xs ) ) / 360 ) * circumif rotaxis = 2, adelta = ( ( abs ( ys - prv_ys ) ) / 360 ) * circumalzdelta = sqrt ( adelta^2 + ldelta^2 + zdelta^2 )frdegcalc = fr * ( 360 / circum )if alzdelta <> 0, frdeg = ( adelta / alzdelta ) * frdegcalcif adelta = 0, frdeg = frfrdelta = abs ( frdeg - prv_frdeg )if rotaxis = 1, protaxis1if rotaxis = 2, protaxis2if gcode = 1, rotstrt = 0!x, !y, !zprotary # Rotary Moveif rotaxis = 1, xr = 0 #Force X to zeroif rotaxis = 2, yr = 0 #Force Y to zeroif rotaxis > 0, linarc = 1circum = rotdia * pi## Axis linear/circular motion, user defined#parctyp2 # Arc output for R w/ sign over 180 degree sweepabsswp = abs ( sweep )!absswpif absswp <= 180, *arcradif absswp > 180, *arcradmparctyp1 # Arc output for R w/ no sign*arcradparctyp0 # Arc output for IJKif plane = 0, *i, *j, kif plane = 1, i, *j, *kif plane = 2, *i, j, *kparctyp # Select the arc outputif arcoutput = 0, parctyp0if arcoutput = 1, parctyp1if arcoutput = 2, parctyp2prapidm # Linear line movement - at rapid feedraten, sgplane, sccomp, pccdia, sgcode, x, y, z, pcanplinm # Linear line movement - at feedraten, sccomp, pccdia, sgcode, x, y, z, pfr, pcanpcirm # Circular interpolationn, sgplane, sccomp, pccdia, sgcode, x, y, z, parctyp, pfr, pcan## Drilling, user defined#pdrillref # Determine G98 or G99if initht <> refht, drillref = 98if initht = refht, drillref = 99pdwell # Determine whether to output dwellif dwell <> 0, *dwellptlchg0dr2 # Null tool change for drillinggcode = 0if zr < prv_zr, n, sgcode, *xr, *yr, en, sgcode, *zr, eptlchg0drl # Null tool change for drillingif prv_opcode = 3 & zr <> prv_zr, ptlchg0dr2## POSTLINES, PRE-DEFINED - Postline names are pre-assigned.# Lines do not need to end with ', e' for carriage return and linefeed.#pcomment # Manual Entry - COMMENTS (on a block by itself) 1005,1006 "(", scomm, ")"pheader # File header"%""(", progname,".NC)""(20",year,"-",month,"-",day,",", time, ")"psof0 # Start of file for tool zeropsofpsof # Start of file for non-zero tool numberpinit!opcode, !coolantif tcnt = 1, stagetool = 2prognocommentn, "G40 G49 G80 G17 G21"n, "GO G91 G28 Z0."# if stagetool = 0, n, *t, "M6"protaryn, *t, "M6"if stagetool = 0, n, *next_tooln, *sg00,*sg90,*sg54,pabs, *xr, *yrn, *speed, *spdlon, prangen, "G43", tlngno, *zr, pcoolonptlchg0 # Null tool changeif opcode = 3, ptlchg0drlif prv_speed <> speed, n, speedif coolant <> prv_coolant, n, pcoolnl!opcode, !coolantptlchg # Tool changepinit!opcoden, pcooloffn,*sm05n, pinc, "G28", "Z0."if stagetool = 0, n, *t, "M6"if stagetool = 0, n, *next_tooln, "M01"commentprotaryn, *sg00,pabs,*sg54, *xr, *yrn, *speed, *spdlon, prangen, "G43", tlngno, *zr, pcoolon!coolantpeof0 # End of file for tool zeropeofpeof # End of file for non-zero tooln, pcooloffn, *sm05# n, pinc, "G30", "Z0."n, "G91 G28 Z0."n, "G91 G28 Y0."if stagetool = 0, n, *first_tool, "M6"n, "M30""%"## Axis motion#prot0 # Toolplane postline - Custom post requiredprot # Toolplane postline - Custom post requiredprapid # Linear line movement - at rapid feedrateif rotaxis <> 0, protaxiselse, prapidmpzrapid # Linear movement in Z axis only - at rapid feedraten, sgcode, zplin1 # First linear movement after SOF, whatno must be setplin2 # Second linear movement after SOF, whatno must be setplin # Linear line movement - at feedrateif rotaxis <> 0, protaxiselse, plinmpz # Linear movement in Z axis only - at feedraten, sgcode, z, pfrpcir1 # First circular movement after SOF, whatno must be set pcir2 # Second circular movement after SOF, whatno must be setpcir # Circular interpolationif rotaxis <> 0, protaxiselse, pcirm## Drilling#pdrill # Canned Drill Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplungeppeck # Canned Peck Drill Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungepchpbrk # Canned Chip Break Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungeptap # Canned Tap Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *frplungepbore1 # Canned Bore #1 Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplungepbore2 # Canned Bore #2 Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *frplungepmisc1 # Canned Misc #1 Cycle (User Option)pdrillpmisc2 # Canned Misc #2 Cycle (User Option)pdrillpdrill_2 # Canned Drill Cyclen, pdrlxyrot, refht, depthppeck_2 # Canned Peck Drill Cyclepdrill_2pchpbrk_2 # Canned Chip Break Cyclepdrill_2ptap_2 # Canned Tap Cyclepdrill_2pbore1_2 # Canned Bore #1 Cyclepdrill_2pbore2_2 # Canned Bore #2 Cyclepdrill_2pmisc1_2 # Canned Misc #1 Cyclepdrill_2pmisc2_2 # Canned Misc #2 Cyclepdrill_2pcanceldc # Cancel canned drill cycle!gcode n,"G80"prv_z = inithtpcancelcc # Cancel cutter comp.#n, "G40"pwrtt # Write tool table, scans entire file, null tools are negativetnote = ttoffnote = tloffnotlngnote = tlngnoif t >= 0, "(", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldia, " ",*sopnote, ")"if t >= 0, tcnt = tcnt + 1## Numbered questions for Mastercam -- Used by Mill 5#38. Rapid feedrate? 10000.76. Name of associated CFG file? T400. Name of associated CFG file? T1538. Rapid feedrate (metric)? 20000.080. Communications port number for receive and transmit (1 or 2) ? 281. Data rate (110,150,300,600,1200,2400,4800,9600,14400,19200,38400)? 960082.Parity (E/O/N)? E83.Data bits (7 or 8)? 784.Stop bits (1 or 2)? 285.Strip line feeds? N86.Delay after end of line (seconds)? 087.Ascii, Eia, or Binary (A/E/B)? A88.Echo keyboard to screen in terminal emulation? n89.Strip carriage returns? N90.Drive and subdirectory for NC files? of executable post processor? MP of reverse post processor? RP93.Reverse post PST file name? RPABS100.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? 8000107. Average time for tool change (seconds)? 1#110. Default tool library? TOOLS-MM.TL9## Switches to Enable OR Disable toolpath parameter screen buttons#161.Enable Home Position button? Y162.Enable Reference Point button? y163.Enable Misc. Values button? y164.Enable Rotary Axis button? N165.Enable Tool Plane button? y166.Enable Construction Plane button? y167.Enable Tool Display button? y168.Check tplane during automatic work origin creation? y## Default Miscellaneous Real Values#201.Default miscellaneous real variable 1 (mr1)? 0.0202.Default miscellaneous real variable 2 (mr2)? 0.0203.Default miscellaneous real variable 3 (mr3)? 0.0204.Default miscellaneous real variable 4 (mr4)? 0.0205.Default miscellaneous real variable 5 (mr5)? 0.0206.Default miscellaneous real variable 6 (mr6)? 0.0207.Default miscellaneous real variable 7 (mr7)? 0.0208.Default miscellaneous real variable 8 (mr8)? 0.0209.Default miscellaneous real variable 9 (mr9)? 0.0210.Default miscellaneous real variable 10 (mr10)? 0.0## Default Miscellaneous Real Values (METRIC)#1601. Default miscellaneous real variable 1 (mr1) (metric)? 0.01602. Default miscellaneous real variable 2 (mr2) (metric)? 0.01603. Default miscellaneous real variable 3 (mr3) (metric)? 0.01604. Default miscellaneous real variable 4 (mr4) (metric)? 0.01605. Default miscellaneous real variable 5 (mr5) (metric)? 0.01606. Default miscellaneous real variable 6 (mr6) (metric)? 0.01607. Default miscellaneous real variable 7 (mr7) (metric)? 0.01608. Default miscellaneous real variable 8 (mr8) (metric)? 0.01609. Default miscellaneous real variable 9 (mr9) (metric)? 0.01610. Default miscellaneous real variable 10 (mr10) (metric)? 0.0## Enable/Disable Miscellaneous Real Variable switches#1611. Enable miscellaneous real variable 1? y1612. Enable miscellaneous real variable 2? y1613. Enable miscellaneous real variable 3? y1614. Enable miscellaneous real variable 4? y1615. Enable miscellaneous real variable 5? y1616. Enable miscellaneous real variable 6? y1617. Enable miscellaneous real variable 7? y1618. Enable miscellaneous real variable 8? y1619. Enable miscellaneous real variable 9? y1620. Enable miscellaneous real variable 10? y## Default Miscellaneous Integer Values#301.Default Work Coordinate System (0 thru 3=G92, 4 thru 9=G54-G59)? 4 302.Miscellaneous integer variable 2 (mi2)? 0303.Miscellaneous integer variable 3 (mi3)? 0304.Miscellaneous integer variable 4 (mi4)? 0305.Miscellaneous integer variable 5 (mi5)? 0306.Miscellaneous integer variable 6 (mi6)? 0307.Miscellaneous integer variable 7 (mi7)? 0308.Miscellaneous integer variable 8 (mi8)? 0309.Miscellaneous integer variable 9 (mi9)? 0310.Miscellaneous integer variable 10 (mi10)? 0## Enable/Disable Miscellaneous Integer Variable switches#1621. Enable miscellaneous integer variable 1? y1622. Enable miscellaneous integer variable 2? y1623. Enable miscellaneous integer variable 3? y1624. Enable miscellaneous integer variable 4? y1625. Enable miscellaneous integer variable 5? y1626. Enable miscellaneous integer variable 6? y1627. Enable miscellaneous integer variable 7? y1628. Enable miscellaneous integer variable 8? y1629. Enable miscellaneous integer variable 9? y1630. Enable miscellaneous integer variable 10? y## Configuration File association parameters (default is 'y')#1630. Enable miscellaneous integer variable 10? y401.Read SYSTEM COLORS section? y402.Read ALLOCATIONS section? y403.Read TOLERANCES section? y404.Read DATA PATHS section? y405.Read COMMUNICATIONS section? y406.Read DRAFT SETTINGS section? y407.Read MISCELLANEOUS section? y408.Read NC SETTINGS section? y409.Read DIALOG SCRIPTS section? y410.Read DESIGN SETTINGS section? y411.Read PLOTTER SETTINGS section? y412.Read ALT-KEY ASSIGNMENTS section? y413.Read CAD section? y414.Read START/EXIT section? y415.Read SCREEN section? y416.Read FILE NAMES section? y1500. Chook to execute from 'Misc. values' button? 1501.Insert parameter information in the ascii NCI? n 1502.Write operation information to binary file (.ops)? n1520. Display a warning when cutter compensation in control simulation finds an error? n# Do NOT manually change the answer for Q.1999 !1999. Product Product version number that post supports? 93001. Machine acceleration? 23002. timing size? .1。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

MasterCAM9.1后处理自动生成刀具清单,使用方法:将下面的内容复制到记事本内,并将其更名为Mpfan.pst,pst为后缀,再将该文件拷贝至MasterCAM9.1的安装目录C:\Mcam9\Mill\Posts,覆盖原文件,然后启动软件,可以在NC程序开头生成刀具清单。

经典版本,绝对好用!# Post Name : MPFAN# Product : MILL# Machine Name : FANUC# Control Name : 6M# Description : GENERIC FANUC 6M STYLE POST# Associated Post :# Mill/Turn : NO# 4-axis/Axis subs. : NO# 5-axis : NO# Executable : MP 4.03##******************************************************************** ****#*----------------------------------------------------------------------*# * POST PROCESSOR INTENDED FOR VERSION 6 BETA TESTING *# * *# * D O N O T D I S T R I B U T E ! ! ! *#*----------------------------------------------------------------------*#************************************************************************## ---------------#| REVISION LOG |#------------------------------------------------------------------------# Programmers Note:# CNC 8/15/2005 - grt - Updated for Mill Version 6## ---------------#| FEATURES: |#------------------------------------------------------------------------# Users Note:## Following Misc_Reals & Misc_Integers are used:## mi1 - Work coordinate system# 0 = Reference return is generated and G92 with the# X, Y and Z home positions at file head.# 1 thru 3 = Reference return is generated and G92 with the# X, Y and Z home positions at each tool.# 4 thru 9 = The WCS of G54 thru G59 respectively at each tool. ## Options / Usage:# It is recommended to start and end cutter compensation on a linear move. # Rotary axis assumes a "Z" plunge at feed into part, position of the # substituted axis at absolute zero position and the retraction from path # by the post call to the G28 machine Z home position.#--------------------------------------------------------------------------# DEBUG/PROGRAM SWITCHES, debugging and program 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?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?arcoutput : 2 # 0 = IJK, 1 = R no sign, 2 = R signed neg. over 180 breakarcs : 0 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs stagetool : 0 # 0 = Do not pre-stage tools, 1 = Stage toolsuse_gear : no # Set to yes to output gear range codes#--------------------------------------------------------------------------# FORMAT STATEMENTS - n=nonmodal, l=leading, t=trailing, i=inc, d=delta #--------------------------------------------------------------------------fs 1 0.3 #Decimal, absolute, 4 placefs 2 0.4d #Decimal, deltafs 3 1 0 #Integer, not leadingfs 4 2 0l #Integer, two leadingfs 5 3 0l #Integer, three leadingfs 6 4 0l #Integer, four leadingfs 7 0.1 #Decimal, absolute, 1 placefs 8 0.2 #Decimal, absolute, 2 placefs 9 0.3 #Decimal, absolute, 3 placefs 10 0 4t #No decimal, absolute, four trailingfs 11 0.4t #Decimal, absolute, four trailing#--------------------------------------------------------------------------# FORMAT ASSIGNMENTS#--------------------------------------------------------------------------# Axis output formats - Linear#--------------------------------------------------------------------------fmt X 1 x # X axis positionfmt Y 1 y # Y axis positionfmt Z 1 z # Z axis positionfmt X 1 xr # X rapid position from tool changefmt Y 1 yr # Y rapid position from tool changefmt Z 1 zr # Z rapid position from tool changefmt X 1 xh # X home positionfmt Y 1 yh # Y home positionfmt Z 1 zh # Z home position#--------------------------------------------------------------------------# Axis output formats - Circular#--------------------------------------------------------------------------fmt I 2 i # Arc center description in Xfmt J 2 j # Arc center description in Yfmt K 2 k # Arc center description in Zfmt R 1 arcrad # Arc Radiusfmt R- 1 arcradm # Arc Radius over 180 degree sweep#--------------------------------------------------------------------------# Axis output formats - Rotary substitution#--------------------------------------------------------------------------fmt A 9 xs # Linear to rotary calculation of Xfmt B 9 ys # Linear to rotary calculation of Y#--------------------------------------------------------------------------# Program & Sequence number format#--------------------------------------------------------------------------fmt O 6 progno # Program numberfmt N 3 n # Sequence nos.#--------------------------------------------------------------------------# Tool format#--------------------------------------------------------------------------fmt T 3 t # Tool Nofmt T 3 first_tool# First Tool Used (bldnxtool: yes)fmt T 3 next_tool # Next Tool Used (bldnxtool: yes)fmt D 3 tloffno # Diameter Offset Nofmt H 3 tlngno # Length Offset Nofmt "T" 1 tnote # Note formatfmt "D-" 1 toffnote # Note formatfmt "H-" 1 tlngnote # Note formatfmt "Dia-" 2 tldia # Note format#--------------------------------------------------------------------------# Spindle Speeds & Feedrate output formats#--------------------------------------------------------------------------fmt S 6 speed # Spindle Speedfmt F 8 fr # Feedratefmt F 7 frdeg # Feedrate for rotaryfmt M 3 gear # Gear range#--------------------------------------------------------------------------# Drill variable formats#--------------------------------------------------------------------------fmt G 3 drillref # Initial / Reference Toggle (G98/G99)fmt P 10 dwell # Dwellfmt Z 1 initht # Initial Heightfmt R 1 refht # Reference Heightfmt Z 1 depth # Depthfmt Q 2 peck1 # First peck increment (positive)fmt 1 peck2 # Second or last peck (positive)fmt 1 peckclr # Safety distancefmt 1 retr # Retract heightfmt F 8 frplunge # Plunge feedrate in drill cycles#--------------------------------------------------------------------------# Miscellaneous output formats#--------------------------------------------------------------------------fmt M 5 ssrange # Spindle Speed Rangefmt C 4 coolant # Coolant#--------------------------------------------------------------------------# INITIALIZE - initialize system variables and define user variables #--------------------------------------------------------------------------qtoolpln : no # MP386 - Enable tool plane optionqtoolopt : no # MP386 - Enable tool optimizationarctype : 2 # Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.do_full_arc : 0 #Allow full circle output? 0=no, 1=yeshelix_arc : 0 #Support helix arc output, 0=no, 1=all planes, 2=XY plane onlybldnxtool : yes # Build next tool tableldrcode : 65 # 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 movesomitcrlf : no # Omit CR/LFomitrefht : no # Don't use reference height on first non-canned Z moveomitseq : yes # Omit sequence no.omitz : no # Omit first Z movement for non-canned-cycles progname : 1 # Use uppercase for program namescalex : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kscaley : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kscalez : 1.0 # Scaling of .NCI at input - x,y,z,i,j,kseqmax : 9999 # Max. sequence no.skipmotest: no # Skip motion test in linearspaces : 1 # No. of spaces to add between fieldstooltable : 1 # Read for tool table and pwrttabsswp : 0 # Absolute sweepdrlgsel : -1 # Drill Select Initializemaxfrdeg : 9999 # Limit for feed in deg/minabsinc : 0 # Absolute/Incremental toggle for modalitytcnt : 0 # Count the number of tool changesadelta : 0 # Calculation for deg/minldelta : 0 # Calculation for deg/minzdelta : 0 # Calculation for deg/minalzdelta : 0 # Calculation for deg/minfrdelta : 0 # Calculation for deg/minfrdegcalc : 0 # Calculation for deg/mincircum : 0 # Calculation for deg/minrotstrt : 1 # Flag for first rotary positionnewglobal : 1 # Error Check (Leave this variable set to 1)#--------------------------------------------------------------------------# FORMULAS - global formulas#--------------------------------------------------------------------------ssrange = mi3 # Gear Range Selectspeed = abs ( ss ) # Absolute spindle speedarcradm = arcrad # Negative arcradspdlsel = fsg3(ss) # Spindle on selector based on pos. or neg. ss#--------------------------------------------------------------------------# CANNED CYCLES - select long or short code#--------------------------------------------------------------------------usecandrill : yes # Use canned cycle for drillusecanpeck : yes # Use canned cycle for Peckusecanchip : yes # Use canned cycle for Chip Breakusecantap : yes # Use canned cycle for Tapusecanbore1 : yes # Use canned cycle for Bore1usecanbore2 : yes # Use canned cycle for Bore2usecanmisc1 : yes # Use canned cycle for Misc1usecanmisc2 : yes # Use canned cycle for Misc2#--------------------------------------------------------------------------# Lookup table definitions - for math functions FLOOK and FRANGE#--------------------------------------------------------------------------flktbl 1 3 # Lookup table definitions - table no. - no. entries40 1000 # Low gear range41 2500 # Med gear range42 5000 # Hi gear range#--------------------------------------------------------------------------# Strings - String labels must start with 's' - they are not pre-assigned #--------------------------------------------------------------------------#Select operation notesop00 NULL # String definitionsop01 END-MIll # " "sop02 END-MIll # " "sop03 DRIll # " "sop04 END-MIll # " "sop05 S-MILL # " "sop06 2D-SWEPT.. # " "sop07 3D-SWEPT.. # " "sop08 REVOLVED.. # " "sop09 LOFT...... # " "sop10 COONS..... # " "sop11 TRIM ..... # " "sop12 FILLET.... # " "sop13 ROUGH..... # " "sop14 OP14...... # " "sop15 OP15...... # " "sopnote # Target stringfstrsel sop00 opcode sopnote#--------------------------------------------------------------------------# Select motion G codesg00 G0 # Linear movement at rapid feedratesg01 G1 # Linear movement at feedratesg02 G2 # Circular interpolation CWsg03 G3 # Circular interpolation CCWsgcode # Target stringfstrsel sg00 gcode sgcode#--------------------------------------------------------------------------# Select incremental or absolute G codesg90 G90 # Absolute G codesg91 G91 # Incremental G codesgabsinc # Target stringfstrsel sg90 absinc sgabsinc#--------------------------------------------------------------------------# Select spindle startsm04 M4 # Spindle reversesm05 M5 # Spindle offsm03 M3 # Spindle forwardspdlon # Target stringfstrsel sm04 spdlsel spdlon#--------------------------------------------------------------------------# Cutter compensation codescc0 "" # Cutter compensation state not changedsg40 G40 # Cancel cutter compensationsg41 G41 # Cutter compensation leftsg42 G42 # Cutter compensation rightsg140 G40 # Last linear move cancel cutter comp (see note)# Note: to cancel comp after last move, remove G40 string # with sg140 and remove "#" at the postline call "pcancelcc"sccomp # Target stringfstrsel scc0 ccomp sccomp#--------------------------------------------------------------------------# Select work plane G codesg17 G17 # XY plane codesg19 G19 # XZ plane codesg18 G18 # YZ plane codesgplane # Target stringfstrsel sg17 plane sgplane#--------------------------------------------------------------------------# Work coordinate systemsg50 G92 # Work coordinate system G codesg51 G92 # " " " " "sg52 G92 # " " " " "sg53 G92 # " " " " "sg54 G54 # " " " " "sg55 G55 # " " " " "sg56 G56 # " " " " "sg57 G57 # " " " " "sg58 G58 # " " " " "sg59 G59 # " " " " "sgwcs # Target stringfstrsel sg50 mi1 sgwcs#--------------------------------------------------------------------------# Canned drill cycle string selectsg81 G81 # drill - no dwellsg81d G82 # drill - with dwellsg83 G83 # peck drill - no dwellsg83d G83 # peck drill - with dwellsg73 G73 # chip break - no dwellsg73d G73 # chip break - with dwellsg84 G84 # tap - no dwellsg84d G74 # tap - with dwell (selects left hand)sg85 G85 # bore #1 - no dwellsg85d G89 # bore #1 - with dwellsg86 G86 # bore #2 - no dwellsg86d G86 # bore #2 - with dwellsgm1 G81 # misc #1 - no dwellsgm1d G82 # misc #1 - with dwellsgm2 G81 # misc #2 - no dwellsgm2d G82 # misc #2 - with dwellsgdrill # Target stringdrlgsel = drillcyc * 2 + fsg2 ( dwell ) # 16 possible combinations: # drillcyc = 0..7# dwell = 0 or non-zero (2 states)fstrsel sg81 drlgsel sgdrill#--------------------------------------------------------------------------# Generate 'sgear' stringsgear0 M** # auto gear rangesgear1 M41 # Low gear rangesgear2 M42 # Med gear rangesgear3 M43 # High gear range - selected in parameters by mi3 sgearfstrsel sgear0 gear sgear#--------------------------------------------------------------------------# POSTLINES, USER-DEFINED - Postline labels start with 'p'.# End a line with ',' to continue on the next line.# End a line with ', e' to generate carriage return and linefeed. #--------------------------------------------------------------------------# Program general output control, user defined#--------------------------------------------------------------------------pinit # Initialize Varsprv_fr = 999.999prv_frdeg = 999.999prv_frplunge = 999.999linarc = 0rotstrt = 1pabs # Absolute G code outputabsinc = 0sgabsincpinc # Incremental G code outputabsinc = 1sgabsincpcooloff # Coolant off "M" code outputif prv_coolant > 0, "M09"pcoolon # Coolant off "M" code outputif coolant = 1, "M08" # Floodif coolant = 2, "M07" # Mistpcoolnl # Coolant off "M" code outputif coolant = 0, "M09" # Offif coolant = 1, "M08" # Floodif coolant = 2, "M07" # Mistpfr # Feedrate W/O Negative Feedratesif fr > 0, frpcan # Canned text - cantext = 0, 1, 2, 3if cantext = 1, "M01" #optional stopif cantext = 2, " " #user optionif cantext = 3, " " #user option#--------------------------------------------------------------------------# Work coordinate output, user defined#--------------------------------------------------------------------------pg92_sof # G92 coordinate setting at start"/", n, pinc, "G28", "Z0.", e"/", n, "G28", "X0.", "Y0.", e"/", n, *sgwcs, *xh, *yh, *zh, epg92_out # G92 coordinate setting at tool change"/", n, "G28", "X0.", "Y0.", eif gcode <> 1003, "/", n, *sgwcs, *xh, *yh, *zh, e pwcs # G54+ coordinate settingif mi1 >= 4, *sgwcs#--------------------------------------------------------------------------# Gear selection control, user defined#--------------------------------------------------------------------------pgear # Find spindle rangegear = frange ( 1, speed )*gearprange # Find spindle rangeif use_gear = 1, pgear#--------------------------------------------------------------------------# Cutter comp. output control, user defined#--------------------------------------------------------------------------pccdia2 # Cutter Compensation2if ccomp <> 4, tloffnopccdia # Cutter Compensationif ccomp <> 0, pccdia2#--------------------------------------------------------------------------# Axis substitution motion, user defined#--------------------------------------------------------------------------pdrlxyrot # Substitute Axis X/Y with Rotary axis w/ drillingif rotaxis = 0, x, yif rotaxis = 1, y, xsif rotaxis = 2, x, yspfrd # Feedrate W/O Negative Feedrates (deg/min)if frdeg > maxfrdeg, frdeg = maxfrdegif frdelta > .5, *frdeg #Value to exceed to output frdegprotaxis1a # Substitute Axis X/Y with Rotary axisif rotstrt = 0, n, sgcode, y, z, *xs, pfrd, pcan, eif rotstrt = 1, n, xs, eif rotstrt = 1, n, sgcode, y, z, pfrd, pcan, eprotaxis1 # Substitute Axis X/Y with Rotary axisif gcode = 0, n, sgcode, y, z, *xs, pcan, eif gcode = 1, protaxis1aprotaxis2a # Substitute Axis X/Y with Rotary axisif rotstrt = 0, n, sgcode, x, z, *ys, pfrd, pcan, eif rotstrt = 1, n, ys, eif rotstrt = 1, n, sgcode, x, z, pfrd, pcan, eprotaxis2 # Substitute Axis X/Y with Rotary axisif gcode = 0, n, sgcode, x, z, *ys, pcan, eif gcode = 1, protaxis2aprotaxis # Substitute Axis X/Y with Rotary axisif rotstrt = 1, !frif fr < 0, fr = prv_fr!frif rotaxis = 1, ldelta = abs ( y - prv_y )if rotaxis = 2, ldelta = abs ( x - prv_x )zdelta = abs ( z - prv_z )if rotaxis = 1, adelta = ( ( abs ( xs - prv_xs ) ) / 360 ) * circum if rotaxis = 2, adelta = ( ( abs ( ys - prv_ys ) ) / 360 ) * circum alzdelta = sqrt ( adelta^2 + ldelta^2 + zdelta^2 )frdegcalc = fr * ( 360 / circum )if alzdelta <> 0, frdeg = ( adelta / alzdelta ) * frdegcalcif adelta = 0, frdeg = frfrdelta = abs ( frdeg - prv_frdeg )if rotaxis = 1, protaxis1if rotaxis = 2, protaxis2if gcode = 1, rotstrt = 0!x, !y, !zprotary # Rotary Moveif rotaxis = 1, xr = 0 #Force X to zeroif rotaxis = 2, yr = 0 #Force Y to zeroif rotaxis > 0, linarc = 1circum = rotdia * pi#--------------------------------------------------------------------------# Axis linear/circular motion, user defined#--------------------------------------------------------------------------parctyp2 # Arc output for R w/ sign over 180 degree sweepabsswp = abs ( sweep )!absswpif absswp <= 180, *arcradif absswp > 180, *arcradmparctyp1 # Arc output for R w/ no sign*arcradparctyp0 # Arc output for IJKif plane = 0, *i, *j, kif plane = 1, i, *j, *kif plane = 2, *i, j, *kparctyp # Select the arc outputif arcoutput = 0, parctyp0if arcoutput = 1, parctyp1if arcoutput = 2, parctyp2prapidm # Linear line movement - at rapid feedrate n, sgplane, sccomp, pccdia, sgcode, x, y, z, pcan plinm # Linear line movement - at feedrate n, sccomp, pccdia, sgcode, x, y, z, pfr, pcanpcirm # Circular interpolationn, sgplane, sccomp, pccdia, sgcode, x, y, z, parctyp, pfr,pcan#--------------------------------------------------------------------------# Drilling, user defined#--------------------------------------------------------------------------pdrillref # Determine G98 or G99if initht <> refht, drillref = 98if initht = refht, drillref = 99pdwell # Determine whether to output dwellif dwell <> 0, *dwellptlchg0dr2 # Null tool change for drillinggcode = 0if zr < prv_zr, n, sgcode, *xr, *yr, e n, sgcode, *zr, eptlchg0drl # Null tool change for drillingif prv_opcode = 3 & zr <> prv_zr, ptlchg0dr2#--------------------------------------------------------------------------# POSTLINES, PRE-DEFINED - Postline names are pre-assigned.# Lines do not need to end with ', e' for carriage return and linefeed. #--------------------------------------------------------------------------pcomment # Manual Entry - COMMENTS (on a block by itself) 1005,1006 "(", scomm, ")"pheader # File header"%""(", progname,".NC)""(20",year,"-",month,"-",day,",", time, ")"psof0 # Start of file for tool zeropsofpsof # Start of file for non-zero tool numberpinit!opcode, !coolantif tcnt = 1, stagetool = 2prognocommentn, "G40 G49 G80 G17 G21"n, "GO G91 G28 Z0."# if stagetool = 0, n, *t, "M6"protaryn, *t, "M6"if stagetool = 0, n, *next_tooln, *sg00,*sg90,*sg54,pabs, *xr, *yrn, *speed, *spdlon, prangen, "G43", tlngno, *zr, pcoolonptlchg0 # Null tool changeif opcode = 3, ptlchg0drlif prv_speed <> speed, n, speedif coolant <> prv_coolant, n, pcoolnl!opcode, !coolantptlchg # Tool change pinit!opcoden, pcooloffn,*sm05n, pinc, "G28", "Z0."if stagetool = 0, n, *t, "M6"if stagetool = 0, n, *next_tooln, "M01"commentprotaryn, *sg00,pabs,*sg54, *xr, *yrn, *speed, *spdlon, prangen, "G43", tlngno, *zr, pcoolon!coolantpeof0 # End of file for tool zeropeofpeof # End of file for non-zero tooln, pcooloffn, *sm05# n, pinc, "G30", "Z0."n, "G91 G28 Z0."n, "G91 G28 Y0."if stagetool = 0, n, *first_tool, "M6"n, "M30""%"#--------------------------------------------------------------------------# Axis motion#--------------------------------------------------------------------------prot0 # Toolplane postline - Custom post requiredprot # Toolplane postline - Custom post requiredprapid # Linear line movement - at rapid feedrateif rotaxis <> 0, protaxiselse, prapidmpzrapid # Linear movement in Z axis only - at rapid feedraten, sgcode, zplin1 # First linear movement after SOF, whatno must be set plin2 # Second linear movement after SOF, whatno must be set plin # Linear line movement - at feedrateif rotaxis <> 0, protaxiselse, plinmpz # Linear movement in Z axis only - at feedraten, sgcode, z, pfrpcir1 # First circular movement after SOF, whatno must be set pcir2 # Second circular movement after SOF, whatno must be set pcir # Circular interpolationif rotaxis <> 0, protaxiselse, pcirm#--------------------------------------------------------------------------# Drilling#--------------------------------------------------------------------------pdrill # Canned Drill Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplungeppeck # Canned Peck Drill Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungepchpbrk # Canned Chip Break Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplungeptap # Canned Tap Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *frplunge pbore1 # Canned Bore #1 Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplungepbore2 # Canned Bore #2 Cyclepdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *frplunge pmisc1 # Canned Misc #1 Cycle (User Option)pdrillpmisc2 # Canned Misc #2 Cycle (User Option)pdrillpdrill_2 # Canned Drill Cyclen, pdrlxyrot, refht, depthppeck_2 # Canned Peck Drill Cyclepdrill_2pchpbrk_2 # Canned Chip Break Cyclepdrill_2ptap_2 # Canned Tap Cyclepdrill_2pbore1_2 # Canned Bore #1 Cyclepdrill_2pbore2_2 # Canned Bore #2 Cyclepdrill_2pmisc1_2 # Canned Misc #1 Cyclepdrill_2pmisc2_2 # Canned Misc #2 Cyclepdrill_2pcanceldc # Cancel canned drill cycle!gcoden, "G80"prv_z = inithtpcancelcc # Cancel cutter comp.#n, "G40"pwrtt # Write tool table, scans entire file, null tools are negative tnote = ttoffnote = tloffnotlngnote = tlngnoif t >= 0, "(", *tnote, " ", *toffnote, " ", *tlngnote, " ", *tldia, " ",*sopnote, ")"if t >= 0, tcnt = tcnt + 1#--------------------------------------------------------------------------# Numbered questions for Mastercam -- Used by Mill 5#--------------------------------------------------------------------------38. Rapid feedrate? 10000.76. Name of associated CFG file? T400. Name of associated CFG file? T1538. Rapid feedrate (metric)? 20000.080. Communications port number for receive and transmit (1 or 2) ? 281. Data rate (110,150,300,600,1200,2400,4800,9600,14400,19200,38400)? 960082. Parity (E/O/N)? E83. Data bits (7 or 8)? 784. Stop bits (1 or 2)? 285. Strip line feeds? N86. Delay after end of line (seconds)? 087. Ascii, Eia, or Binary (A/E/B)? A88. Echo keyboard to screen in terminal emulation? n89. Strip carriage returns? N90. Drive and subdirectory for NC files?91. Name of executable post processor? MP92. Name of reverse post processor? RP93. Reverse post PST file name? RPABS100. 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? 8000107. Average time for tool change (seconds)? 1#110. Default tool library? TOOLS-MM.TL9#--------------------------------------------------------------------------# Switches to Enable OR Disable toolpath parameter screen buttons#--------------------------------------------------------------------------161. Enable Home Position button? Y162. Enable Reference Point button? y163. Enable Misc. Values button? y164. Enable Rotary Axis button? N165. Enable Tool Plane button? y166. Enable Construction Plane button? y167. Enable Tool Display button? y168. Check tplane during automatic work origin creation? y#--------------------------------------------------------------------------# Default Miscellaneous Real Values#--------------------------------------------------------------------------201. Default miscellaneous real variable 1 (mr1)? 0.0202. Default miscellaneous real variable 2 (mr2)? 0.0203. Default miscellaneous real variable 3 (mr3)? 0.0204. Default miscellaneous real variable 4 (mr4)? 0.0205. Default miscellaneous real variable 5 (mr5)? 0.0206. Default miscellaneous real variable 6 (mr6)? 0.0207. Default miscellaneous real variable 7 (mr7)? 0.0208. Default miscellaneous real variable 8 (mr8)? 0.0209. Default miscellaneous real variable 9 (mr9)? 0.0210. Default miscellaneous real variable 10 (mr10)? 0.0#--------------------------------------------------------------------------# Default Miscellaneous Real Values (METRIC)#--------------------------------------------------------------------------。

相关文档
最新文档