资源描述:
《abb机器人码垛程序文件》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
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
2、.25thenClkStartCLK2;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:=
3、wobj0;ENDPROCPROCPickIF()IFbPickPart=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;GripLoadLoad
4、Full;Accset50,50;HandshakeIF;bPickPart:=TRUE;ConfLOff;MoveJpAfterPick,vFast,z60,tGripperWObj:=wobj0;ENDIFENDPROCPROCPlaceOF()IFDI10_2TuoPanOK=1ANDbPickPart=TRUETHENCalculatePlace;ConfLOff;!MoveLOffs(pOver,0,0,nOffsZ2),vFast,z200,tGripper;IFbTag=truethenAccset70,70;MoveJpAbovePla
5、ce,vFast,z10,tGripperWObj:=wobj0;elseAccset90,90;MoveJpAbovePlace,vFast,z10,tGripperWObj:=wobj0;EndifAccset100,100;!placefirstboxConfLOff;!MoveLOffs(pPlace1,nOffsX1,nOffsY1,nOffsZ1),vTurn,z10,tGripperWObj:=wobj0;MoveLpPlace1,vMiddle,fine,tGripperWObj:=wobj0;Open1;ConfLOff;Mov
6、eLOffs(pPlace1,0,0,nOffsZ1),vMiddle,z5,tGripperWObj:=wobj0;GripLoadLoadEmpty;Accset100,100;bPickPart:=FALSE;IncrnCount1;HandshakeOF;MoveJpAbovePick,vFast,z200,tGripperWObj:=wobj0;MoveLOffs(pPick,0,0,400),vFast,z10,tGripperWObj:=wobj0;!MoveJpHome,vFast,z200,tGripper;ENDIFENDPROCP
7、ROCHandshakeIF()IFnJob=1THEN!SetDO10_3ZhuaOK;ENDIFIFnJob=2THEN!SetDO10_3ZhuaOK;ENDIFENDPROCPROCHandshakeOF()IF(nCount1=40andnJob=1)or(nCount1=80andnJob=2)THENSetDO10_4MaDuoOK;WaitDIDI10_2TuoPanOK,0;SetDOSDelay:=0.5,DO10_4MaDuoOK,0;nCount1:=0;ClkStopCLK1;ClkStopCLK2;TPErase;nCycleC
8、ount:=ClkRead(CLK1);Waitin