TCL语言在FANUC数控系统UG后置处理中的应用
2018-12-18刘解语
刘解语
摘要:使用UG软件CAM模块生成数控加工刀轨后,需要经过后置处理转换成特定机床控制系统能识别的NC代码。特定数控系统后置处理的制作,需要使用TCL语言。NC程序中,注释项对 NC 程序的理解和管理都很重要,必要而规范的解释性语句不仅可以方便编程人员与机床操作人员的交流,而且方便不同人员对程序的理解。FANUC系统因为自身的特殊性,对一些符号、格式有独特的规定,本文结合FANUC数控系统常用的一些解释性语句,简要介绍了在制作机床后置处理时用到的一些TCL语句。
关键词:TCL语言;解释性语句
中图分类号:TP311 文献标识码:A 文章编号:1009-3044(2018)27-0211-04
TCL Language and Its Application in FANUC CNC systemsApplication of Post Builder in UG CAM
LIU Jie-yu
(Luoyang NO.1 Senior High School, Luoyang 471000, China)
Abstract: After the NC tool paths been generated by UG CAM module, it needs to be transformed into a NC program that can be identified by a specific CNC system after post processing. The production of post processing for a particular CNC system requires the use of TCL language. In the NC program, the annotation items are very important for the understanding and management of the NC program. The necessary and standardized interpretative statements can not only facilitate the communication between the programmers and the machine operators, but also facilitate the understanding of the program by the different personnel. FANUC CNC system has unique rules for some symbols and formats because of its own particularity. This paper briefly introduces some TCL statements used in the post processing of machine tools, combining some interpretative statements commonly used in the FANUC CNC system.
Key words: TCL language;Interpretative statement
不同的數控机床控制系统对NC程序格式有不同的要求,Siemens公司UG软件CAM模块生成的加工刀轨源文件也就不能直接被不同数控机床的控制系统所使用,必须经过转换,生成数控机床不同控制系统能接受的程序代码,这一处理过程就是“后置处理”[1]。
UG软件提供了一个后置处理工具Post Builder,其基于TCL语言环境。TCL(Tool Command Language 机器命令语言)是一种通用的计算机语言, 而UG软件基于TCL 语言,做了许多扩展以方便其CAM 后置处理等模块的应用[2]。
UG软件后置处理工具Post Builder中定制的不同的TCL指令会从数控加工文件中抽取信息,依据事先的定义分别加以处理,最后生成可以被数控机床不同控制系统接受的程序代码。可以根据需要高度定制并且编辑这些TCL指令 [3]。
1 TCL 中常用到的列表与字符串处理命令
1) TCL中的一个列表可以理解为一个字符串包含的用空格分开的很多元素。……
