摘要
为实现SLM 3D打印机控制系统对3D打印切片软件生成的控制代码进行准确、高效的译码工作,利用GRETA正则表达式开发了SLM 3D打印机控制系统译码模块。此译码模块充分利用了GRETA正则表达式中rpattern对象与放置替换结果的容器subst_results,在控制代码的预处理、词法检查、语法检查以及加工信息提取过程中,均采用正则表达,按照匹配替换、提取替换结果的操作模式设计了译码模块。程序仿真测试结果表明,该译码模块能够满足SLM 3D打印机控制系统对译码工作的要求。采用GRETA正则表达式与层次化的编程方法,提高了所设计译码模块的可移植性、可扩展性。
In order to realize the accurate and efficient decoding of the control code generated by the 3 D print slicing software for SLM 3 D printer control system,the decoding module of SLM 3 D printer control system was developed by using the GRETA regular expression. This decoding module makes full use of the rpattern object and the container subst_results that place the replacement results. In the process of control code preprocessing,lexical check,grammar check and processing information extraction,regular expression is adopted. The decoding module is designed according to the operation mode of matching and replacing,extracting replacement results. The results of program simulation test show that the decoding module can meet the requirements of SLM 3 D printer control system for decoding. Using GRETA regular expression and hierarchical programming method,the expansibility and portability of the designed decoding module are improved.
引文
[1]田杰,黄正华,戚文军,等.金属选区激光熔化的研究现状[J].材料导报,2017,31(S1):90-94,101.
[2]陶桂宝,梁涛,安祥波,等.车铣复合数控代码编译器的设计[J].制造技术与机床,2011(8):54-59.
[3]章善财,夏链,韩江.通用NC代码编译器的设计与实现[J].组合机床与自动化加工技术,2014(10):53-56.
[4]陈婵娟,刘海超.开放式数控系统软件译码模块的研究及实际开发[J].机床与液压,2010,38(1):47-50.
[5]何嘉健,李伟光.基于GRETA正则表达式的机器人解释器的研究[J].组合机床与自动化加工技术,2012(1):17-19,24.
[6]Tom Christiansen,Brian D Foy,Larry Wall.Programming perl[J].Oreilly Media,2012.
[7]Eric Niebler.GRETA:The GRETA regular expression template archive[M].2002.
[8]王宏甲,赵庆志,刘慧.基于Boost正则表达式的数控系统译码模块设计[J].组合机床与自动化加工技术,2017(4):89-91,95.
[9]王强锋.基于VB环境的Fanuc 0-TD数控车床仿真系统的开发与研究[J].制造技术与机床,2010(6):54-57.