ABB机器人码垛程序.docx
- 文档编号:15502876
- 上传时间:2023-07-05
- 格式:DOCX
- 页数:18
- 大小:15.64KB
ABB机器人码垛程序.docx
《ABB机器人码垛程序.docx》由会员分享,可在线阅读,更多相关《ABB机器人码垛程序.docx(18页珍藏版)》请在冰点文库上搜索。
ABB机器人码垛程序
MODULEMainModule
PROCMain()
TPErase;
TPReadNumnCount1,"QingShuRuYiMaBaoShu!
";
TPReadNumnJob,"QingShuRuMoShi:
50KG:
=1,25KG:
=2!
";
InitAll;
WHILETRUEDO
ReadType;
clock2re;
PickIF;
clock2re;
PlaceOF;
ENDWHILE
ENDPROC
PROCclock2re()
!
tempint:
=movstat;
IFDI10_1Product0K=0orDI10_2TuoPanOK=0Then
IFtempint ClkStartCLK2; ELSE ClkStopCLK2; ENDIF Else ClkStopCLK2; EndIF Endproc PROCInitAll() MoveHome; ResetDO10_1JiaZhua; ResetDO10_2YaBan; ResetDO10_3ZhuaOK; ResetDO10_4MaDuoOK; Waittime; 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: =wobj0; ! MoveLDOOffs(pPick,0,0,100),vFast,z20,tool0\WObj: =wobj0,DO10_1JiaZhua,1; MoveLpPick,vFast,fine,tGripper\WObj: =wobj0; Close1; GripLoadLoadFull; Accset50,50; HandshakeIF; bPickPart: =TRUE; ConfL\Off; MoveJpAfterPick,vFast,z60,tGripper\WObj: =wobj0; ENDIF ENDPROC PROCPlaceOF() IFDI10_2TuoPanOK=1ANDbPickPart=TRUETHEN CalculatePlace; ConfL\Off; ! MoveLOffs(pOver,0,0,nOffsZ2),vFast,z200,tGripper; IFbTag=truethen Accset70,70; MoveJpAbovePlace,vFast,z10,tGripper\WObj: =wobj0; else Accset90,90; MoveJpAbovePlace,vFast,z10,tGripper\WObj: =wobj0; Endif Accset100,100; ! placefirstbox ConfL\Off; ! MoveLOffs(pPlace1,nOffsX1,nOffsY1,nOffsZ1),vTurn,z10,tGripper\WObj: =wobj0; MoveLpPlace1,vMiddle,fine,tGripper\WObj: =wobj0; Open1; ConfL\Off; MoveLOffs(pPlace1,0,0,nOffsZ1),vMiddle,z5,tGripper\WObj: =wobj0; GripLoadLoadEmpty; Accset100,100; bPickPart: =FALSE; IncrnCount1; HandshakeOF; MoveJpAbovePick,vFast,z200,tGripper\WObj: =wobj0; MoveLOffs(pPick,0,0,400),vFast,z10,tGripper\WObj: =wobj0; ! MoveJpHome,vFast,z200,tGripper; ENDIF ENDPROC PROCHandshakeIF() IFnJob=1THEN ! SetDO10_3ZhuaOK; ENDIF IFnJob=2THEN ! SetDO10_3ZhuaOK; ENDIF ENDPROC PROCHandshakeOF() IF(nCount1=40andnJob=1)or(nCount1=80andnJob=2)THEN SetDO10_4MaDuoOK; WaitDIDI10_2TuoPanOK,0; SetDO\SDelay: =,DO10_4MaDuoOK,0; nCount1: =0; ClkStopCLK1; ClkStopCLK2; TPErase; nCycleCount: =ClkRead(CLK1); Waitingtime: =ClkRead(CLK2); TPWrite"Cycletime: "\Num: =nCycleCount; TPWrite"WaitingtimeinthisCycle: "\Num: =Waitingtime; ClkResetCLK2; ClkResetCLK1; ClkStartCLK1; ENDIF ENDPROC PROCMoveHome() TempP1: =CRobT(\Tool: =tool0\WObj: =wobj0); ;MoveJTempP1,v1000,z20,tGripper; MoveJpHome,v1000,z20,tGripper; ENDPROC PROCReadType() IFnPriority=1ANDDI10_1Product0K=1THEN ! nJob: =1; ! IncrnPriority; ELSEIFnPriority=2ANDDI10_1Product0K=1THEN ! nJob: =2; ! IncrnPriority; ELSE ! nJob: =0; ! IncrnPriority; ! IFnPriority>2nPriority: =1; ENDIF ENDPROC PROCOpen1() ResetDO10_2YaBan; Waittime; ResetDO10_1JiaZhua; waittime; ! WaittimenTimeGripper; ENDPROC PROCClose1() SetDO10_1JiaZhua; Waittime; WaitDIDI10_4Zhua1End,1; SetDO10_2YaBan; Waittime; ! WaittimenTimeGripper; WaitDIDI10_4Zhua1End,1; ! WaitDIDI10_6Zhua2End,1; ENDPROC PROCCalculatePick() IFnJob=1THEN pPick: =pPick1; ELSEIFnJob=2THEN pPick: =pPick1; ENDIF ! pAbovePick: =pPick; ! pAfterPick: =pPick; ! Pattern80; ! CalculatePlace() IFnJob=1THEN nBagL: =nBag50L; nBagW: =nBag50W; nBagH: =nBag50H; Pattern80; ELSEIFnJob=2THEN nBagL: =nBag25L; nBagW: =nBag25W; nBagH: =nBag25H; Pattern100; ENDIF ! pAbovePlace: =pPlace1; pAfterPlace: =pAbovePlace; ENDPROC PROCPattern80() bTag: =FALSE; TESTnCount1+1 CASE1: pPlace1: =pBase180; 2: pPlace1: =pBase0; 3: pPlace1: =pBase90; 4: pPlace1: =pBase90; 5: pPlace1: =pBase90; CASE6: pPlace1: =pBase180; 7: pPlace1: =pBase0; 8: pPlace1: =pBase270; 9: pPlace1: =pBase270; 10: pPlace1: =pBase270; 11: pPlace1: =pBase180; CASE12: pPlace1: =pBase0; 13: pPlace1: =pBase90; 14: pPlace1: =pBase90; 15: pPlace1: =pBase90; CASE16: pPlace1: =pBase180; 17: pPlace1: =pBase0; 18: pPlace1: =pBase270; 19: pPlace1: =pBase270; 20: pPlace1: =pBase270; 21: pPlace1: =pBase180; CASE22: pPlace1: =pBase0; 23: pPlace1: =pBase90; 24: pPlace1: =pBase90; 25: pPlace1: =pBase90; 26: pPlace1: =pBase180; 27: pPlace1: =pBase0; 28: pPlace1: =pBase270; 29: pPlace1: =pBase270; 30: pPlace1: =pBase270; 31: pPlace1: =pBase180; CASE32: pPlace1: =pBase0; 33: pPlace1: =pBase90; 34: pPlace1: =pBase90; 35: pPlace1: =pBase90; 36: pPlace1: =pBase180; 37: pPlace1: =pBase0; 38: pPlace1: =pBase270; 39: pPlace1: =pBase270; 40: pPlace1: =pBase270; DEFAULT: ErrWrite"WrongboxCount...","SingleboxmustbethelastoneofaPallet"; Stop; EXIT; ENDTEST ENDPROC PROCPattern100() bTag: =FALSE; TESTnCount1+1 CASE1: pPlace1: =p25Base270; 2: pPlace1: =p25Base0; 3: pPlace1: =p25Base90; 4: pPlace1: =p25Base180; 5: pPlace1: =p25Base270; CASE6: pPlace1: =p25Base0; 7: pPlace1: =p25Base90; 8: pPlace1: =p25Base180; 9: pPlace1: =p25Base270; 10: pPlace1: =p25Base0; 11: pPlace1: =p25Base90; 12: pPlace1: =p25Base180; 13: pPlace1: =p25Base270; CASE14: pPlace1: =p25Base0; 15: pPlace1: =p25Base90; 16: pPlace1: =p25Base180; 17: pPlace1: =p25Base270; 18: pPlace1: =p25Base0; 19: pPlace1: =p25Base90; 20: pPlace1: =p25Base180; 21: pPlace1: =p25Base270; CASE22: pPlace1: =p25Base0; 23: pPlace1: =p25Base90; 24: pPlace1: =p25Base180; 25: pPlace1: =p25Base270; 26: pPlace1: =p25Base0; 27: pPlace1: =p25Base90; 28: pPlace1: =p25Base180; 29: pPlace1: =p25Base270; CASE30: pPlace1: =p25Base0; 31: pPlace1: =p25Base90; 32: pPlace1: =p25Base180; 33: pPlace1: =p25Base270; 34: pPlace1: =p25Base0; 35: pPlace1: =p25Base90; 36: pPlace1: =p25Base180; 37: pPlace1: =p25Base270; CASE38: pPlace1: =p25Base0; 39: pPlace1: =p25Base90; 40: pPlace1: =p25Base180; 41: pPlace1: =p25Base270; 42: pPlace1: =p25Base0; 43: pPlace1: =p25Base90; 44: pPlace1: =p25Base180; 45: pPlace1: =p25Base270; CASE46: pPlace1: =p25Base0; 47: pPlace1: =p25Base90; 48: pPlace1: =p25Base180; 49: pPlace1: =p25Base270; 50: pPlace1: =p25Base0; 51: pPlace1: =p25Base90; 52: pPlace1: =p25Base180; 53: pPlace1: =p25Base270; CASE54: pPlace1: =p25Base0; 55: pPlace1: =p25Base90; 56: pPlace1: =p25Base180; 57: pPlace1: =p25Base270; 58: pPlace1: =p25Base0; 59: pPlace1: =p25Base90; 60: pPlace1: =p25Base180; 61: pPlace1: =p25Base270; CASE62: pPlace1: =p25Base0; 63: pPlace1: =p25Base90; 64: pPlace1: =p25Base180; 65: pPlace1: =p25Base270; 66: pPlace1: =p25Base0; 67: pPlace1: =p25Base90; 68: pPlace1: =p25Base180; 69: pPlace1: =p25Base270; CASE70: pPlace1: =p25Base0; 71: pPlace1: =p25Base90; 72: pPlace1: =p25Base180; 73: pPlace1: =p25Base270; 74: pPlace1: =p25Base0; 75: pPlace1: =p25Base90; 76: pPlace1: =p25Base180; 77: pPlace1: =p25Base270; CASE78: pPlace1: =p25Base0; 79: pPlace1: =p25Base90; 80: pPlace1: =p25Base180; DEFAULT: ErrWrite"WrongboxCount...","SingleboxmustbethelastoneofaPallet"; Stop; EXIT; ENDTEST ENDPROC ENDMODULE
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ABB 机器人 码垛 程序