2024年4月22日发(作者:咎静安)
PROC Main()
!主程序
!程序初始化
!回Home点
!进入While循环
!设置机器人速度
!
用于搬运易碎品或减轻振动和路径误差。它能放
rInitial;
rMoveHome;
While True Do
Velset 100,3000;
AccSet 70, 70;
慢加减速的增减率,从而让机器人的运动更加平顺
!调用“机器人拾取物料”子程序
!调用“机器人放置物料”子程序
!结束While循环
rpickworkpiece;
rplaceworkpiece;
endwhile
proc rpickworkpiece;
if workpiece=false
!“机器人拾取物料”子程序
!条件判断,当workpiece条件为false时,执行下一步
!进入物料拾取上方
!跳转标签
!擦除示教器上的信息
MoveJ pickup, v2000, z5, too10;
A:
TPErase;
IF DI10_pickup=1 THEN
!条件判断,当DI10_pickup信号为1时,执行下一步pickup为
发来拾取信号
!等待0.5s的时间
!条件判断,当DI10_pickup信号为0时,执行下一步
WaitTime 0.5;
ELSEIF DI10_pickup=0 THEN
TPWrite "PLC-pickup signal no ready."; !示教器写屏,
GOTO A;
ENDIF
MoveJ Offs(pickup,0,0,300), v500, z200, too10; !进入物料拾取位置
SetDo DO10_pickup1,1;
wait time 1;
workpiece=ture
!发出机器人夹具/治具拾取信号
!等待时间1s
!将workpiece条件置为ture,便于物料放置时,
进行条件判断设置
!跳转标签
endif
endproc
proc rplaceworkpiece;
if workpiece=ture
!该程序为“物料放置”子程序
MoveJ placemiddle, v2000, z5, too10;
MoveJ placeworkpiece, v2000, z5, too10;
MoveJ Offs(placeworkpiece,0,0,300), v500, z200, too10;
SetDo DO10_pickup1,0;
A:
TPErase;
IF DI10_pickon=1 THEN (pickon为PLC检测已放好信号)
WaitTime 0;
ELSEIF DI10_pickup=0 THEN
TPWrite "PLC-pickON signal no ready.";
GOTO A;
workpiece=false
ENDIF
PROC rInitial()
!初始化程序
!复位夹具信号
endproc
Reset
DO10_pickup1;
If nInput=4 Then
workpiece:=False;
ElseIF nInput=5 then
workpiece:=True;
ENDIF
ENDPROC
PROC rMoveHome() !(定义原点)此例行程序可以方便地回到等待位置
MoveJ pHome, v500, z50, tGripper;
ENDPROC
2024年4月22日发(作者:咎静安)
PROC Main()
!主程序
!程序初始化
!回Home点
!进入While循环
!设置机器人速度
!
用于搬运易碎品或减轻振动和路径误差。它能放
rInitial;
rMoveHome;
While True Do
Velset 100,3000;
AccSet 70, 70;
慢加减速的增减率,从而让机器人的运动更加平顺
!调用“机器人拾取物料”子程序
!调用“机器人放置物料”子程序
!结束While循环
rpickworkpiece;
rplaceworkpiece;
endwhile
proc rpickworkpiece;
if workpiece=false
!“机器人拾取物料”子程序
!条件判断,当workpiece条件为false时,执行下一步
!进入物料拾取上方
!跳转标签
!擦除示教器上的信息
MoveJ pickup, v2000, z5, too10;
A:
TPErase;
IF DI10_pickup=1 THEN
!条件判断,当DI10_pickup信号为1时,执行下一步pickup为
发来拾取信号
!等待0.5s的时间
!条件判断,当DI10_pickup信号为0时,执行下一步
WaitTime 0.5;
ELSEIF DI10_pickup=0 THEN
TPWrite "PLC-pickup signal no ready."; !示教器写屏,
GOTO A;
ENDIF
MoveJ Offs(pickup,0,0,300), v500, z200, too10; !进入物料拾取位置
SetDo DO10_pickup1,1;
wait time 1;
workpiece=ture
!发出机器人夹具/治具拾取信号
!等待时间1s
!将workpiece条件置为ture,便于物料放置时,
进行条件判断设置
!跳转标签
endif
endproc
proc rplaceworkpiece;
if workpiece=ture
!该程序为“物料放置”子程序
MoveJ placemiddle, v2000, z5, too10;
MoveJ placeworkpiece, v2000, z5, too10;
MoveJ Offs(placeworkpiece,0,0,300), v500, z200, too10;
SetDo DO10_pickup1,0;
A:
TPErase;
IF DI10_pickon=1 THEN (pickon为PLC检测已放好信号)
WaitTime 0;
ELSEIF DI10_pickup=0 THEN
TPWrite "PLC-pickON signal no ready.";
GOTO A;
workpiece=false
ENDIF
PROC rInitial()
!初始化程序
!复位夹具信号
endproc
Reset
DO10_pickup1;
If nInput=4 Then
workpiece:=False;
ElseIF nInput=5 then
workpiece:=True;
ENDIF
ENDPROC
PROC rMoveHome() !(定义原点)此例行程序可以方便地回到等待位置
MoveJ pHome, v500, z50, tGripper;
ENDPROC