




免费预览已结束,剩余5页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
_POST BUILDER CUSTOM COMMANDSIn this NX A to Z article, we are going to talk about writing custom commands in Post Builder. Custom commands allow you toget just about whatever you want in your machine code file. We all know that the graphical tools within Post Builder provide a great way to configure the standard components of a postprocessor, but what about the non-standard stuff that is what custom commands are for. For an introduction to Post Builder, clickhere.TCLPostprocessors written for NX are written in a language called TCL (Tool Command Language). TCL is a scripting language, meaning that it is not compiled, and its syntax resembles C. TCL is a fairly straightforward language; however, its syntax can be troublesome. The link below is a very good resource for learning TCL; however, the best method for writing TCL is to copy it from an existing custom command that implements the same function you are trying to implement and then change the variables and expressions as required. For example, if you are trying to write and ifelse loop, just find one in an existing custom command and change it as required to suit your desired functionality. This will help to eliminate a lot of the headaches due to syntax errors./doc/tcl/index.htmlManufacturing Output Manager (MOM)Before you write custom commands, you first need to understand how NX communicates with your postprocessor. When you postprocess a program from with NX, NX starts a program called NX Post. The primary component of NX Post is theManufacturing Output Manager (MOM). MOM is described in the NX Help Documentation as follows:The Manufacturing Output Manager (MOM) is the central core of the NX Post postprocessor module. MOM converts tool paths from model files into manufacturing output (machine code) by adding the required functions and data as described below: The Event Generator reads through the tool path data, extracts events and their associated variable information, then passes the events to MOM for processing. MOM applies kinematics to the output then passes the event with its associated data to the Event Handler. The Event Handler creates the event, processes it to determine the actions required, then returns the data to MOM. MOM reads the Definition File to determine how to format the output for the machine tool control. MOM writes the formatted output to the specified Output File as machine code.So, essentially, MOM reads the tool path in NX and then feeds the tool path through the postprocessor to generate the machine code.In order to write custom commands, you have to intercept the information that MOM is sending to the postprocessor and then manipulate it however you want and then send it to the machine code file.All of the information that MOM sends is in the form of MOM variables; furthermore, there are built-in commands available for you to use in your custom command and these are called MOM commands. You can see all of these variables and built-in commands and their descriptions by clicking on theUtilitiesmenu in Post Builder and selectBrowse MOM Variables. You will see the window shown below.The built-in commands start with an uppercaseMOMand the variables with lowercasemom. There are way too many built-in commands and variables to go through them. The approach that we will use is to set out to do something specific with our postprocessor and then used the MOM Variables browser to find the variables and built-in commands we need.So the next step is to open our postprocessor and select theCustom Commandstab as shown below.This is a postprocessor that comes with NX for a 5-axis table table mill. Most of the custom commands that you see in the list are created by default when you create a new postprocessor. Some are used by default in certain parts of the program and the rest are available should you need them.For example, the custom command shown below,PB_CMD_tool_change_force_addressesis put into the tool change event by default when a new post is created. It uses theMOM_forcebuilt-in command to force the output of the tool length compensation data.Custom commands likePB_CMD_clamp_fourth_axisare driven by machine control events inNXand do not appear in any tool path events. Custom commands likePB_CMD_nurbs_initializeare not used by default and must be placed in an event marker after the post has been created if theyare to be used.There is also a library of custom commands available to be imported into a postprocessor. If you clickImportyou will see the list shown below.There a lot of custom commands available and they are described in the Documentation underManufacturing-Post Builder-Program and Tool Path-Custom Command-Custom Command Library.So enough about all the custom commands that are already done, lets write one of our own. It is just a simple custom command to put name of the program at the start of the machine code file. In Post Builder, clickCreateon theCustom Commandtab and Post Builder will create a copy of whatever custom command you have selected as shown below.So delete all the code and rename the custom commandPB_CMD_program_name. Now we need a variable that comes from NX with the name of the program and a built in command that will output the name to the machine code file. If you open theMOM Variables Browerand search program name, you will see thatmom_group_nameis the variable that we want and if you set the search category toMOM Commandand search for output, you will see thatMOM_output_literalis the build in command that we want.So in our Custom command, we typeglobal mom_group_nameMOM_output_literal “Program Name: $mom_group_name”The first line is a variable declaration. We are declaring the variablemom_group_nameand the global statement indicates the scope of the variable. The global scope is the entire MOM process, meaning that if there is already a variable with the namemom_group_namethat exists anywhere in the MOM process, we will be accessing that variable. It also means that if we change the variable, it will be changed for the entire MOM process until it is changed ag
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 环卫工人劳动合同协议书
- 烧烤承包或转让合同范本
- 龙海人才市场就业协议书
- 消费赔偿保密协议书范本
- 销售立式镗铣床合同范本
- 球馆承包合同协议书范本
- 锤子直播带货协议合同书
- 米线店的加盟合同协议书
- 硅酸泥水泥采购合同范本
- 淮安机械工程监理协议书
- 专业技术职务聘任表(2017年版)
- GB/T 602-2002化学试剂杂质测定用标准溶液的制备
- GB/T 28789-2012视频交通事件检测器
- GB/T 12706.1-2020额定电压1 kV(Um=1.2 kV)到35 kV(Um=40.5 kV)挤包绝缘电力电缆及附件第1部分:额定电压1 kV(Um=1.2 kV)和3 kV(Um=3.6 kV)电缆
- 新版有创血压监测ABP培训课件
- 重症医学科常用知情告知书
- 防溺水、防性侵、防欺凌安全教育家长会
- DB11-T1322-14-2017安全生产等级评定技术规范第14部分:汽车制造企业
- 养老机构安全检查表
- 企业员工上下班交通安全培训(简详共2份)
- 小区物业服务收支情况公示
评论
0/150
提交评论