1、带参数例行程序概念
ABB机器人在建立程序时候,可以把程序建立为三类,分别是普通程序(Procedures)、功能程序(functions)和中断程序(trap)。带参数例行程序属于普通程序,即在编写例行程序时,可以附带参数。
2、带参数理性程序使用说明
(1)带参数例行程序的参数个数,可以有多个参数,参数的数据类型可以不相同。
(2)带参数例行程序属于普通程序,编程和普通程序一致,可以有各种指令类型。
(3)带参数例行程,不可以像其他普通程序一样,即在手动操作时候,调试里面PP指针不可以直接进入带参数例行程序里面,只能通过程序调用来进入和执行.
3、举例说明带参数例行程序使用
(1)绘制长方体的带参数例行程:
PROC rZFT1(INOUT num numZD1,INOUT num numKD1,INOUT num numGD1)
pZFTbase := CRobT(\Tool:=tWeldGun\WObj:=wobj0);
MoveL pZFTbase, v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,numZD1,0,0), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,numZD1,numKD1,0), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,0,numKD1,0), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL pZFTbase, v1000, fine, tWeldGun\WObj:=wobj0;
WaitTime 0.2;
MoveL Offs(pZFTbase,0,0,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,numZD1,0,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,numZD1,0,0), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,numZD1,0,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
WaitTime 0.2;
MoveL Offs(pZFTbase,numZD1,numKD1,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,numZD1,numKD1,0), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,numZD1,numKD1,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
WaitTime 0.2;
MoveL Offs(pZFTbase,0,numKD1,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,0,numKD1,0), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,0,numKD1,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
WaitTime 0.2;
MoveL Offs(pZFTbase,0,0,numGD1), v1000, fine, tWeldGun\WObj:=wobj0;
MoveL Offs(pZFTbase,0,0,0), v1000, fine, tWeldGun\WObj:=wobj0;
ENDPROC
(2)主程序
PROC main()
TPErase;
TPReadNum numZD1, "shu ru zhang du numZD1 = ";
TPReadNum numKD1, "shu ru kuan du numKD1 = ";
TPReadNum numGD1, "shu ru gao du numGD1 = ";
TPReadNum numCS1, "shu ru zhang fang ti hua de ci shu numCS1 = ";
FOR i FROM 1 TO numCS1 DO
rZFT1 numZD1, numKD1, numGD1;
TPWrite "zhang fang ti hua di ji ci numCS1 = "\Num:=numCS1;
ENDFOR
WaitTime 0.2;
ENDPROC
(3)程序运行图片
图片1:
图片2: