完整版)MasterCAM9.1的刀具清单功能_第1页
完整版)MasterCAM9.1的刀具清单功能_第2页
完整版)MasterCAM9.1的刀具清单功能_第3页
完整版)MasterCAM9.1的刀具清单功能_第4页
完整版)MasterCAM9.1的刀具清单功能_第5页
已阅读5页,还剩16页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、MasterCAM9.1 后处理自动生成刀具清单,使用方法:将下面的内容复制到记事本内,并将其更名为Mpfan.pst , pst 为后缀,再将该文件拷贝至 MasterCAM9.1 的安装目录 C:Mcam9MillPosts ,覆盖原文件,然后启动软件,可以在 NC 程序开头生成刀具清单。经典版本,绝对好用!# Post Name: MPFAN# Product: MILL# Machine Name: FANUC# Control Name: 6M# Description# Associated Post: GENERIC FANUC 6M STYLE POST# Mill/Turn:

2、 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

3、_Integers are used:# mi1 - Work coordinate system#0 = Reference return is generated and G92 with theX, 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.#

4、 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/PROGR

5、AM SWITCHES, debugging and program switches# bug1 : 1bug2 : 0bug3 : 0bug4 : 0 whatno : yesstrtool_v7 : 2 get_1004 : 1 rpd_typ_v7 : 1# 1 = Output post to screen, 2 = output leader to screen # Append postline labels, non-zero is column position?# Append whatline no. to each NC line?# Append NCI line n

6、o. to each NC line?# Do not perform whatline branches?#Use Version 7 toolname, 1= path components, 2=string #Find gcode 1004 with getnextop?#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

7、. max arcs stagetool : 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# fs10.3#Decimal, absolute, 4 placefs20.4d#Decimal, deltafs31 0#Integer, not leadingfs42 0l#Integer, tw

8、o leadingfs53 0l#Integer, three leadingfs64 0l#Integer, four leadingfs70.1#Decimal, absolute, 1 placefs80.2#Decimal, absolute, 2 placefs90.3#Decimal, absolute, 3 placefs10 0 4t#No decimal, absolute, four trailingfs11 0.4t#Decimal, absolute, four trailing# # FORMAT ASSIGNMENTS# # Axis output formats

9、- Linear# fmtX 1 x# X axis positionfmtY 1 y# Y axis positionfmtZ 1 z# Z axis positionfmtX 1 xr# X rapid position from tool changefmtY 1 yr# Y rapid position from tool changefmtZ 1 zr# Z rapid position from tool changefmtX 1 xh# X home positionfmtY 1 yh# Y home positionfmtZ 1 zh# Z home position# # A

10、xis output formats - Circular# fmt I 2 i # Arc center description in XfmtJ 2 j# Arc center description in YfmtK 2 k# Arc center description in ZfmtR 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 calc

11、ulation 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 tlo

12、ffno # Diameter Offset Nofmt H 3 tlngno# Length Offset NofmtT 1tnote# Note formatfmtD- 1toffnote# Note formatfmtH- 1tlngnote# Note formatfmtDia- 2tldia# 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

13、gear# Gear range# # Drill variable formatsMfmtG 3 drillref# Initial / Reference Toggle (G98/G99)fmtP 10 dwell# DwellfmtZ 1 initht# Initial HeightfmtR 1 refht# Reference HeightfmtZ 1 depth# DepthfmtQ 2 peck1# First peck increment (positive)fmt1 peck2# Second or last peck (positive)fmt1 peckclr# Safet

14、y distancefmt1 retr# Retract heightfmtF 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 optionqtoo

15、lopt: 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

16、 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# Dont use reference height on first non-canned Z moveomitseq: yes# Omit sequence no.omitz: no# Omit first Z movement for n

17、on-canned-cyclesprogname: 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. o

18、f 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/m

19、inldelta: 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

20、 set to 1)# # FORMULAS - global formulas# ssrange = mi3 speed = abs ( ss ) arcradm = arcradspdlsel = fsg3(ss)# Gear Range Select# Absolute spindle speed# Negative arcrad# Spindle on selector based on pos. or neg. ss# # CANNED CYCLES - select long or short code# usecandrill : yes # Use canned cycle f

21、or drill usecanpeck : yes # Use canned cycle for Peckusecanchip : yes # Use canned cycle for Chip Break usecantap : 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#

22、Use canned cycle for Misc2flktbl13# Lookup table definitions - table no. - no. entries401000# Low gear range412500# Med gear range425000# Hi gear range# # Lookup table definitions - for math functions FLOOK and FRANGE# # # Strings - String labels must start with s - they are not pre-assigned# #Selec

23、t operation notesop00NULL# String definitionsop01END-MIll# sop02END-MIll# sop03DRIll# sop04END-MIll# sop05S-MILL# sop062D-SWEPT.# sop073D-SWEPT.# sop08REVOLVED.# sop09LOFT#IIIIsop10COONS# sop11TRIM #IIIIsop12FILLET# sop13ROUGH# sop14OP14#IIIIsop15OP15#IIIIsopnote# Target stringfstrsel sop00 opcode s

24、opnote# # Select motion G codesg00 G0# Linear movement at rapid feedratesg01 G1# Linear movement at feedratesg02 G2 # Circular interpolation CW sg03 G3 # Circular interpolation CCW sgcode # Target stringfstrsel sg00 gcode sgcode# # Select incremental or absolute G code sg90 G90 # Absolute G code sg9

25、1 G91 # Incremental G codesgabsinc # Target stringfstrsel sg90 absinc sgabsinc# # Select spindle startsm04M4# Spindle reversesm05M5# Spindle offsm03M3# Spindle forwardspdlon# Target stringfstrsel sm04 spdlsel spdlon# # Cutter compensation codescc0 # Cutter compensation state not changedsg40 G40 # Ca

26、ncel cutter compensation sg41 G41 # Cutter compensation left sg42 G42 # Cutter compensation right sg140 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 pcancelccsccomp# Target stringfstrselsc

27、c0 ccomp sccomp# # Select work plane G code sg17 G17 # XY plane code sg19 G19 # XZ plane codesg18 G18 # YZ plane codesgplane# Target stringsgdrill# Target stringfstrsel sg17 plane sgplane# Work coordinate systemsg50G92# Work coordinate system G codesg51G92#IIIIIIIIIIsg52G92#IIIIIIIIIIsg53G92#IIIIIII

28、IIIsg54G54#IIIIIIIIIIsg55G55#IIIIIIIIIIsg56G56#IIIIIIIIIIsg57G57#IIIIIIIIIIsg58G58#IIIIIIIIIIsg59G59#IIIIIIIIIIsgwcs# Target stringfstrselsg50 mi1 sgwcs# # Canned drill cycle string selectsg81G81#drill- no dwellsg81dG82#drill- with dwellsg83G83#peck drill -no dwellsg83dG83#peck drill -with dwellsg73

29、G73#chip break- no dwellsg73dG73#chip break- with dwellsg84G84#tap- no dwellsg84dG74#tap- with dwell (selects left hand)sg85G85#bore #1- no dwellsg85dG89#bore #1- with dwellsg86G86#bore #2- no dwellsg86dG86#bore #2- with dwellsgm1G81#misc #1- no dwellsgm1dG82#misc #1- with dwellsgm2G81#misc #2- no d

30、wellsgm2dG82#misc #2- with dwelldrlgsel = drillcyc * 2 + fsg2 ( dwell )# 16 possible combinations:# drillcyc = 0.7# dwell = 0 or non-zero (2 states)fstrsel sg81 drlgsel sgdrill# # Generate sgear stringsgear0M*# auto gear rangesgear1M41# Low gear rangesgear2M42# Med gear rangesgear3M43# High gear ran

31、ge - 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# Initiali

32、ze Varsprv_fr = 999.999 prv_frdeg = 999.999 prv_frplunge = 999.999 linarc = 0 rotstrt = 1pabs # Absolute G code output absinc = 0 sgabsincpinc# Incremental G code outputabsinc = 1 sgabsincpcooloff # Coolant off M code output if prv_coolant 0, M09pcoolon# Coolant off M code outputif coolant = 1, M08#

33、 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

34、= 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 # G5

35、4+ 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 Co

36、mpensation if ccomp 0, pccdia2# # Axis substitution motion, user defined# pdrlxyrot # Substitute Axis X/Y with Rotary axis w/ drilling if rotaxis = 0, x, y if rotaxis = 1, y, xs if rotaxis = 2, x, yspfrd # Feedrate W/O Negative Feedrates (deg/min) if frdeg maxfrdeg, frdeg = maxfrdeg if frdelta .5, *

37、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 axis if gcode = 0, n, sgcode, y, z, *xs, pcan, e

38、 if 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,

39、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

40、= ( ( abs ( ys - prv_ys ) ) / 360 ) * circumalzdelta = sqrt ( adeltaA2 + ldeltaA2 + zdeltaA2 ) frdegcalc = fr * ( 360 / circum )if alzdelta 0, frdeg = ( adelta / alzdelta ) * frdegcalc if adelta = 0, frdeg = fr frdelta = abs ( frdeg - prv_frdeg ) if rotaxis = 1, protaxis1 if rotaxis = 2, protaxis2 i

41、f gcode = 1, rotstrt = 0 !x, !y, !zprotary # Rotary Moveif rotaxis = 1, xr = 0 #Force X to zero if rotaxis = 2, yr = 0 #Force Y to zero if rotaxis 0, linarc = 1 circum = rotdia * pi# # Axis linear/circular motion, user defined# parctyp2 # Arc output for R w/ sign over 180 degree sweep absswp = abs (

42、 sweep ) !absswpif absswp 180, *arcradmparctyp1 # Arc output for R w/ no sign*arcradparctyp0parctyp# Arc output for IJKif plane = 0, *i, *j, k if plane = 1, i, *j, *k if plane = 2, *i, j, *k# Select the arc outputif arcoutput = 0, parctyp0if arcoutput = 1, parctyp1if arcoutput = 2, parctyp2prapidm#

43、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# pdril

44、lref # 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 pr

45、v_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

46、,-,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 G21n, GO G91 G28 Z0.# if stagetool = 0, n, *t, M6protaryn, *t, M6if stagetool = 0, n, *next_tooln, *sg00,*sg90,*sg54,pabs,

47、 *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, M6if stagetool =

48、0, n, *next_tooln, M01 comment protaryn, *sg00,pabs,*sg54, *xr, *yrn, *speed, *spdlon, prangen, G43, tlngno, *zr, pcoolon !coolantpeof0# End of file for tool zero peofpeof# End of file for non-zero tool n, pcooloffn, *sm05# n, pinc, G30, Z0.n, G91 G28 Z0.n, G91 G28 Y0.if stagetool = 0, n, *first_too

49、l, 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 mo

50、vement 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 setpcir2#

51、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, *frplungeppeckpchpbrkptappbore1pbore2pmisc1pmisc2pdrill_2ppeck_2pchpbrkptap_2pbore1_pbore2_# Canned Peck Drill Cycle pdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplunge# Canned Chip Break Cycle pdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplunge# Canned Tap Cycle pdrillrefn, *drillref, *sgdrill, pdrlxyrot, *depth, *ref

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论