Mastercam后处理片段代码使用指南

Mastercam后处理片段代码使用说明。

很多时候,在下载的后处理中看到不错的功能(假设能看到相关功能的源代码),或者购买的源代码想要移植添加到自己的后处理中,这个时候,对于这部分片段代码,如何添加是最大的问题,针对这样的问题,肯能会想到想要提供者整个修改说明,其实这些都是不好操作的,首先不同的后处理,有部分后处理删除了部分代码,还有部分后处理则增加了更多其他的代码,导致不知道如何下手,针对此类问题,下面将会讲解片段代码如何增加。

Mastercam后处理基于钻孔开发测头(探针)源代码

首先了解后处理系统命令块是非常有必要的,何为系统命令块,如下图所有该类型的命令块为系统命令块(以下仅展示部分代码),


pcomment$       #Comment from manual entry (must call pcomment2)
pheader$         #Call before start of file
psof0$           #Start of file for tool zero
psof$            #Start of file for non-zero tool number
ptlchg0$         #Call from NCI null tool change (tool number repeats)
ptlchg$          #Tool change
peof0$           #End of file for tool zero
peof$            #End of file for non-zero tool
ppost$ # This posblock is call AFTER all the files from the PST run are closed!
pq$              #Setup post based on switch settings
ptoolend$        #End of tool path, before reading new tool data
ptlchg1002$      #Call at actual toolchange, end last path here
pdwl_spd$        #Call from NCI gcode 4
prapid$          #Output to NC of linear movement - rapid
pzrapid$         #Output to NC of linear movement - rapid Z only
plin$            #Output to NC of linear movement - feed
pz$              #Output to NC of linear movement - feed Z only
pmx$             #Output to NC of vector NCI
pcir$            #Output to NC of circular interpolation
pmx0$            #5 axis gcode setup
plin0$           #Linear movement, mill motion test
pcir0$           #Circular interpolation, mill arc motion test
pdrill0$         #Pre-process before drill call
pdrill$          #Canned Drill Cycle
ppeck$           #Canned Peck Drill Cycle
pchpbrk$         #Canned Chip Break Cycle
ptap$            #Canned Tap Cycle
pbore1$          #Canned Bore #1 Cycle
pbore2$          #Canned Bore #2 Cycle
pmisc1$          #Canned Fine Bore (shift) Cycle
pmisc2$          #Canned Rigid Tapping Cycle
pdrlcst$         #Custom drill cycles 8 - 19 (user option)
pdrill_2$        #Canned Drill Cycle, additional points
ppeck_2$         #Canned Peck Drill Cycle
pchpbrk_2$       #Canned Chip Break Cycle
ptap_2$          #Canned Tap Cycle
pbore1_2$        #Canned Bore #1 Cycle
pbore2_2$        #Canned Bore #2 Cycle
pmisc1_2$        #Canned Fine Bore (shift) Cycle
pmisc2_2$        #Canned Rigid Tapping Cycle
pdrlcst_2$       #Custom drill cycles 8 - 19, additional points (user option)
pcanceldc$       #Cancel canned drill cycle
psub_call_m$     #Call to main level, single tool
psub_call_mm$    #Call to main level, multiple tools
psub_st_m$       #Header in main level
psub_end_m$      #End in main level
psub_call_s$     #Call to sub level
psub_st_s$       #Header in sub leveln
psub_end_s$      #End in sub level
pmiscint$        #Capture the top level absinc for subprograms
pprep$          #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.
psynclath$      #Read NCI Axis-Combination (950) line
pwrtt$          #Pre-read NCI file
pwrttparam$     #Pre-read parameter data
pparameter$     #Read operation parameters
pmachineinfo$   #Machine information parameters postblock


以下为后处理流程:



以上代系统及的码块命令块根据功能,可以划分为:

1:预处理


pmiscint$        #Capture the top level absinc for subprograms
pprep$          #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and NCI file are opened.
psynclath$      #Read NCI Axis-Combination (950) line
pwrtt$          #Pre-read NCI file
pwrttparam$     #Pre-read parameter data
pparameter$     #Read operation parameters
pmachineinfo$   #Machine information parameters postblock



2:开始


pcomment$       #Comment from manual entry (must call pcomment2)
pheader$         #Call before start of file
psof0$           #Start of file for tool zero
psof$            #Start of file for non-zero tool number



3:中间过程


ptlchg0$         #Call from NCI null tool change (tool number repeats)
ptlchg$          #Tool change
ptoolend$        #End of tool path, before reading new tool data
ptlchg1002$      #Call at actual toolchange, end last path here
pdwl_spd$        #Call from NCI gcode 4
prapid$          #Output to NC of linear movement - rapid
pzrapid$         #Output to NC of linear movement - rapid Z only
plin$            #Output to NC of linear movement - feed
pz$              #Output to NC of linear movement - feed Z only
pmx$             #Output to NC of vector NCI
pcir$            #Output to NC of circular interpolation
pmx0$            #5 axis gcode setup
plin0$           #Linear movement, mill motion test
pcir0$           #Circular interpolation, mill arc motion test
pdrill0$         #Pre-process before drill call
pdrill$          #Canned Drill Cycle
ppeck$           #Canned Peck Drill Cycle
pchpbrk$         #Canned Chip Break Cycle
ptap$            #Canned Tap Cycle
pbore1$          #Canned Bore #1 Cycle
pbore2$          #Canned Bore #2 Cycle
pmisc1$          #Canned Fine Bore (shift) Cycle
pmisc2$          #Canned Rigid Tapping Cycle
pdrlcst$         #Custom drill cycles 8 - 19 (user option)
pdrill_2$        #Canned Drill Cycle, additional points
ppeck_2$         #Canned Peck Drill Cycle
pchpbrk_2$       #Canned Chip Break Cycle
ptap_2$          #Canned Tap Cycle
pbore1_2$        #Canned Bore #1 Cycle
pbore2_2$        #Canned Bore #2 Cycle
pmisc1_2$        #Canned Fine Bore (shift) Cycle
pmisc2_2$        #Canned Rigid Tapping Cycle
pdrlcst_2$       #Custom drill cycles 8 - 19, additional points (user option)
pcanceldc$       #Cancel canned drill cycle
psub_call_m$     #Call to main level, single tool
psub_call_mm$    #Call to main level, multiple tools
psub_st_m$       #Header in main level
psub_end_m$      #End in main level
psub_call_s$     #Call to sub level
psub_st_s$       #Header in sub leveln
psub_end_s$      #End in sub level



4:结尾


peof0$           #End of file for tool zero
peof$            #End of file for non-zero tool



5:后处理


ppost$



其次需要了解系统函数,对于高版本(X版之后)后处理,凡是函数尾带有$符号的均为系统函数。

如下为2017之后的版本系统级的函数,凡是所有大写函数及函数尾部带有@符号的函数。


N_TWO@
 N_ONE@
 ZERO@
 ONE@
 TWO@
 THREE@
 FOUR@
 FIVE@
 SIX@
 SEVEN@
 EIGHT@
 NINE@
 TEN@



针对片段代码如何添加,根据作者的经验可以遵循以下几种方式。

根据骗贷代码的功能划分:

1:涉及到刀具清单,加工范围,预读数据方面的功能代码,一般代码块调用位置大多数在pwrtt$下面完成预读,预处理工作。

2:涉及到操作开始,操作过程中,换刀,操作结束等这类功能代码主要调用位置大多在过程中。

3:凡是涉及到成立完成后还需要再次对程序进行处理的此类调用主要集中在ppost$下完成处理工作。

4:还有一些片段代码提供了主要系统代码块,这就说明在想要的命令块下增加即可,如下所示:


psof$            #Start of file for non-zero tool number
#-----------------------------------------------------------
  ptool_header
  probe_head$


Ps:

片断代码增加到后处理首先不要调用输出功能,生成一个程序,利用后处理排错的方法,看看还有哪些代码缺失或者语法错误,或者逻辑错误,根据错误提示进行排错,修正后再调用并测试其功能的完整性,这样会大大节省时间,还可以因为错误的定义导致后处理长时间卡死或者软件卡死崩溃导致重启软件。

Mastercam后处理 3+2刀尖跟随计算源代码

GIF





免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空