资源描述:
《ABB机器人码垛程序.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、MODULEMainModulePROCMain()TPErase;TPReadNumnCount1,"QingShuRuYiMaBaoShu!";TPReadNumnJob,"QingShuRuMoShi:50KG:=1,25KG:=2!";InitAll;WHILETRUEDOReadType;clock2re;PickIF;clock2re;PlaceOF;ENDWHILEENDPROCPROCclock2re()!tempint:=movstat;IFDI10_1Product0K=0orDI10_2TuoPanOK=0ThenIFtempint<0.25thenClkStartCLK
2、2;ELSEClkStopCLK2;ENDIFElseClkStopCLK2;EndIFEndprocPROCInitAll()MoveHome;ResetDO10_1JiaZhua;ResetDO10_2YaBan;ResetDO10_3ZhuaOK;ResetDO10_4MaDuoOK;Waittime0.5;bPickPart:=FALSE;ClkResetCLK1;ClkStartCLK1;ClkResetCLK2;MoveLOffs(pPick,0,0,400),vFast,z10,tGripperWObj:=wobj0;ENDPROCPROCPickIF()IFbPickPart
3、=FALSEANDnJob<>0ANDDI10_1Product0K=1THEN!CalculatePick;MoveJOffs(pPick,0,0,400),vFast,z200,tGripperWObj:=wobj0;!MoveLDOOffs(pPick,0,0,100),vFast,z20,tool0WObj:=wobj0,DO10_1JiaZhua,1;MoveLpPick,vFast,fine,tGripperWObj:=wobj0;Close1;GripLoadLoadFull;Accset50,50;HandshakeIF;bPickPart:=TRUE;ConfLOff
4、;MoveJpAfterPick,vFast,z60,tGripperWObj:=wobj0;ENDIFENDPROCPROCPlaceOF()IFDI10_2TuoPanOK=1ANDbPickPart=TRUETHENCalculatePlace;ConfLOff;!MoveLOffs(pOver,0,0,nOffsZ2),vFast,z200,tGripper;IFbTag=truethenAccset70,70;MoveJpAbovePlace,vFast,z10,tGripperWObj:=wobj0;elseAccset90,90;MoveJpAbovePlace,vFast
5、,z10,tGripperWObj:=wobj0;EndifAccset100,100;!placefirstboxConfLOff;!MoveLOffs(pPlace1,nOffsX1,nOffsY1,nOffsZ1),vTurn,z10,tGripperWObj:=wobj0;MoveLpPlace1,vMiddle,fine,tGripperWObj:=wobj0;Open1;ConfLOff;MoveLOffs(pPlace1,0,0,nOffsZ1),vMiddle,z5,tGripperWObj:=wobj0;GripLoadLoadEmpty;Accset100,10
6、0;bPickPart:=FALSE;IncrnCount1;HandshakeOF;MoveJpAbovePick,vFast,z200,tGripperWObj:=wobj0;MoveLOffs(pPick,0,0,400),vFast,z10,tGripperWObj:=wobj0;!MoveJpHome,vFast,z200,tGripper;ENDIFENDPROCPROCHandshakeIF()IFnJob=1THEN!SetDO10_3ZhuaOK;ENDIFIFnJob=2THEN!SetDO10_3ZhuaOK;ENDIFENDPROCPROCHandshakeOF()
7、IF(nCount1=40andnJob=1)or(nCount1=80andnJob=2)THENSetDO10_4MaDuoOK;WaitDIDI10_2TuoPanOK,0;SetDOSDelay:=0.5,DO10_4MaDuoOK,0;nCount1:=0;ClkStopCLK1;ClkStopCLK2;TPErase;nCycleCount:=ClkRead(CLK1);Waitin