您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 经营企划 > UG后置处理器定制培训
©UGSPLMSolutionsInc.2003.Allrightreserved.UG后置处理器定制培训刘其荣优集系统(中国)有限公司Qirong.liu@ugs.com800-810-1970Helpdesk_cn@ugs.com©UGSPLMSolutionsInc.2004.Allrightreserved.内容•后置处理概述•后置处理器创建•TCL语言介绍•车铣加工中心后置处理器创建•多轴铣后置处理创建©UGSPLMSolutionsInc.2003.Allrightreserved.后置处理概述©UGSPLMSolutionsInc.2004.Allrightreserved.基本概念©UGSPLMSolutionsInc.2004.Allrightreserved.后置处理TOOLPATH/FIXED_CONTOUR_2,TOOL,MILLTLDATA/MILL,30.0000,0.0000,75.0000,0.0000,0.0000MSYS/0.0000,0.0000,0.0000,1.0000000,0.0000000,0.0000000,0.0000000,1.0000000,0.0000000PAINT/PATHPAINT/SPEED,10LOAD/TOOL,1,ZOFF,150.0000PAINT/COLOR,186RAPIDGOTO/51.5000,-12.6421,12.1213,0.5000000,0.5000000,0.7071068PAINT/COLOR,211RAPIDGOTO/95.0000,30.8579,73.6396PAINT/COLOR,42FEDRAT/MMPM,250.0000GOTO/50.0000,-14.1421,10.0000PAINT/COLOR,31GOTO/-14.1421,50.0000,10.0000PAINT/COLOR,37RAPIDGOTO/30.8579,95.0000,73.6396PAINT/SPEED,10PAINT/TOOL,NOMOREEND-OF-PATH%N0010G40G17G94G90G71N0020G91G28Z0.0:0030T01M06N0040G0G90X45.355Y37.426A-45.C-45.S1000M03N0050G43Z213.858H00N0060Z300.858N0070G1Z210.858F250.M08N0080X-45.355N0090G0Z300.858N0100M02%UG刀位数据数控加工指令后置处理UG/Post©UGSPLMSolutionsInc.2004.Allrightreserved.UG/POST的结构UGDataStorageUGPostEventGeneratorEventHandler.tclDefinitionFile.defOutputFileEventNamevariableUserDefinedvariablevariablePostBuilder.pui©UGSPLMSolutionsInc.2004.Allrightreserved.UG/POST的结构UGDataStorageLinearMovex=100y=50z=75UGPostEventGeneratorprocMOM_linear_move{}{MOM_do_templateLinear}FormatSocket%0.3fAddressX{FormatSocketMin0Max550}BLOCK_TEMPLATELinear{G01X[$x]Y[$y]Z[$z]}G01X100.Y50.Z75.Linear_Movex=100y=50z=7554321©UGSPLMSolutionsInc.2004.Allrightreserved.基本概念•Event(事件)–特定的机床动作–SpindleOn主轴转动;linearmove直线进给;toolchange换刀…•UnigraphicsEventGenerator(事件生成器)–UG内置的功能,用来提取UG刀位数据–将参数传递到事件处理器进行处理•EventHandler(ATCLscript)——事件处理器–与特定机床有关的程序,将刀位数据转换为机床指令代码•DefinitionFile——定义文件–给定事件处理输出的格式,被事件处理器TCL所调用©UGSPLMSolutionsInc.2004.Allrightreserved.EVENT——事件•一个事件是从UG文件中提取的一个数据集合•每一事件都与一组变量关联•对每一事件生成器识别的事件,都有一对应的TCL子程序进行处理•传递给事件处理器的变量将作为全局变量进行处理©UGSPLMSolutionsInc.2004.Allrightreserved.EventGenerator——事件生成器•从UG中提取刀轨数据•将后处理命令分解成全局变量•利用运动学处理刀位点•将事件和变量传递给UGPost进行处理©UGSPLMSolutionsInc.2004.Allrightreserved.事件实例(1)•后处理命令:–SPINDL/RPM,100,CLW•时间和变量–Event事件•MOM_spindle_rpm–Variables变量•mom_spindle_speed=100•mom_spindle_direction=CLW©UGSPLMSolutionsInc.2004.Allrightreserved.事件实例(2)•Startofprogram–EventMOM_start_of_program–Variablesmom_datemom_logname…•Startofanewpath–EventMOM_start_of_path–Variablesmom_path_namemom_tool_name…©UGSPLMSolutionsInc.2004.Allrightreserved.EventHandler——事件处理器•TCL子程序,决定刀轨事件如何被处理•事例:procMOM_start_of_program{}{MOM_output_literal“G28G00G91Z0”MOM_output_literal“X0Y0”MOM_output_literal“G90”}©UGSPLMSolutionsInc.2004.Allrightreserved.UGPostExtensionstoTCL(1)•一些有用的扩展命令–MOM_ask_env_varMOM_ask_env_varUGII_CAM_DEBUG_DIR–MOM_output_literalMOM_output_literal“Createdby$mom_logname”–MOM_do_templateMOM_do_templatelinear_move©UGSPLMSolutionsInc.2004.Allrightreserved.UGPostExtensionstoTCL(2)–MOM_forceMOM_forceONCEXYMOM_forceALWAYSXYmotion_gMOM_forceOFFmotion_g–MOM_suppressMOM_suppressONCEcutcom_gMOM_suppressALWAYSNMOM_suppressOFFIJK©UGSPLMSolutionsInc.2004.Allrightreserved.定义文件中的关键字•MACHINE•INCLUDE•WORD_SEPARATOR•END_OF_LINE•SEQUENCE•FORMAT•ADDRESS•BLOCKTEMPLATE©UGSPLMSolutionsInc.2004.Allrightreserved.Machine,Include&WordSeparator•MACHINE–机床的名字MACHINEsiemen_3axis•INCLUDE–继承的定义文件INCLUDEgeneric.defstandard.def•WORD_SEPARATOR–分割字符WORD_SEPARATOR“”©UGSPLMSolutionsInc.2004.Allrightreserved.Endofline&Sequence•END_OF_LINE–每一行的结束符END_OF_LINE“\012”•SEQUENCE–输出序号–格式:•SEQUENCEformatstartincrementfrequencySEQUENCEseq_no1011©UGSPLMSolutionsInc.2004.Allrightreserved.定义文件©UGSPLMSolutionsInc.2004.Allrightreserved.基本概念•Block–G01X54.11Y-28.059Z55.B0.0•Address(Word)–X54.11•Format–X54.11©UGSPLMSolutionsInc.2004.Allrightreserved.FORMAT•语法–FORMATnameformat_string–事例FORMATseq_no“&__5_00”FORMATComFed“%7.2f”FORMATSocket_2“&_02_00”©UGSPLMSolutionsInc.2004.Allrightreserved.Formatstring•&abcdefa=+or_输出或不输出+号b=0or_输出或不输出前面的0c=0-9小数点左边最大位数d=.or_输出或不输出小数点e=0-9小数点右边最大位数f=0or_输出或不输出后面的0•C语言格式任何合法的C语言printf格式©UGSPLMSolutionsInc.2004.Allrightreserved.Address•语法ADDRESSname{FORMATnameZERO_FORMATnameFORCEALWAYS|ONCE|OFFMAXnumberAbort|Warning|TruncateMINnumberAbort|Warning|TruncateLEADERstring|TCL_expressionTRAILERstring|TCL_expressionINCREMENTALON|OFFOMITvalue}©UGSPLMSolutionsInc.2004.Allrightreserved.Address实例FORMATSocket_2“&_02_00”……ADDRESScutcom_register{FORMATSocket_2FORCEOFFMAX99MIN0LEADER“D”}©UGSPLMSolutionsInc.2004.Allrightreserved.BlockTemplate•语法BLOCK_TEMPLATEname{Address_name[address_expression]\nows(nowordseparator)\opt(optional)\ldr=string(leader)\trlr=string(trailer)“string”(stringoutputliterally)}©UGSPLMSolutionsInc.2004.Allrightreserved.BlockTemplate实例BLOCK_TEMPLATErapid_XY{cutcom_g[$mom_cutcom_code]\optmotion_g[0]X[$mom_pos(0)]Y[$mom_pos(1)]cutcom_register[$mom_cutcom_adjust_register]\opt}©UGSPLMSolutionsInc.2004.Allrightreserved.后置处理调试©UGSPLMSolutionsInc.2004.Allrightreserved.调试•信息输出mom_information.out•Move(orcopy)
本文标题:UG后置处理器定制培训
链接地址:https://www.777doc.com/doc-3653360 .html