ABB机器人码垛程序Word文件下载.docx
《ABB机器人码垛程序Word文件下载.docx》由会员分享,可在线阅读,更多相关《ABB机器人码垛程序Word文件下载.docx(55页珍藏版)》请在冰豆网上搜索。
![ABB机器人码垛程序Word文件下载.docx](https://file1.bdocx.com/fileroot1/2022-10/20/89d7e0b5-8f9e-49e7-a472-d12199dad617/89d7e0b5-8f9e-49e7-a472-d12199dad6171.gif)
ENDPROC
PROCclock2re()
!
tempint:
=movstat;
IFDI10_1Product0K=0orDI10_2TuoPanOK=0ThenIFtempint<
0.25then
ClkStartCLK2;
ELSE
ClkStopCLK2;
ENDIF
Else
EndIF
Endproc
PROCInitAll()
MoveHome;
ResetDO10_1JiaZhua;
ResetDO10_2YaBan;
ResetDO10_3ZhuaOK;
ResetDO10_4MaDuoOK;
Waittime0.5;
bPickPart:
=FALSE;
ClkResetCLK1;
ClkStartCLK1;
ClkResetCLK2;
MoveLOffs(pPick,0,0,400),vFast,z10,tGripper\WObj:
=wobj0;
ENDPROC
PROCPickIF()
IFbPickPart=FALSEANDnJob<
>
0ANDDI10_1Product0K=1THEN
CalculatePick;
MoveJOffs(pPick,0,0,400),vFast,z200,tGripper\WObj:
tool0\WObj:
=wobj0,
MoveLDOOffs(pPick,0,0,100),vFast,z20,DO10_1JiaZhua,1;
MoveLpPick,vFast,fine,tGripper\WObj:
Close1;
GripLoadLoadFull;
Accset50,50;
HandshakeIF;
=TRUE;
ConfL\Off;
MoveJpAfterPick,vFast,z60,tGripper\WObj:
PROCPlaceOF()
IFDI10_2TuoPanOK=1ANDbPickPart=TRUETHENCalculatePlace;
MoveLOffs(pOver,0,0,nOffsZ2),vFast,z200,tGripper;
IFbTag=truethen
Accset70,70;
MoveJpAbovePlace,vFast,z10,tGripper\WObj:
else
Accset90,90;
Endif
Accset100,100;
placefirstbox
MoveL
Offs(pPlace1,nOffsX1,nOffsY1,nOffsZ1),vTurn,z10,tGripper\WObj:
MoveLpPlace1,vMiddle,fine,tGripper\WObj:
Open1;
MoveLOffs(pPlace1,0,0,nOffsZ1),vMiddle,z5,tGripper\WObj:
GripLoadLoadEmpty;
bPickPart:
IncrnCount1;
HandshakeOF;
MoveJpAbovePick,vFast,z200,tGripper\WObj:
!
MoveJpHome,vFast,z200,tGripper;
PROCHandshakeIF()
IFnJob=1THEN
SetDO10_3ZhuaOK;
IFnJob=2THEN
PROCHandshakeOF()
IF(nCount1=40andnJob=1)or(nCount1=80andnJob=2)THENSetDO10_4MaDuoOK;
WaitDIDI10_2TuoPanOK,0;
SetDO\SDelay:
=0.5,DO10_4MaDuoOK,0;
nCount1:
=0;
ClkStopCLK1;
nCycleCount:
=ClkRead(CLK1);
Waitingtime:
=ClkRead(CLK2);
TPWrite"
Cycletime:
"
\Num:
=nCycleCount;
WaitingtimeinthisCycle:
=Waitingtime;
PROCMoveHome()
TempP1:
=CRobT(\Tool:
=tool0\WObj:
=wobj0);
TempP1.trans.z:
=500;
MoveJTempP1,v1000,z20,tGripper;
MoveJpHome,v1000,z20,tGripper;
PROCReadType()
IFnPriority=1ANDDI10_1Product0K=1THEN!
nJob:
=1;
IncrnPriority;
ELSEIFnPriority=2ANDDI10_1Product0K=1THEN!
=2;
IncrnPriority;
IFnPriority>
2nPriority:
ENDIFENDPROC
PROCOpen1()
Waittime0.0;
waittime0.1;
WaittimenTimeGripper;
PROCClose1()
SetDO10_1JiaZhua;
WaitDIDI10_4Zhua1End,1;
SetDO10_2YaBan;
WaitDIDI10_6Zhua2End,1;
PROCCalculatePick()
IFnJob=1THENpPick:
=pPick1;
ELSEIFnJob=2THENpPick:
pAbovePick:
=pPick;
pAfterPick:
Pattern80;
pAbovePick.trans.z:
=pAfterPick.trans.z;
pAbovePick.trans.y:
=pAfterPick.trans.y-500;
pAfterPick.trans.y:
PROCCalculatePlace()
IFnJob=1THENnBagL:
=nBag50L;
nBagW:
=nBag50W;
nBagH:
=nBag50H;
Pattern80;
ELSEIFnJob=2THENnBagL:
=nBag25L;
=nBag25W;
=nBag25H;
Pattern100;
pAbovePlace:
=pPlace1;
pAfterPlace:
=pAbovePlace;
PROCPattern80()bTag:
TESTnCount1+1
CASE1:
pPlace1:
=pBase180;
pPlace1.trans.x:
=pPlace1.trans.x;
pPlace1.trans.y:
=pPlace1.trans.y;
pPlace1.trans.z:
=pPlace1.trans.z;
nOffsX1:
nOffsY1:
nOffsZ1:
=500;
nOffsZ2:
=-500;
nLevel:
bTwice:
pAfterPick.trans.z:
=pPick.trans.z+400;
pAbovePlace.trans.z:
bTag:
=True;
CASE2:
=pBase0;
=nBagH*1.2;
CASE3:
=pBase90;
pPlace1.trans.y:
=pPlace1.trans.y+25;
pAfterPick.trans.z:
pAbovePlace:
pAbovePlace.trans.z:
CASE4:
pPlace1.trans.x:
=pPlace1.trans.x+2*nBagW;
pPlace1.trans.z:
=pPlace1.