
上QQ阅读APP看书,第一时间看更新
4.2.6 运算指令概述
1.位置数据运算——乘法
(1)定义 位置数据运算的乘法运算实际是变换到TOOL坐标系的过程。在下例中,P100=P1*P2,P1点相当于TOOL坐标系中的原点,P2是TOOL坐标系中的坐标点,如图4-17所示。注意P1、P2点的排列顺序,顺序不同,意义也不一样。
乘法运算就是在TOOL坐标系中的加法运算,除法运算就是在TOOL坐标系中的减法运算。由于乘法运算经常使用在根据当前点位置计算下一点的位置,所以特别重要,读者需要仔细体会。

图4-17 位置数据运算——乘法
(2)程序样例

2.位置数据运算——加法
(1)定义 加法运算是以机器人基本坐标系为基准,以P1为起点,取P2点的坐标值进行的运算,如图4-18所示。
(2)程序样例


图4-18 位置数据运算——加法
从本质上来说,乘法与加法的区别在于各自依据的坐标系不同,但都是以第1点为基准,第2点作为绝对值增量进行运算。