PROCtest_pallet()
PalletSet 1,p10,p20,p30,3,4;
!指令与EPSON的Pallet一致
!PalletSet 码垛组号,首点,第二个点,第三个点,column个数,row个数
FOR i FROM 1 TO 12 DO
rpick;
rPlace 1,i;
!使用码垛组号1中的数据,i代表具体序号
ENDFOR
ENDPROC
PROC PalletSet(num Pall_no,robtarget p1,robtarget p2,robtarget p3,num columns,num rows)
VARnum column_delta_x;
VARnum rows_delta_x;
VARnum column_delta_y;
VARnum rows_delta_y;
VARrobtarget ptmp_arr{50};
VARnum count:=1;
IFcolumns>1 THEN
column_delta_x:=(p2.trans.x-p1.trans.x)/(columns-1);
column_delta_y:=(p2.trans.y-p1.trans.y)/(columns-1);
ENDIF
IFrows>1 THEN
rows_delta_x:=(p3.trans.x-p1.trans.x)/(rows-1);
rows_delta_y:=(p3.trans.y-p1.trans.y)/(rows-1);
ENDIF
SetDataVal"Pall_arr"+ValToStr(pall_no),ptmp_arr;
!clear pall_arrX data
FORj FROM 1 TO rows DO
FOR i FROM 1 TO columns DO
ptmp_arr{count}:=p1;
ptmp_arr{count}.trans.x:=p1.trans.x+column_delta_x*(i-1)+rows_delta_x*(j-1);
ptmp_arr{count}.trans.y:=p1.trans.y+column_delta_y*(i-1)+rows_delta_y*(j-1);
incrcount;
ENDFOR
ENDFOR
SetDataVal"Pall_arr"+ValToStr(pall_no),ptmp_arr;
ENDPROC
- 下一篇:ABB机器人 | 基本编程知识汇总
- 上一篇:ABB机器人故障维修大全