mastercam9.1后处理

合集下载

Mastercam9

Mastercam9

Mastercam9.1后处理优化1. 简介Mastercam9.1是一款广泛应用于数控机床加工的软件,它的后处理功能在将NC代码转化为机床控制指令时起着至关重要的作用。

本文档将介绍Mastercam9.1后处理的优化方法,帮助用户改善NC代码生成的效率和精度。

2. 后处理优化方法2.1 最佳实践- 确保正确设置机床参数:在进行后处理之前,务必检查并正确设置机床参数,包括坐标系、进给速度限制、刀具补偿等。

正确设置这些参数可以确保生成的NC代码与实际机床运行相符,并提高加工效率和质量。

- 合理利用宏指令:宏指令可以帮助用户将常用的操作组合成一个命令,并在后处理过程中自动引用。

合理利用宏指令可以简化编程流程,提高编程效率。

同时,通过编写自定义宏指令,用户还可以根据实际需求进行功能扩展。

2.2 优化后处理配置- 检查后处理配置文件:Mastercam9.1提供了一系列的后处理配置文件,用户可以选择适合自己的配置文件进行后处理。

在选择配置文件之前,建议用户仔细阅读每个配置文件的说明文档,并根据需要进行必要的修改。

- 自定义后处理配置文件:对于一些特殊需求,用户可以通过自定义后处理配置文件来满足。

通过使用Mastercam9.1提供的后处理配置编辑器,用户可以灵活地定义和修改后处理规则,以适应不同的机床和加工需求。

2.3 优化NC代码生成- 合理设置切削参数:在进行后处理之前,用户需要根据实际加工需求设置合理的切削参数,包括进给速度、切削深度、切削宽度等。

合理设置这些参数可以提高加工效率和质量,并减少对机床的磨损。

- 优化刀具路径生成:Mastercam9.1提供了多种生成刀具路径的方式,用户可以根据需要选择合适的刀具路径生成方法。

在选择刀具路径生成方法之前,用户需要考虑加工效率、加工精度和工艺要求等因素,并合理地权衡各种因素。

3. 总结本文档介绍了Mastercam9.1后处理的优化方法,包括最佳实践、后处理配置优化和NC代码生成优化。

MASTRECAM后处理

MASTRECAM后处理

⑵FANUC.PST后处理文件针对的是4轴加工中心,而目前使用量最大的是3轴加工中心,多出了第4轴数据"A0."。
⑶不带刀库的数控铣使用时要去掉刀具号、换刀指令、回参考点动作。
⑷部分控制器不接受NC文件中的注释行。
⑸删除行号使NC文件进一步缩小。
⑹调整下刀点坐标值位置,以便于在断刀时对NC文件进行修改。
修改后G21指令不再出现,某些控制器可不用此指令。注意修改时保持格式一致。G21指令为选择公制单位输入,对应的英制单位输入指令为G20。
2、增加G54指令(方法二):
单击按钮,系统弹出查找对话框,输入"force_wcs",单击按钮,查找结果所在行为:
force_wcs : no #Force WCS output at every toolchange?
pbld, n, *sgcode, pfzout, e
pbld, n, *speed, *spindle, pgear, strcantext, e
pbld, n, "G43", *tlngno, scoolant, next_to
单击按钮,系统弹出查找对话框,输入"*sg28ref",单击按钮,查找结果所在行为:
pbld, n, sgabsinc, sgcode, *sg28ref, "Z0.", scoolant, e
pbld, n, *sg28ref, "X0.", "Y0.", protretinc, e
pfcout, *speed, *spindle, pgear, strcantext, e
pbld, n, "G43", *tlngno, pfzout, scoolant, next_tool, e

Mastercam9.1后处理20141127-思图文

Mastercam9.1后处理20141127-思图文
# following functions to enable/di
# 1 = Stop = output the "M00" stop code
# 2 = Ostop = output the "M01" optional stop code
# It is designed to support the features of Mastercam Mill V8.
#
# Following Misc. Integers are used:
#
# mi1 - Work coordinate system
# 0 = Reference return is generated and G92 with the
# the position of the rotary axis. This is the default setting.
#
#3 Axis Rotary (Polar)
# Polar positioning is offered in Mastercam 3 axis toolpaths through the
# 2 = WCS of G54, G55.... based on Mastercam settings.
#
# mi2 - Absolute or Incremental positioning at top level
# 0 = absolute
# 1 = incremental
# 'multi-axis' selection (i.e. Rotary 4 axis). All 5 axis paths are

MasterCAM9.1的刀具清单功能

MasterCAM9.1的刀具清单功能
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 tools
#
#Options/Usage:
#It is recommended to start and end cutter compensation oncjlinear move.
#Rotary axis assumes a”Z” plunge at feed into part, position of the
# 1二Output post to screen, 2二output leader to screen
#Append postline labels, norvzero is column position?
#Append whatline no. to each NC line?
#Append NCI line no. to each NC line?
#1thru 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.
# Axis output formats-Linear
fmt
X 1 x
# X axis position

mastercam后处理的修改2[精品]

mastercam后处理的修改2[精品]

MasterCAM后处理的修改2MASTERCAM9。

1的后处理,要求能看到刀具半径的,经过今天一个上午的研究和查找资料终于不负众望让我修改成功,还加入了余量显示。

过程如下:修改9.1后处理的过程:1、删除第4轴数据指令“A0”用编辑软件打开MPFAN.PST文件,搜索“164. Enable Rotary Axis button? y”此行内容,将其更改为“164. Enable Rotary Axis button? n”,修改好第4轴数据将不现出现。

2、删除换刀指令和回X、Y参考点的指令(1)、搜索“if stagetool >= zero, pbld, n, *t, "M6", e”更改为“# if stagetool >= zero, pbld, n, *t, "M6", e”前面加一“#”号表示这行为注释行。

将不起作用。

(2)、搜索“pbld, n, *t, "M6", e”在前面加一“#”号(3)、删除回X、Y参考点指令搜索“pbld, n, *sg28ref, "X0.", "Y0.", protretinc, e”此行,在前面加一“#”改为注释行。

3、删除刀具补偿指令“G43”和“H1”搜索“pbld, n, "G43", *tlngno, pfzout, scoolant, next_tool, e”更改为“pbld, n, "G0", pfzout, scoolant, next_tool, e”共两处4、加入显示刀具直径和半径注释,加入编程余量显示。

搜索“fmt "TOOL - " 4 tnote # Note formatfmt " DIA. OFF. - " 4 toffnote # Note formatfmt " LEN. - " 4 tlngnote # Note formatfmt " DIA. - " 1 tldia # Note format“更改为“fmt "TOOL - " 4 tnote # Note format fmt " DIA. OFF. - " 4 toffnote # Note formatfmt " LEN. - " 4 tlngnote # Note formatfmt " D= " 1 tldia # Note formatfmt " R= " 1 tcr # Note formatfmt "XY= " 2 xy_stock # Assign an output format fmt "Z = " 2 z_stock # Assign an output format“搜索“"(", pstrtool, *tnote, *toffnote, *tlngnote,*tldia, ")", e ”更改为“ "(TOOL NAME:", pstrtool, *tnote, *toffnote, *tlngnote, *tldia, *tcr,")", e"(STOCK:",~xy_stock," ",~z_stock,")",e ”搜索“ !x, !y, !z, !cc_pos, !cutpos2 # 01/22/04#--------------------------------------------------------------------------# Numbered questions for Mastercam Mill#--------------------------------------------------------------------------38. Rapid feedrate? 300.01538. Rapid feedrate (metric)? 10000.0 ”更改为:“!x, !y, !z, !cc_pos, !cutpos2 # 01/22/04#--------------------------------------------------------------------------# XYZ Stock setting#--------------------------------------------------------------------------pparameter #Information from parameter#Capture parameter valuesif prmcode =10010, xy_stock = rpar(sparameter, 1)if prmcode =10068, z_stock = rpar(sparameter, 1)#--------------------------------------------------------------------------# Numbered questions for Mastercam Mill#--------------------------------------------------------------------------38. Rapid feedrate? 300.01538. Rapid feedrate (metric)? 10000.0 ”搜索“1500. Chook to execute from 'Misc. values' button? 1501. Insert parameter information in the ascii NCI? n 1502. Write operation information to binary file (.ops)? n 1503. Write transform operations (0=transform ops, 1=sourceops, 2=both)? 1 更改为:1500. Chook to execute from 'Misc. values' button?1501. Insert parameter information in the ascii NCI? y 1502. Write operation information to binary file (.ops)? y1503. Write transform operations (0=transform ops, 1=source ops, 2=both)? 15、加入开机前Z轴归回参考点零位指令:搜索:# if stagetool >= zero, pbld, n, *t, "M6", e在其前两行处加入pbld,n,"G91","G28", "Z0.", e如下:pbld,n,"G91","G28", "Z0.", epcan# if stagetool >= zero, pbld, n, *t, "M6", e这样工作就完成了。

Mastercam9

Mastercam9

Mastercam9.1后处理设置Mastercam9.1是一款广泛应用于机械制造行业的计算机辅助设计和制造软件。

在使用Mastercam9.1进行数控编程时,后处理设置是非常重要的一步。

本文将介绍Mastercam9.1后处理设置的步骤和注意事项。

步骤以下是设置Mastercam9.1后处理的步骤:1.打开Mastercam9.1软件,并选择需要进行后处理设置的机床类型。

2.进入后处理设置界面,选择“工具”菜单下的“后处理工具”。

3.在后处理工具界面中,选择左侧的“设置管理器”。

4.在设置管理器中,将光标定位到当前使用的后处理器上,并点击右键选择“编辑”。

5.进入后处理器编辑界面后,可以对后处理器进行各种设置。

6.首先,需要设置后处理的输出文件路径。

点击“文件”菜单下的“设置文件名”选项,设置输出文件的路径和文件名。

7.接下来,根据具体的机床和加工需求,可以进行一些其他的设置,例如刀具补偿、刀具半径补偿、进给速度等。

8.对于一些特殊的加工工艺,还可以在后处理器编辑界面中添加自定义的代码段,以满足特定的加工需求。

9.设置完所有的参数后,点击保存并关闭后处理器编辑界面。

10.返回到设置管理器界面,可以将当前设置的后处理器设为默认后处理器,以便在以后的操作中直接使用。

11.完成所有的设置后,可以关闭后处理工具界面,开始进行数控编程。

注意事项在进行Mastercam9.1后处理设置时,需要注意以下几点:1.不同机床类型所需的后处理设置可能有所不同,在选择后处理器时要根据实际的机床类型进行选择。

2.在进行后处理设置之前,要先了解机床的技术参数和加工要求,确保后处理器的设置与之相符。

3.后处理的输出文件路径要设置在合适的位置,方便后续的操作和查找。

4.在进行一些高级的设置时,要小心操作,确保设置的正确性和安全性。

5.在使用自定义代码段时,要谨慎选择和添加代码,确保其适用性和正确性。

6.建议在进行后处理设置之前先做好程序的检查和验证,以减少出错的可能性。

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

Mastercam9

Mastercam9提供有效的后处理解决方案对于Mastercam 9.1软件用户来说非常重要。

优化后处理程序可以提高CNC(数控加工)过程中的效率和精确性。

本文档将介绍一些优化Mastercam 9.1后处理的方法。

1. 后处理程序调试在使用Mastercam 9.1软件进行CNC编程时,出现后处理错误是常见的。

为了优化后处理程序,首先需要在开发或获取后处理器之前进行调试。

通过检查后处理程序的输出和与机床的预期行为进行比较,可以确定其中的错误并进行修正。

2. 定制后处理程序针对特定的机床和加工需求,定制后处理程序可以显著提高加工效率。

Mastercam 9.1软件提供了灵活的后处理定制工具,以满足不同的加工需求。

通过理解机床的特殊功能和限制,并根据具体需求进行后处理程序的修改,可以最大程度地优化后处理过程。

3. 优化刀具路径在进行CNC加工时,优化刀具路径可以节省时间和材料,并提高加工质量。

Mastercam 9.1软件提供了多种工具来优化刀具路径,例如刀具半径补偿、切割策略和连续切削等。

合理选择并配置这些工具,可以最大程度地优化后处理过程。

4. 选择合适的后处理选项在Mastercam 9.1软件中,后处理选项提供了多种控制和配置选项。

通过了解后处理选项的含义和功能,可以根据特定需求进行适当的配置。

合理选择后处理选项可以避免不必要的问题,并提高后处理的效率和准确性。

5. 及时更新软件版本Mastercam软件开发商经常发布软件更新和补丁,以修复错误和改进性能。

定期检查并安装最新的软件更新对于优化后处理过程非常重要。

这些更新通常包括后处理程序的改进和优化,可以提供更好的加工体验。

综上所述,通过调试后处理程序、定制后处理、优化刀具路径、选择合适的后处理选项和及时更新软件版本,可以最大程度地优化Mastercam 9.1后处理过程。

这些方法将提高CNC加工的效率和精确性,帮助用户获得更好的加工结果。

Mastercam9.1后处理-FANUC-数控铣

Mastercam9.1后处理-FANUC-数控铣
# Features:
# --------------------------------------------------------------------------
# This post supports Generic Fanuc code output for 3 and 4 axis milling.
# Post Name : MPFAN
# Product : MILL
# Machine Name : GENERIC FANUC
# Control Name : GENERIC FANUC
# Description : GENERIC FANUC MILL POST
# the position of the rotary axis. This is the default setting.
#
#3 Axis Rotary (Polar)
# Polar positioning is offered in Mastercam 3 axis toolpaths through the
# following functions to enable/disable.
# Cantext value:
# 1 = Stop = output the "M00" stop code
# 2 = Ostop = output the "M01" optional stop code
# CNC 07/02/01 - Add cantext to cancel drill and tool retract, jph
# CNC 01/09/02 - Initial post update for V9.0, rjm

MasterCAM9.1车床后处理MPLFAN.PST的修改方法

MasterCAM9.1车床后处理MPLFAN.PST的修改方法

A 程式是自带后处理出的,B 程式是改后的后处理出的。

本人并非专业编程人员,对编程只是知道些皮毛。

同事叫我帮忙修改一下MasterCAM9.1的后处理,因为每次都要手工修改,很麻烦,还怕出错。

在网上找了好久都找不到关于MasterCAM 车床后处理的修改方法,只好自己慢慢研究……最终还是改好了,能正常使用。

但我毕竟不是专业人氏,也不知会不会出现意外的情况,希望懂的人可以指正。

声明:此后处理适用MasterCAM 9.1,其它版本请自行研究。

如何要使用此后处理,请务必核对程式!凡使用此后处理一切后果自负!(经反馈,两段程式合并一起处理时,会出现换刀指令!如不用刀库的必须注意!)找到车床的后处理文件MPLFAN.PST (位于Mcam9\Lathe\Posts\),复制一份出来放在同目录,改好自己喜欢的名字,打开修改。

以下是修改记录。

(黄色底纹是修改过的,注意对比源文件) #去除程式中的M08、M09(冷却液开关) # *progno, e #去除程序名 # pbld, n, *smetric, e #去除G21"(-", progname,".NC", "- ", date, ")", e #程度名和日期,随意更改 #删除程式中的刀具和刀片描述 # ptoolcomment # comment#删除程式中的“G0 T0202(刀具号)”#以下两段调换顺序,可以调换“G0快速定位”和“主轴转动”的顺序。

黄色的第一段输出“快速定位和冷却开关”。

sav_absinc = absincif home_type > one, absinc = zeropcan1, pbld, n, psccomp, *sgcode, pwcs, pfxout, pyout, pfzout,pfscool, strcantext, eif lcc_cc_pos, plcc_cc_pos #Use sav_xa to position with comp. LCCpcom_movea #Update previous, pcan2ps_inc_calc #Reset currentabsinc = sav_absinc#Added for 'css_start_rpm' logic (09/05/01)if css_actv,[if css_start_rpm,prpm # Direct RPM startup for programmed CSSelse,pcssg50, pcss # NO RPM start - just output the CSS]else, # Direct RPM was programmed[prpm # Output programmed RPM]#回参考点。

Mastercam9.1 高效率常用快捷键大全

Mastercam9.1 高效率常用快捷键大全
F4 Show Analyse menu 显示分析菜单
F5 Show Delete menu 显示删除菜单
F6 Show File menu 显示文件菜单
F7 Show Modify menu 显示修改菜单
F8 Show Create menu 显示绘图菜单
Mastercam9.1 高效率常用快捷键大全
T 刀路隐藏/显示
P 关闭/开启后处理
Alt+0 Set Z depth for Cplane 设置Z的深度
Alt+1 Set main color 设置绘图颜色
Alt+4 Choose tool plane(Tplane) 选择刀具平面
Alt+R Edit last opration 编辑上次操作
Alt+S Full-time shading on/off 全时间阴影处理开/关
Alt+T In Toolpath menu,turn toolpath display on/off 刀具路径开/关
Alt+F9 Display all axes 显示所有的轴
Alt+F10 Maximize and minimize screen 屏幕最大最小化
F1 Zoom 窗选放大
F2 Unzoom 图形缩小
F3 Repaint 重绘
Alt+= Unhide select entities 不隐藏选择的图素
Alt+F1 Fit geometry to screen 图形适合屏幕
Alt+F2 Unzoom by 0.8 缩小0.8
Alt+F3 Cursor tracking on/off 光标捕捉开/关

Mastercam9

Mastercam9

Mastercam9.1后处理程序简介本文档旨在介绍Mastercam9.1后处理程序的基本概念、功能和使用方法。

通过本文档的阅读,您将能够了解如何使用Mastercam9.1的后处理程序来生成适合不同数控机床的G代码。

概念后处理程序是Mastercam9.1中的一个重要功能模块,它用于将制作出来的部件模型数据转化成适合数控机床操作的指令集,也即G代码。

后处理程序可以根据机床的不同特点和需求,为每台机床生成适配的G代码。

它在生成G代码的同时,还可根据用户的需要添加自定义信息和功能。

功能Mastercam9.1后处理程序具备以下主要功能:1.G代码生成:根据用户设定的机床类型和操作参数,Mastercam9.1后处理程序可以生成适合该机床的G代码。

用户可以在后处理器中选择合适的输出文件格式,如ISO标准的文本文件或机床专用格式。

1.G代码生成:根据用户设定的机床类型和操作参数,Mastercam9.1后处理程序可以生成适合该机床的G代码。

用户可以在后处理器中选择合适的输出文件格式,如ISO标准的文本文件或机床专用格式。

1.G代码生成:根据用户设定的机床类型和操作参数,Mastercam9.1后处理程序可以生成适合该机床的G代码。

用户可以在后处理器中选择合适的输出文件格式,如ISO标准的文本文件或机床专用格式。

2.自动优化:后处理程序会根据用户模型中的特点进行自动优化。

它会自动检测并去除不必要的冗余指令,从而提高机床工作效率。

同时,它还可以自动修正和补偿可能的误差。

2.自动优化:后处理程序会根据用户模型中的特点进行自动优化。

它会自动检测并去除不必要的冗余指令,从而提高机床工作效率。

同时,它还可以自动修正和补偿可能的误差。

2.自动优化:后处理程序会根据用户模型中的特点进行自动优化。

它会自动检测并去除不必要的冗余指令,从而提高机床工作效率。

同时,它还可以自动修正和补偿可能的误差。

3.自定义输出:除了生成标准的G代码外,后处理程序还允许用户根据特定需求进行自定义输出。

mastercam9.1后处理

mastercam9.1后处理

MasterCAM9后处理得修改MasterCAM系统缺省得后处理文件为MPFAN、PST,适用于FANUC(发那科)数控代码得控制器。

其它类型得控制器需选择对应得后处理文件。

由于实际使用需要,用缺省得后处理文件时,输出得NC文件不能直接用于加工。

原因就就是:以下内容需要回复才能瞧到⑴进行模具加工时,需从G54~G59得工件坐标系指令中指定一个,最常用得就就是G54。

部分控制器使用G92指令确定工件坐标系。

对刀时需定义工件坐标原点,原点得机械坐标值保存在CNC控制器得G54~G59指令参数中。

CNC控制器执行G54~G59指令时,调出相应得参数用于工件加工。

采用系统缺省得后处理文件时,相关参数设置正确得情况下可输出G55~G59指令,但无法实现G54指令得自动输出。

⑵FANUC、PST后处理文件针对得就就是4轴加工中心,而目前使用量最大得就就是3轴加工中心,多出了第4轴数据“A0、”。

⑶不带刀库得数控铣使用时要去掉刀具号、换刀指令、回参考点动作。

⑷部分控制器不接受NC文件中得注释行。

⑸删除行号使NC文件进一步缩小。

⑹调整下刀点坐标值位置,以便于在断刀时对NC文件进行修改。

⑺普通及啄式钻孔得循环指令在缺省后处理文件中不能输出。

使用循环指令时可大幅提高计算速度,缩小NC文件长度。

如果要实现以上全部要求,需对NC文件进行大量重复修改,易于出现差错,效率低下,因此必须对PST(后处理)文件进行修改。

修改方法如下:1、增加G54指令(方法一):采用其她后处理文件(如MP_EZ、PST)可正常输出G54指令。

由于FANUC、PST后处理文件广泛采用,这里仍以此文件为例进行所有修改。

其她后处理文件内容有所不同,修改时根据实际情况调整。

用MC9自带得编辑软件(路径:C:\Mcam9\mon\Editors\Pfe\PFE32、EXE)打开FANUC、PST文件(路径:C:\Mcam9\Mill\Posts\ MPFAN、PST)单击【edit】→【find】按钮,系统弹出查找对话框,输入“G49”。

mastercam9.1四轴半四轴定面加工后处理(1)

mastercam9.1四轴半四轴定面加工后处理(1)

# Post Name : MPFAN# Product : MILL# Machine Name : GENERIC FANUC# Control Name : GENERIC FANUC# Description : GENERIC FANUC MILL POST# 4-axis/Axis subs. : YES# 5-axis : NO# Subprograms : YES# Executable : MP v9.10## WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO# THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE.## --------------------------------------------------------------------------# Revision log:# --------------------------------------------------------------------------# Programmers Note:# CNC 01/12/01 - Initial post update for V8.1# CNC 07/02/01 - Add cantext to cancel drill and tool retract# CNC 01/09/02 - Initial post update for V9.0# CNC 01/31/02 - Set usecandrill, usecanpeck, force_wcs to YES# CNC 02/22/02 - Forces output of I,J,K arc centers (arcoutput:0)# CNC 04/12/02 - Use original position for inverse feed and 4 ax paths # CNC 05/01/02 - Set "helix_arc:2", support helix arc output in XY plane # CNC 05/07/02 - Do not update sav_rev with axis substitution# CNC 11/06/02 - Altered 'F'eedrate output format when tapping (G74/G84) # CNC 01/06/03 - moved feed assignment below pcom_moveb to address bugw/feed in 4 axis# CNC 01/17/03 - Added flags to allow reversal of axis orientations# CNC 02/04/03 - Initial post update for V9.1## --------------------------------------------------------------------------# Features:# --------------------------------------------------------------------------# This post supports Generic Fanuc code output for 3 and 4 axis milling.# It is designed to support the features of Mastercam Mill V9.## Following 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 = Reference return is generated and G92 with the# X, Y and Z home positions at each tool.# 2 = WCS of G54, G55.... based on Mastercam settings.## mi2 - Absolute or Incremental positioning at top level# 0 = absolute# 1 = incremental## mi3 - Select G28 or G30 reference point return.# 0 = G28, 1 = G30##Canned text:# Entering cantext on a contour point from within Mastercam allows the # following functions to enable/disable.# Cantext value:# 1 = Stop = output the "M00" stop code# 2 = Ostop = output the "M01" optional stop code# 3 = Bld on = turn on block delete codes in NC lines# 4 = bLd off = turn off block delete codes in NC lines##Milling toolpaths (4 axis)#Layout:# The term "Reference View" refers to the coordinate system associated# with the Top view (Alt-F9, the upper gnomon of the three displayed).# Create the part drawing with the axis of rotation about the axis# of the "Reference View" according to the setting you entered for# 'vmc' (vertical or horizontal) and 'rot_on_x' (machine relative# axis of rotation).# vmc = 1 (vertical machine) uses the top toolplane as the base machine# view.# vmc = 0 (horizontal machine) uses the front toolplane as the base machine # view.# Relative to the machine matrix -# Rotation zero position is on the Z axis for rotation on X axis.# Rotation zero position is on the Z axis for rotation on Y axis.# Rotation zero position is on the X axis for rotation on Z axis.# The machine view rotated about the selected axis as a "single axis# rotation" are the only legal views for 4 axis milling. Rotation# direction around the part is positive in the CCW direction when# viewed from the plus direction of the rotating axis. Set the variable# 'rot_ccw_pos' to indicate the signed direction. Always set the work# origin at the center of rotation.##Toolplane Positioning:# Create the Cplane and Tplane as the rotation of the machine view about# the selected axis of rotation. The toolplane is used to calculate# the position of the rotary axis. This is the default setting.##3 Axis Rotary (Polar)# Polar positioning is offered in Mastercam 3 axis toolpaths through the# rotary axis options dialog. The selected toolpath is converted to angle # and radius position. The axis of rotation is forced to zero.##Axis substitution:# Use the Rotary axis substitution by drawing the geometry flattened# from the cylinder. The rotary axis button must be active for axis# substitution information to be output to the NCI file. The radius of# the rotary diameter is added to all the Z positions at output.##Simultaneous 4 Axis (11 gcode):# Full 4 axis toolpaths can be generated from various toolpaths under the# 'multi-axis' selection (i.e. Rotary 4 axis). All 5 axis paths are# converted to 4 axis paths where only the angle about the rotation axis# is resolved.##Drill:# All drill methods are supported in the post. See Simultaneous 4 Axis.##Additional Notes:# 1) Disable 4 axis by setting the numbered question 164. to 'n'.# 2) G54 calls are generated where the work offset entry of 0 = G54,# 1 = G55, etc.# 3) Metric is applied from the NCI met_tool variable.# 4) Incremental mode calculates motion from home position at toolchanges. # The home position is used to define the last position of the tool# for all toolchanges.# 5) The variable 'absinc' is now pre-defined, set mi2 (Misc. Integer) for # the 'top level' absolute/incremental program output. Subprograms are # updated through the Mastercam dialog settings for sub-programs.# 6) Always avoid machining to the center of rotation with rotary axis!# 7) Transform subprograms are intended for use with G54.. workshifts.## END_HEADER$## --------------------------------------------------------------------------# Debugging and Factory Set Program Switches# --------------------------------------------------------------------------m_one : -1 #Define constantzero : 0 #Define constantone : 1 #Define constanttwo : 2 #Define constantthree : 3 #Define constantfour : 4 #Define constantfive : 5 #Define constantc9k : 9999 #Define constantfastmode : yes #Enable Quick Post Processing, (set to no for debug)bug1 : 2 #0=No display, 1=Generic list box, 2=Editorbug2 : 40 #Append postline labels, non-zero is column position?bug3 : 0 #Append whatline number to each NC line?bug4 : 1 #Append NCI line number to each NC line?whatno : yes #Do not perform whatline branches? (leave as yes)skp_lead_flgs : 1 #Do NOT use v9 style contour flagsget_1004 : 1 #Find gcode 1004 with getnextop?rpd_typ_v7 : 0 #Use Version 7 style contour flags/processing?strtool_v7 : 2 #Use Version 7+ toolname?tlchng_aft : 2 #Delay call to toolchange until move linecant_tlchng : 1 #Ignore cantext entry on move with tlchng_aftnewglobal : 1 #Error checking for global variablesgetnextop : 0 #Build the next variable table# --------------------------------------------------------------------------# General Output Settings# --------------------------------------------------------------------------sub_level : 1 #Enable automatic subprogram supportbreakarcs : 2 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs arcoutput : 1 #0 = IJK, 1 = R no sign, 2 = R signed neg. over 180arctype : 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 : 2 #Support helix arc output, 0=no, 1=all planes, 2=XY plane onlyarccheck : 3 #Check for small arcs, convert to linearatol : .01 #Angularity tolerance for arccheck = 2ltol : .002 #Length tolerance for arccheck = 1vtol : .0001 #System tolerancemaxfeedpm : 500 #Limit for feed in inch/minltol_m : .05 #Length tolerance for arccheck = 1, metricvtol_m : .0025 #System tolerance, metricmaxfeedpm_m : 10000 #Limit for feed in mm/minforce_wcs : yes #Force WCS output at every toolchange?spaces : 0 #Number of spaces to add between fieldsomitseq : no #Omit sequence numbers?seqmax : 9999 #Max. sequence numberstagetool : 0 #0 = Do not pre-stage tools, 1 = Stage toolsuse_gear : 0 #Output gear selection code, 0=no, 1=nomax_speed : 10000 #Maximum spindle speedmin_speed : 50 #Minimum spindle speednobrk : no #Omit breakup of x, y & z rapid movesprogname : 1 #Use uppercase for program name (sprogname)xflip : no #Reverse X axis orientation - eap 1/17/03 yflip : no #Reverse Y axis orientation - eap 1/17/03 zflip : no #Reverse Z axis orientation - eap 1/17/03# --------------------------------------------------------------------------# Rotary Axis Settings# --------------------------------------------------------------------------vmc : 1 #0 = Horizontal Machine, 1 = Vertical Millrot_on_x : 1 #Default Rotary Axis Orientation, See ques. 164.#0 = Off, 1 = About X, 2 = About Y, 3 = About Zrot_ccw_pos : 1 #Axis signed dir, 0 = CW positive, 1 = CCW positiveindex : 0 #Use index positioning, 0 = Full Rotary, 1 = Index only ctable : 5 #Degrees for each index step with indexing spindleuse_frinv : 1 #Use Inverse Time Feedrates in 4 Axis, (0 = no, 1 = yes ) maxfrdeg : 2000 #Limit for feed in deg/minmaxfrinv : 999.99#Limit for feed inverse timefrc_cinit : 1 #Force C axis reset at toolchangectol : 225 #Tolerance in deg. before rev flag changesixtol : .01 #Tolerance in deg. for index errorfrdegstp : 10 #Step limit for rotary feed in deg/min# --------------------------------------------------------------------------# Enable Canned Drill Cycle Switches# --------------------------------------------------------------------------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# --------------------------------------------------------------------------# Common User-defined Variable Initializations (not switches!)# --------------------------------------------------------------------------xia : 0 #Formated absolute value for X incremental calculations yia : 0 #Formated absolute value for Y incremental calculations zia : 0 #Formated absolute value for Z incremental calculations cia : 0 #Formated absolute value for C incremental calculationscuttype : 0 #Cut type flag#0 = Tool Plane, 1 = Axis Subs, 2 = Polar, 3 = 4/5 axisbld : 0 #Block delete activeresult : 0 #Return value for functionssav_spc : 0 #Save spacessav_gcode : 0 #Gcode savedsav_absinc : 0 #Absolute/Incremental Saved Valuesav_coolant : 0 #Coolant savedsav_frc_wcs : 0 #Force work offset flag savedtoolchng : 1 #On a toolchange flagspdir2 : 1 #Copy for safe spindle direction calculation#Drill variablesdrlgsel : -1 #Drill Select Initializedrillref : 0 #Select drill referencepeckacel : 0 #Fractional percent to reduce peck2 when usecan.. : no drlgcode : 0 #Save Gcode in drillsav_dgcode : 0 #Drill gcode saved#Subprogram variablesmr_rt_actv : 0 #Flag to indicate if G51/G68 is active#0=Off, 1=Toolchange, 2=Subprogram call/start, G68#3=Absolute start, bothrt_csav : 0 #C saved valueend_sub_mny : 0 #Many tool setting captured at transform sub end#Rotary/Index variablescsav : 0 #C saved valueprvcabs : 0 #Saved cabs from pe_inc_calc,#Used for rotary feed and direction calculationscdelta : 0 #Calculation for angle changerev : 0 #Calculation for deg/minsav_rev : 0 #Saved revolution counterindx_out : c9k #Rotation direction calculationfmt 16 indx_mc #Rotation direction calculation#Vector Constants for Rotatary Calculationsaaxisx : 1 #A axis rotation vector constantaaxisy : 0 #A axis rotation vector constantaaxisz : 0 #A axis rotation vector constantbaxisx : 0 #B axis rotation vector constantbaxisy : 1 #B axis rotation vector constantbaxisz : 0 #B axis rotation vector constantcaxisx : 0 #C axis rotation vector constantcaxisy : 0 #C axis rotation vector constantcaxisz : 1 #C axis rotation vector constant#Feedrate calculation variablesfrdelta : 0 #Calculation for deg/minfrinv : 0 #Feedrate inverse timefrdeg : 0 #Feedrate deg/min actualprvfrdeg : 0 #Feedrate deg/min actualldelta : 0 #Calculation for deg/min, linearcldelta : 0 #Calculation for deg/min, linear and rotarycircum : 0 #Calculation for deg/minipr_type : 0 #Feedrate for Rotary, 0 = UPM, 1 = DPM, 2 = Inverse# --------------------------------------------------------------------------# Format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta# --------------------------------------------------------------------------#Default english/metric position format statementsfs2 1 0.7 0.6 #Decimal, absolute, 7 place, default for initialize (:) fs2 2 0.4 0.3 #Decimal, absolute, 4/3 placefs2 3 0.4 0.3d #Decimal, delta, 4/3 place#Common format statementsfs2 4 1 0 1 0 #Integer, not leadingfs2 5 2 0 2 0l #Integer, force two leadingfs2 6 3 0 3 0l #Integer, force three leadingfs2 7 4 0 4 0l #Integer, force four leadingfs2 9 0.1 0.1 #Decimal, absolute, 1 placefs2 10 0.2 0.2 #Decimal, absolute, 2 placefs2 11 0.3 0.3 #Decimal, absolute, 3 placefs2 12 0.4 0.4 #Decimal, absolute, 4 placefs2 13 0.5 0.5 #Decimal, absolute, 5 placefs2 14 0.3 0.3d #Decimal, delta, 3 placefs2 15 0.2 0.1 #Decimal, absolute, 2/1 place (feedrate)fs2 16 1 0 1 0n #Integer, forced outputfs2 17 0.2 0.3 #Decimal, absolute, 2/3 place (tapping feedrate)# --------------------------------------------------------------------------#String and string selector definitions for NC output# --------------------------------------------------------------------------#Numbered question 164. string to detect Rotary axis y/nsq164#Address string definitionsstrm "M"strn "N"stro "O"strp "P"srad "R"srminus "R-"sblank#Cantext string definitions (spaces must be padded here)sm00 "M00"sm01 "M01"strtextnostrcantext#Transform mirror and rotate codesstrns_mir_on "G51.1" #Programmable mirror image codestrns_mir_off "G50.1" #Programmable mirror image cancel codestrns_rot_on "G68" #Coordinate System Rotationstrns_rot_off "G69" #Coordinate System Rotation Cancel# --------------------------------------------------------------------------# Error messages# --------------------------------------------------------------------------saxiswarn "WARNING-POST ROTARY AXIS ASSIGNMENT ('rot_on_x') OVERWRITTEN BY OPERATION"saxisoff "ERROR-POST ROTARY AXIS ASSIGNMENT ('rot_on_x') IS DISABLED"saxiserror "ERROR-INVALID ROTARY AXIS ASSIGNMENT ('rot_on_x') FOR CURRENT OPERATION"sindxerror "WARNING-INDEX ANGLE DOES NOT MATCH POST SETTING ('ctable')"stlorgerr "ERROR-TOOL ORIGIN DOES NOT MATCH CENTER OF ROTATION IN POLAR MILLING"shomeserror "ERROR-G92 WORK OFFSET ('mi1') DOES NOT SUPPORT TRANSFORM SUBPROGRAM"sprgnerror "ERROR-SUBPROGRAM NUMBER MATCHES THE MAIN PROGRAM NUMBER"# --------------------------------------------------------------------------# General G and M Code String select tables# --------------------------------------------------------------------------# Motion G code selectionsg00 G0 #Rapidsg01 G1 #Linear feedsg02 G2 #Circular interpolation CWsg03 G3 #Circular interpolation CCWsg04 G4 #Dwellsgcode #Target for stringfstrsel sg00 gcode sgcode# --------------------------------------------------------------------------# Select work plane G codesg17 G17 #XY plane codesg19 G19 #YZ plane codesg18 G18 #XZ plane codesgplane #Target stringfstrsel sg17 plane sgplane# --------------------------------------------------------------------------#Select english/metric codesg20 G20 #Inch codesg21 G21 #Metric codesmetric #Target stringfstrsel sg20 met_tool smetric# --------------------------------------------------------------------------#Select reference return codesg28 G28 #First reference point returnsg30 G30 #Second reference point returnsg28ref #Target stringfstrsel sg28 mi3 sg28ref# --------------------------------------------------------------------------# Cutter compensation G code selectionscc0 G40 #Cancel cutter compensationscc1 G41 #Cutter compensation leftscc2 G42 #Cutter compensation rightsccomp #Target for stringfstrsel scc0 cc_pos sccomp# --------------------------------------------------------------------------# 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 - right handsg84d G74 #tap - left handsg85 G85 #bore #1 - no dwellsg85d G89 #bore #1 - with dwellsg86 G86 #bore #2 - no dwellsg86d G86 #bore #2 - with dwellsgm1 G76 #misc #1 - no dwellsgm1d G76 #misc #1 - with dwellsgm2 G81 #misc #2 - no dwellsgm2d G82 #misc #2 - with dwellsgdrill #Target for stringfstrsel sg81 drlgsel sgdrill# --------------------------------------------------------------------------# Select incremental or absolute G codesg90 G90 #Absolute codesg91 G91 #Incremental codesgabsinc #Target stringfstrsel sg90 absinc sgabsinc# --------------------------------------------------------------------------# Feed mode G code selectionsg94 G94 #UPMsg94d G94 #DPM, See pfcalc_deg if you use another gcodesg93 G93 #Inversesgfeed #Target for stringfstrsel sg94 ipr_type sgfeed# --------------------------------------------------------------------------#Canned drill cycle reference heightsg98 G98 #Reference at inithtsg99 G99 #Reference at refhtsgdrlref #Target for stringfstrsel sg98 drillref sgdrlref # Drill cycle G string select# --------------------------------------------------------------------------# Generate string for spindlesm04 M4 #Spindle reversesm05 M5 #Spindle offsm03 M3 #Spindle forwardspindle #Target for stringfstrsel sm04 spdir2 spindle# --------------------------------------------------------------------------# Coolant M code selectionsm09 M9 #Coolant Offsm08 M8 #Coolant Floodsm08_1 M8 #Coolant Mistsm08_2 M8 #Coolant Toolscoolant #Target for stringfstrsel sm09 coolant scoolant# --------------------------------------------------------------------------# Table rotation direction# Table rotation direction, indexsindx_cw M22 #Rotate CW codesindx_ccw M21 #Rotate CCW codesindx_mc #Target for stringfstrsel sindx_cw indx_mc sindx_mc# --------------------------------------------------------------------------# Define the gear selection codeflktbl 1 3 #Lookup table definition - table no. - no. entries40 0 #Low gear range41 400 #Med gear range42 2250 #Hi gear range# --------------------------------------------------------------------------# Toolchange / NC output Variable Formats# --------------------------------------------------------------------------fmt T 4 t #Tool Numberfmt T 4 first_tool #First Tool Usedfmt T 4 next_tool #Next Tool Usedfmt D 4 tloffno #Diameter Offset Numberfmt H 4 tlngno #Length Offset Numberfmt G 4 g_wcs #WCS G addressfmt P 4 p_wcs #WCS P addressfmt S 4 speed #Spindle Speedfmt M 4 gear #Gear range# --------------------------------------------------------------------------fmt N 4 n #Sequence numberfmt X 2 xabs #X position outputfmt Y 2 yabs #Y position outputfmt Z 2 zabs #Z position outputfmt X 3 xinc #X position outputfmt Y 3 yinc #Y position outputfmt Z 3 zinc #Z position outputfmt C 11 cabs #C axis positionfmt C 14 cinc #C axis positionfmt C 4 indx_out #Index positionfmt R 14 rt_cinc #C axis position, G68fmt I 3 i #Arc center description in Xfmt J 3 j #Arc center description in Yfmt K 3 k #Arc center description in Zfmt R 2 arcrad #Arc Radiusfmt F 15 feed #Feedratefmt P 11 dwell #Dwellfmt M 5 cantext #Canned text# --------------------------------------------------------------------------#Move comment (pound) to output colon with program numbersfmt O 7 progno #Program number#fmt ":" 7 progno #Program numberfmt O 7 main_prg_no #Program number#fmt ":" 7 main_prg_no #Program numberfmt O 7 sub_prg_no #Program number#fmt ":" 7 sub_prg_no #Program numberfmt X 2 sub_trnsx #Rotation pointfmt Y 2 sub_trnsy #Rotation pointfmt Z 2 sub_trnsz #Rotation point# --------------------------------------------------------------------------fmt Q 2 peck1 #First peck increment (positive)fmt Q 2 shftdrl #Fine bore tool shiftfmt R 2 refht_a #Reference heightfmt R 2 refht_i #Reference height# --------------------------------------------------------------------------fmt "TOOL - " 4 tnote # Note formatfmt " DIA. OFF. - " 4 toffnote # Note formatfmt " LEN. - " 4 tlngnote # Note formatfmt " DIA. - " 1 tldia # Note format# --------------------------------------------------------------------------# Tool Comment / Manual Entry Section# --------------------------------------------------------------------------ptoolcomment #Comment for tooltnote = ttoffnote = tloffnotlngnote = tlngno"(", pstrtool, *tnote, *toffnote, *tlngnote, *tldia, ")", epstrtool #Comment for toolif strtool <> sblank,[strtool = ucase(strtool)*strtool, " "]pcomment #Comment from manual entry (must call pcomment2 if booleans) pcomment2pcomment2 #Comment from manual entryscomm = ucase (scomm)if gcode = 1007, "(", scomm, ")"else, "(", scomm, ")", e# --------------------------------------------------------------------------# Start of File and Toolchange Setup# --------------------------------------------------------------------------psof0 #Start of file for tool zeropsofpsof #Start of file for non-zero tool numberpcuttypetoolchng = oneif ntools = one,[#skip single tool outputs, stagetool must be onstagetool = m_one!next_tool]"%", e*progno, e"(PROGRAM NAME - ", sprogname, ")", e"(DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, ")", epbld, n, *smetric, epbld, n, *sgcode, *sgplane, "G40", "G49", "G80", *sgabsinc, epbld, n, "M11A90.02", epbld, n, "M10", epbld, n, "M51", esav_absinc = absincif mi1 <= one, #Work coordinate system[absinc = onepfbld, n, sgabsinc, *sg28ref, "Z0.", epfbld, n, *sg28ref, "X0.", "Y0.", epfbld, n, "G92", *xh, *yh, *zh, eabsinc = sav_absinc]pcom_movebc_mmlt #Multiple tool subprogram callptoolcommentcommentpcanif stagetool >= zero, pbld, n, *t, "M6", epindexif mi1 > one, absinc = zeropcan1, pbld, n, *sgcode, *sgabsinc, pwcs, pfxout, pfyout,*speed, *spindle, pgear, strcantext, epbld, n, "G43", *tlngno, pfzout,epbld, n, "M51",epbld, n, "G0",pfcout, epbld, n, "M50",epbld, n, scoolant, next_tool, eabsinc = sav_absincpcom_moveatoolchng = zeroc_msng #Single tool subprogram callptlchg0 #Call from NCI null tool change (tool number repeats) pcuttypepcom_movebc_mmlt #Multiple tool subprogram callcommentpcanresult = newfs(15, feed) #Reset the output format for 'feed'pbld, n, sgplane, epspindchngpbld, n, scoolant, eif mi1 > one & workofs <> prv_workofs,[sav_absinc = absincabsinc = zeropbld, n, sgabsinc, pwcs, pfxout, pfyout, pfzout, epbld, n, "M51", epbld, n, "G0", pfcout, epbld, n, "M50", epe_inc_calcps_inc_calcabsinc = sav_absinc]if cuttype = zero, ppos_cax_linif gcode = one, plinoutelse, prapidoutpcom_moveac_msng #Single tool subprogram callptlchg #Tool changepcuttypetoolchng = oneif mi1 = one, #Work coordinate system[pfbld, n, *sg28ref, "X0.", "Y0.", epfbld, n, "G92", *xh, *yh, *zh, e]pbld, n, "M01", epcom_movebc_mmlt #Multiple tool subprogram callptoolcommentcommentpcanresult = newfs(15, feed) #Reset the output format for 'feed'pbld, n, *t, "M6", epindexsav_absinc = absincif mi1 > one, absinc = zeropcan1, pbld, n, *sgcode, *sgabsinc, pwcs, pfxout, pfyout,*speed, *spindle, pgear, strcantext, epbld, n, "G43", *tlngno, pfzout, scoolant, next_tool, epbld, n, "M51", epbld, n, "G0", pfcout, epbld, n, "M50", eabsinc = sav_absincpcom_moveatoolchng = zeroc_msng #Single tool subprogram callpretract #End of tool path, toolchangesav_absinc = absincabsinc = onesav_coolant = coolantcoolant = zero#cc_pos is reset in the toolchange herecc_pos = zerogcode = zeropcanpbld, n, sccomp, *sm05, psub_end_mny, epcan1, pbld, n, sgabsinc, sgcode, *sg28ref, "Z0.", scoolant, strcantext, e pbld, n, *sg28ref, "X0.", "Y0.", protretinc, epcan2absinc = sav_absinccoolant = sav_coolantprotretinc #Reset the C axis revolution counterif frc_cinit & rot_on_x,[rev = zerosav_rev = zerocabs = zerocsav = zeroindx_out = zeroif index, e, pindxcalc, pindexelse, *cabsprvcabs = zero!csav, !cabs]peof0 #End of file for tool zeropeofpeof #End of file for non-zero toolpretractcomment#Remove pound character to output first tool with staged tools #if stagetool = one, pbld, n, *first_tool, en, "M30", emergesubclearsubmergeauxclearaux"%", epwcs #G54+ coordinate setting at toolchangeif mi1 > one,[sav_frc_wcs = force_wcsif sub_level, force_wcs = zeroif workofs <> prv_workofs | (force_wcs & toolchng),[if workofs < 6,[g_wcs = 0 + 54*g_wcs]else,[p_wcs = 0"G54", *p_wcs]]force_wcs = sav_frc_wcs!workofs]pgear #Find spindle gear from lookup tableif use_gear = one,[gear = frange (one, speed)*gear]#Toolchange setuppspindchng #Spindle speed changeif prv_spdir2 <> spdir2 & prv_speed <> zero, pbld, n, *sm05, e if prv_speed <> speed | prv_spdir2 <> spdir2,[if speed, pbld, n, *speed, *spindle, pgear, e]!speed, !spdir2pspindle #Spindle speed calculations for RPMspeed = abs(ss)if maxss = zero | maxss > max_speed, maxss = max_speed#zero indicates spindle off (not a mistake)if speed,[if speed > max_speed, speed = maxssif speed < min_speed, speed = min_speed]spdir2 = fsg3(spdir)pq #Setup post based on switch settingsif stagetool = one, bldnxtool = one#Rotaxtyp = 1 sets initial matrix to top#Rotaxtyp = -2 sets initial matrix to frontif vmc, rotaxtyp = oneelse, rotaxtyp = -2#Shut off rotary axis if, Q164. Enable Rotary Axis button? n if ucase(sq164) = strn, rot_on_x = zeroif arctype = one | arctype = four,[result = newfs(two, i)result = newfs(two, j)result = newfs(two, k)]else,[result = newfs(three, i)。

Mastercam后处理如何去掉顺序号N

Mastercam后处理如何去掉顺序号N

Mastercam后处理如何去掉程序里的顺序号N?今天给大家讲解如果去掉程序段前面的顺序号N,其实这个顺序号N 主要是用来标记顺序的,方便大家在调试程序的时候记忆程序段的位置,也有一些加工指令比如车床G71~G73指令需要用到顺序号N来标记精加工路径范围。

对于数控铣床或者加工中心来说,有很多人用不到这个顺序号,同时对于一些复杂的3D刀路,过多的顺序号会使程序容量过大,增加数控系统处理时间,删除顺序号可以起到简化程序的目的。

好了,闲话少说,下面主要针对V9.1版本和X版本及其以上版本为例讲解下具体操作步骤。

V9.1版本:V9.1版本删除顺序号功能需要直接在后处理中修改,首先需要找到后处理。

以MILL铣床模块为例,先找到软件安装目录,然后找到Mill 文件夹里面的Posts文件夹,这个文件夹里就是保存铣床后处理的文件夹了。

Mpfan.pst这个文件就是默认的铣床后处理文件,双击这个文件,用记事本打开,然后搜索“omitseq”,找到下面的语句:将此语句中的“no”改为“yes”,然后保存。

再生成程序的时候就不会有顺序号N了。

X版本及其以上版本的Mastercam软件,删除顺序号功能不在后处理中修改,而是去“控制定义管理”中修改,这里以X9版本为例介绍。

首先在“机床类型”选项中选择自己要使用的机床类型,然后点击“设置”——“机床定义管理”,如下图弹出下面的对话框,然后点对勾“√”确认:弹出下面对话框后,点击“编辑控制定义”:弹出下面对话框后,按图示的步骤,在步骤2中取消“输出行号”前面的勾选,然后点击对勾“√”确认。

然后再生成刀路时便没有顺序号N了。

以上就是本文的全部了,还有不明白的地方的话可以关注百度文库:梅山专业机械店铺。

mastercam9.1后处理

mastercam9.1后处理

MasterCAM9后处理的修改MasterCAM系统缺省的后处理文件为MPFAN.PST,适用于FANUC(发那科)数控代码的控制器。

其它类型的控制器需选择对应的后处理文件。

由于实际使用需要,用缺省的后处理文件时,输出的NC文件不能直接用于加工。

原因是:以下内容需要回复才能看到⑴进行模具加工时,需从G54~G59的工件坐标系指令中指定一个,最常用的是G54。

部分控制器使用G92指令确定工件坐标系。

对刀时需定义工件坐标原点,原点的机械坐标值保存在CNC控制器的G54~G59指令参数中。

CNC控制器执行G54~G59指令时,调出相应的参数用于工件加工。

采用系统缺省的后处理文件时,相关参数设置正确的情况下可输出G55~G59指令,但无法实现G54指令的自动输出。

⑵FANUC.PST后处理文件针对的是4轴加工中心,而目前使用量最大的是3轴加工中心,多出了第4轴数据“A0.”。

⑶不带刀库的数控铣使用时要去掉刀具号、换刀指令、回参考点动作。

⑷部分控制器不接受NC文件中的注释行。

⑸删除行号使NC文件进一步缩小。

⑹调整下刀点坐标值位置,以便于在断刀时对NC文件进行修改。

⑺普通及啄式钻孔的循环指令在缺省后处理文件中不能输出。

使用循环指令时可大幅提高计算速度,缩小NC文件长度。

如果要实现以上全部要求,需对NC文件进行大量重复修改,易于出现差错,效率低下,因此必须对PST(后处理)文件进行修改。

修改方法如下:1、增加G54指令(方法一):采用其他后处理文件(如MP_EZ.PST)可正常输出G54指令。

由于FANUC.PST后处理文件广泛采用,这里仍以此文件为例进行所有修改。

其他后处理文件内容有所不同,修改时根据实际情况调整。

用MC9自带的编辑软件(路径:C:\Mcam9\Common\Editors\Pfe\ PFE32.EXE)打开FANUC.PST文件(路径:C:\Mcam9\Mill\Posts\ MPFAN.PST)单击【edit】→【find】按钮,系统弹出查找对话框,输入“G49”。

基于MasterCAM9.1后处理器的二次开发

基于MasterCAM9.1后处理器的二次开发

基于MasterCAM9.1后处理器的二次开发
叶金虎
【期刊名称】《《CAD/CAM与制造业信息化》》
【年(卷),期】2010(000)007
【摘要】作者在MasterCAM9.1默认的后置处理程序的基础上,开发
TKND100M数控系统专用的后处理器KND100M。

PST。

实践证明,经此后处理器转换后的NC程序可不加修改直接用于KND100M立式数控铣床进行加工。

【总页数】2页(P78-79)
【作者】叶金虎
【作者单位】罗定职业技术学院
【正文语种】中文
【相关文献】
1.基于SINUMERIK802D的MasterCAM后置处理器二次开发 [J], 王宏莲;魏昕;周华;梁东屹
2.基于嵌入式微处理器EP9315的二次开发技术 [J], 刘明贵;张艺凡;张艺夕
3.基于MasterCAM9.1的VM-32SA立式加工中心后置处理优化设计与实现研究[J], 叶选林
4.基于XScale PXA270处理器平台Windows CE
5.0系统的BSP二次开发 [J], 何剑锋;李祥;何月顺
5.基于MasterCAM9.1的曲面加工编程实例 [J], 蔡红军;谢敏婵
因版权原因,仅展示原文概要,查看原文内容请购买。

MasterCAM9.1车床后处理MPLFAN.PST的修改方法

MasterCAM9.1车床后处理MPLFAN.PST的修改方法

MasterCAM9.1车床后处理MPLFAN.PST的修改方法A 程式是自带后处理出的,B 程式是改后的后处理出的。

本人并非专业编程人员,对编程只是知道些皮毛。

同事叫我帮忙修改一下MasterCAM9.1的后处理,因为每次都要手工修改,很麻烦,还怕出错。

在网上找了好久都找不到关于MasterCAM 车床后处理的修改方法,只好自己慢慢研究……最终还是改好了,能正常使用。

但我毕竟不是专业人氏,也不知会不会出现意外的情况,希望懂的人可以指正。

声明:此后处理适用MasterCAM 9.1,其它版本请自行研究。

如何要使用此后处理,请务必核对程式!凡使用此后处理一切后果自负!(经反馈,两段程式合并一起处理时,会出现换刀指令!如不用刀库的必须注意!)找到车床的后处理文件MPLFAN.PST (位于Mcam9\Lathe\Posts\),复制一份出来放在同目录,改好自己喜欢的名字,打开修改。

以下是修改记录。

(黄色底纹是修改过的,注意对比源文件) #去除程式中的M08、M09(冷却液开关)# *progno, e #去除程序名 # pbld, n, *smetric, e #去除G21"(-", progname,".NC", "- ", date, ")", e #程度名和日期,随意更改 #删除程式中的刀具和刀片描述 # ptoolcomment # comment #删除程式中的“G0 T0202(刀具号)”#以下两段调换顺序,可以调换“G0快速定位”和“主轴转动”的顺序。

黄色的第一段输出“快速定位和冷却开关”。

sav_absinc = absincif home_type > one, absinc = zeropcan1, pbld, n, psccomp, *sgcode, pwcs, pfxout, pyout, pfzout,pfscool, strcantext, eif lcc_cc_pos, plcc_cc_pos #Use sav_xa to position with comp. LCCpcom_movea #Update previous, pcan2ps_inc_calc #Reset currentabsinc = sav_absinc#Added for 'css_start_rpm' logic (09/05/01)if css_actv,[if css_start_rpm,prpm # Direct RPM startup for programmed CSSelse,pcssg50, pcss # NO RPM start - just output the CSS]else, # Direct RPM was programmed[prpm # Output programmed RPM]#回参考点。

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

MasterCAM9 后处理的修改MasterCAM 系统缺省的后处理文件为 MPFAN.PST ,适用于 FANUC(发那科)数控代码的控制器。

其它类型的控制器需选择对应的后处理文件。

由于实际使用需要,用缺省的后处理文件时,输出的 NC 文件不能直接用于加工。

原因是:以下内容需要回复才能看到⑴进行模具加工时,需从 G54 ~G59 的工件坐标系指令中指定一个,最常用的是G54。

部分控制器使用G92 指令确定工件坐标系。

对刀时需定义工件坐标原点,原点的机械坐标值保存在 CNC 控制器的 G54~G59 指令参数中。

CNC 控制器执行 G54~G59 指令时,调出相应的参数用于工件加工。

采用系统缺省的后处理文件时,相关参数设置正确的情况下可输出 G55~G59指令,但无法实现 G54指令的自动输出。

⑵FANUC.PST 后处理文件针对的是 4 轴加工中心,而目前使用量最大的是 3 轴加工中心,多出了第 4 轴数据“A0.”。

⑶不带刀库的数控铣使用时要去掉刀具号、换刀指令、回参考点动作。

⑷部分控制器不接受 NC 文件中的注释行。

⑸删除行号使 NC 文件进一步缩小。

⑹调整下刀点坐标值位置,以便于在断刀时对 NC 文件进行修改。

⑺普通及啄式钻孔的循环指令在缺省后处理文件中不能输出。

使用循环指令时可大幅提高计算速度,缩小NC文件长度。

如果要实现以上全部要求,需对 NC 文件进行大量重复修改,易于出现差错,效率低下,因此必须对 PST(后处理)文件进行修改。

修改方法如下:1、增加 G54 指令(方法一):采用其他后处理文件(如 MP_EZ.PST )可正常输出 G54 指令。

由于 FANUC.PST 后处理文件广泛采用,这里仍以此文件为例进行所有修改。

其他后处理文件内容有所不同,修改时根据实际情况调整。

用 MC9 自带的编辑软件(路径:C:\Mcam9\Common\Editors\Pfe\ PFE32.EXE )打开 FANUC.PST 文件(路径:C:\Mcam9\Mill\Posts\ MPFAN.PST)单击【 edit】→【 find 】按钮,系统弹出查找对话框,输入“ G49 ”。

查找结果所在行为:pbld, n, *sgcode, *sgplane, "G40", "G49", "G80", *sgabsinc, e插入 G54 指令到当前行,将其修改为:pbld, n, *sgcode, *sgplane, "G40", "G49", "G80", *sgabsinc, "G54" , e 输出的 NC 文件修改前对应位置指令为: N102G0G17G40G49G80G90修改后变为:N102G0G17G40G49G80G90G54 查找当前行的上一行: pbld, n, *smetric, e 将其整行删除,或加上“#”成为注释行:# pbld, n, *smetric, e修改后 G21 指令不再出现,某些控制器可不用此指令。

注意修改时保持格式一致。

G21 指令为选择公制单位输入,对应的英制单位输入指令为 G20。

2、增加 G54 指令(方法二):单击按钮,系统弹出查找对话框,输入“ force_wcs ”,单击按钮,查找结果所在行为:force_wcs : no #Force WCS output at every toolchange?将 no 改为 yes ,修改结果为:force_wcs : yes #Force WCS output at every toolchange?输出的 NC 文件修改前对应位置指令为:N106G0G90X16.Y-14.5A0.S2200M3修改后变为:N106G0G90G54X16.Y-14.5A0.S2200M3前一方法为强制输出固定指令代码,如需使用 G55 ~ G59 指令时,有所不便。

多刀路同时输出时,只在整个程序中出现一次 G54 指令。

后一方法同其他后处理文件产生 G54 指令的原理相同,多刀路同时输出时,每次换刀都会出现 G54 指令,也可根据参数自动转换成 G55~G59 指令。

输出三轴加工中心程序的 FANUC 后处理文件为 MP_EZ.PST,输出 4 轴加工中心程序的三菱控制器后处理文件为 MP520AM.PST。

3、删除第四轴数据“A0. ”,以适应三轴加工中心:单击按钮,系统弹出查找对话框,输入“Rotary Axis”,单击按钮,查找结果所在行为:164. Enable Rotary Axis button? y将其修改为:164. Enable Rotary Axis button? n修改后第四轴数据不再出现。

4、删除刀具号、换刀指令、回参考点指令,适应无刀库的数控铣机床:单击按钮,系统弹出查找对话框,输入“ M6 ”,单击按钮,查找结果所在行为:if stagetool >= zero, pbld, n, *t, "M6", e将其修改为:if stagetool >= zero, e # pbld, n, *t, "M6",另一个换刀的位置所在行为:pbld, n, *t, "M6", e将其删除或改为注释行:# pbld, n, *t, "M6", e修改后换刀指令行不再出现,通常修改第一个出现“ M6 ”指令的位置即可。

单击按钮,系统弹出查找对话框,输入“ *sg28ref ”,单击按钮,查找结果所在行为:pbld, n, sgabsinc, sgcode, *sg28ref, "Z0.", scoolant, epbld, n, *sg28ref, "X0.", "Y0.", protretinc, e将其修改为:pbld, n, scoolant, e# pbld, n, *sg28ref, "X0.", "Y0.", protretinc, e输出的 NC 文件修改前对应位置指令为:N116G91G28Z0.M9修改后变为:N116M9PST 文件中另有两个类似位置,如使用 G92 指令确定工件坐标,可对其适当修改。

加工结束后,机床各轴不回参考点,便于手动换刀时节省时间。

5、删除 NC 文件的程序名、注释行:单击按钮,系统弹出查找对话框,输入“ % ”,单击按钮,查找结果所在行为:"%", e*progno, e"(PROGRAM NAME - ", progname, ")", e"(DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, ")", e 将其删除或改为注释行:"%", e# *progno, e# "(PROGRAM NAME - ", progname, ")", e# "(DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, ")",输出的 NC 文件修改前对应位置指令为:O0010( PROGRAM NAME - A2)(DATE=DD-MM-YY - 25-12-04 TIME=HH:MM - 10:45) 修改后以上指令行不再出现。

单击按钮,系统弹出查找对话框,输入“ pstrtool ”,单击按钮,查找结果所在行为:"(", pstrtool, *tnote, *toffnote, *tlngnote, *tldia, ")", e 将其删除或改为注释行:#"(", pstrtool, *tnote, *toffnote, *tlngnote, *tldia, ")", e 输出的 NC 文件修改前对应位置指令为:( D16R8.0 TOOL - 2 DIA. OFF. - 0 LEN. - 0 DIA. - 16. ) 修改后以上指令行不再出现。

此注释行指明当前刀路所使用的刀具参数,可用于加工前核对加工单,建议保留。

法兰克及三菱控制器可以接受注释内容。

6、取消行号:单击按钮,系统弹出查找对话框,输入“ omitseq ”,单击按钮,查找结果所在行为:omitseq : no #Omit sequence no.将其修改为:omitseq : yes #Omit sequence no. 修改后行号不再出现。

7、调整下刀点坐标值位置:单击按钮,系统弹出查找对话框,输入“ g43 ”,单击按钮,查找结果所在行为: pcan1, pbld, n, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,*speed, *spindle, pgear, strcantext, e pbld, n, "G43", *tlngno, pfzout, scoolant, next_tool, e 将其修改为:pcan1, pbld, n, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout, e pbld, n, *sgcode, pfzout, epbld, n, *speed, *spindle, pgear, strcantext, epbld, n, "G43", *tlngno, scoolant, next_tool, e 输出的 NC 文件修改前对应位置指令为:G0G90G54X16.Y-14.5S2200M3G43H0Z20.M8 修改后变为:G0G90G54X16.Y-14.5G0Z20.S2200M3G43H0M8新的指令顺序使下刀点(安全高度)x 、y 、z 坐标值同其他指令分开,易于在断刀时修改。

G43 指令在 PST 文件中有两个位置,如仅使用 G54指令时,修改第一个出现“G43”的位置即可。

8、输出普通及啄式钻孔循环指令:单击按钮,系统弹出查找对话框,输入“ usecandrill ”,单击按钮,查找结果相关行为:usecandrill : no #Use canned cycle for drillusecanpeck : no #Use canned cycle for Peck 将其修改为:usecandrill : yes #Use canned cycle for drill usecanpeck : yes #Use canned cycle for Peck 此修改适用于支持 G81、G83 钻孔循环指令的控制器。

相关文档
最新文档