ABB机器人码垛程序Word格式文档下载.docx
《ABB机器人码垛程序Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《ABB机器人码垛程序Word格式文档下载.docx(67页珍藏版)》请在冰豆网上搜索。
![ABB机器人码垛程序Word格式文档下载.docx](https://file1.bdocx.com/fileroot1/2023-1/31/9f9613df-0d8c-451a-8dbc-76f82c14f620/9f9613df-0d8c-451a-8dbc-76f82c14f6201.gif)
PROCclock2re()
!
tempint:
=movstat;
IFDI10_1Product0K=0orDI10_2TuoPanOK=0Then
IFtempint<
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;
PROCPickIF()
IFbPickPart=FALSEANDnJob<
>
0ANDDI10_1Product0K=1THEN
CalculatePick;
MoveJOffs(pPick,0,0,400),vFast,z200,tGripper\WObj:
MoveLDOOffs(pPick,0,0,100),vFast,z20,tool0\WObj:
=wobj0,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=TRUETHEN
CalculatePlace;
MoveLOffs(pOver,0,0,nOffsZ2),vFast,z200,tGripper;
IFbTag=truethen
Accset70,70;
MoveJpAbovePlace,vFast,z10,tGripper\WObj:
else
Accset90,90;
Endif
Accset100,100;
placefirstbox
MoveLOffs(pPlace1,nOffsX1,nOffsY1,nOffsZ1),vTurn,z10,tGripper\WObj:
MoveLpPlace1,vMiddle,fine,tGripper\WObj:
Open1;
MoveLOffs(pPlace1,0,0,nOffsZ1),vMiddle,z5,tGripper\WObj:
GripLoadLoadEmpty;
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)THEN
SetDO10_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:
ENDPROC
PROCOpen1()
Waittime0.0;
waittime0.1;
WaittimenTimeGripper;
PROCClose1()
SetDO10_1JiaZhua;
Waittime0.0;
WaitDIDI10_4Zhua1End,1;
SetDO10_2YaBan;
WaitDIDI10_6Zhua2End,1;
PROCCalculatePick()
IFnJob=1THEN
pPick:
=pPick1;
ELSEIFnJob=2THEN
ENDIF
pAbovePick:
=pPick;
pAfterPick:
Pattern80;
pAbovePick.trans.z:
=pAfterPick.trans.z;
pAbovePick.trans.y:
=pAfterPick.trans.y-500;
pAfterPick.trans.y:
PROCCalculatePlace()
nBagL:
=nBag50L;
nBagW:
=nBag50W;
nBagH:
=nBag50H;
Pattern80;
=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:
pAbovePlace.trans.z:
=True;
CASE2:
=pBase0;
pPlace1.trans.y:
=nBagH*1.2;
bTwice:
CASE3:
=pBase90;
=pPlace1.trans.y+25;
CASE4:
=pPlace1.trans.x+2*nBagW;
CASE5:
=pPlace1.trans.x+nBagW;
=pPlace1.trans.z+20;
Layer2
CASE6:
=pPlace1.trans.y+nBagL-5;
=pPlace1.trans.z+nBagH;
nOffsZ2:
CASE7:
CASE8:
pPlace1:
=pBase270;
CASE9:
=pPlace1.trans.x+2*nBagW-25;
CASE10:
Layer3
CASE11:
=pPlace1.trans.z+2*nBagH;
CASE12:
CASE13:
nOffsY1:
CASE14:
CASE15:
nOffsX1:
pAbovePlace.trans.z:
!
layer4
CASE16:
=pPlace1.trans.z+3*nBagH+80;
=-300;
pAbovePlace: