子程序编程方法举例.
图示为车削不等距槽的示例。对等距槽采用循环比较简单,而不等距槽则调用子程序较为简单。
已知毛坯直径φ32mm,长度为77mm,一号刀为外圆车刀,三号刀为切断刀,其宽度为2mm。加工程序如下
%0010
n001 g92 x150.0 z100.0
n002 m03 s800 m08
n003 g00 x35.0 z0
g95 f0.30 (转进给)
n004 g01 x0
n005 g00 x30.0 z2.0
n006 g01 z-55.0 f0.3
n007 g00 x150.0 z100.0
n008 x32.0 z0
t03
n009 m98 p15 l2
n010 g00 w-12.0
n011 g01 x0 f0.12
n012 g04p2.0
n013 g00 x150.0 z100.0 m09
n014 m30
%0015
n101 g00 w-12.0
n102 g01 u-12.0 f0.15
n103 g04 x1.0
n104 g00 u12
n105 w-8
n106 g01 u-12 f0.15
n107 g04 x1.0
n108 g00 u12
n109 m99