目录
序........................................................................................................................................................1
一.什么是宏程序? ................................................................................................................1
二.用宏程编程有什么好处? ................................................................................................1
一.宏变量及宏常量 ........................................................................................................................1
1.宏变量 ..................................................................................................................................1
2.局部变量 ..............................................................................................................................2
3.全局变量 ..............................................................................................................................2
4.系统变量 ..............................................................................................................................3
5.常量 ......................................................................................................................................3
二.运算符与表达式 ........................................................................................................................3
1.算术运算符 ..........................................................................................................................3
2.条件运算符 ..........................................................................................................................3
3.逻辑运算符 ..........................................................................................................................3
4.函数 ......................................................................................................................................4
5.表达式与括号 ......................................................................................................................4
6.运算符的优先级 ..................................................................................................................4
7.赋值号 = ..............................................................................................................................4
8.注释 ......................................................................................................................................4
三.程序流程控制 ............................................................................................................................5
1.条件分支 IF.......................................................................................................................5
2.条件循环 WHILE .............................................................................................................6
四.子程序及参数递传 ....................................................................................................................7
1.普通子程序 ..........................................................................................................................7
2.宏子程序 ..............................................................................................................................7
3.全局变量传参数 ..................................................................................................................7
4.局部变量传参数 ..................................................................................................................8
5.系列零件加工 ......................................................................................................................9
6.高级参考 ............................................................................................................................10
五.宏编程实例 ..............................................................................................................................12
1.数车编程 ............................................................................................................................12
(1)函数曲线加工通用宏程序.....................................................................................12
(2)抛物线车削 1 .........................................................................................................12
(3)抛物线车削 2 .........................................................................................................12
(4)抛物线车削 3 .........................................................................................................13
(5)抛物线车削 4 .........................................................................................................13
(6)抛物线车削 5(G71 与宏程序)...........................................................................14
(7)抛物线车削 6 .........................................................................................................14
(8)正弦线车削 ............................................................................................................15
(9)抛物线与椭圆车削 ................................................................................................15
(10)椭圆粗、精车削 ..................................................................................................16
(11)用子程序完成粗、精加工...................................................................................16
(12)变螺距螺纹 ..........................................................................................................18
2.数铣编程 ............................................................................................................................18