1、IF tempint thenClkStart CLK2;ELSEClkStop CLK2;ENDIFElseEndIFEndprocPROC InitAll()MoveHome;Reset DO10_1JiaZhua;Reset DO10_2YaBan;Reset DO10_3ZhuaOK;Reset DO10_4MaDuoOK;Waittime ;bPickPart:=FALSE;ClkReset CLK1;ClkStart CLK1;ClkReset CLK2;MoveL Offs(pPick,0,0,400), vFast, z10, tGripperWObj:=wobj0;PROC
2、PickIF()IF bPickPart = FALSE AND nJob 0 AND DI10_1Product0K = 1 THEN CalculatePick;MoveJ Offs(pPick,0,0,400), vFast, z200, tGripperWObj:MoveLDO Offs(pPick,0,0,100), vFast, z20, tool0WObj:=wobj0, DO10_1JiaZhua, 1;MoveL pPick, vFast, fine, tGripperWObj:Close1;GripLoad LoadFull;Accset 50,50;HandshakeIF
3、;=TRUE;ConfLOff;MoveJ pAfterPick, vFast, z60, tGripperWObj:PROC PlaceOF()IF DI10_2TuoPanOK = 1 AND bPickPart = TRUE THENCalculatePlace;MoveL Offs(pOver,0,0,nOffsZ2), vFast, z200, tGripper; IF bTag=true then Accset 70, 70; MoveJ pAbovePlace, vFast, z10, tGripperWObj: elseAccset 90, 90; EndifAccset 10
4、0,100; place first boxMoveL Offs(pPlace1,nOffsX1,nOffsY1,nOffsZ1),vTurn,z10,tGripperWObj:MoveL pPlace1, vMiddle, fine, tGripperWObj:Open1;MoveL Offs(pPlace1,0,0,nOffsZ1),vMiddle,z5,tGripperWObj:GripLoad LoadEmpty;Incr nCount1;HandshakeOF;MoveJ pAbovePick, vFast, z200, tGripperWObj:MoveJ pHome, vFast
5、, z200, tGripper;PROC HandshakeIF()IF nJob=1 THENSet DO10_3ZhuaOK;IF nJob=2 THENPROC HandshakeOF()IF (nCount1=40 and nJob =1) or (nCount1=80 and nJob =2) THENSet DO10_4MaDuoOK;WaitDI DI10_2TuoPanOK, 0;SetDOSDelay:=,DO10_4MaDuoOK,0;nCount1:=0;ClkStop CLK1;nCycleCount:=ClkRead(CLK1);Waitingtime:=ClkRe
6、ad(CLK2);TPWrite Cycle time: Num:=nCycleCount;Waiting time in this Cycle:=Waitingtime;PROC MoveHome() TempP1:=CRobT(Tool:=tool0 WObj:=wobj0); ; MoveJ TempP1, v1000, z20, tGripper;MoveJ pHome, v1000, z20, tGripper;PROC ReadType()IF nPriority = 1 AND DI10_1Product0K = 1 THENnJob:=1; Incr nPriority;ELS
7、EIF nPriority = 2 AND DI10_1Product0K = 1 THEN=2;Incr nPriority;IF nPriority2 nPriority:PROC Open1()waittime ;Waittime nTimeGripper;PROC Close1()Set DO10_1JiaZhua;WaitDI DI10_4Zhua1End, 1;Set DO10_2YaBan;WaitDI DI10_6Zhua2End, 1;PROC CalculatePick()IF nJob = 1 THENpPick:=pPick1;ELSEIF nJob = 2 THENE
8、NDIF pAbovePick:=pPick;pAfterPick:Pattern80; CalculatePlace()nBagL:=nBag50L;nBagW:=nBag50W;nBagH:=nBag50H;=nBag25L;=nBag25W;=nBag25H;Pattern100;pAbovePlace:=pPlace1;pAfterPlace:=pAbovePlace;PROC Pattern80()bTag:TEST nCount1+1CASE 1:pPlace1:=pBase180; 2:=pBase0; 3:=pBase90; 4: 5: CASE 6: 7: 8:=pBase2
9、70; 9: 10: 11:CASE 12: 13: 14: 15: CASE 16: 17: 18: 19: 20: 21:CASE 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:CASE 32: 33: 34: 35: 36: 37: 38: 39: 40:DEFAULT:ErrWrite Wrong box Count.,Single box must be the last one of a PalletStop;EXIT;ENDTESTPROC Pattern100()=p25Base270;=p25Base0;=p25Base90;=p25Base180; 12:CASE 14: 16:CASE 30: 32:CASE 38: 41: 42: 43: 44: 45:CASE 46: 47: 48: 49: 50: 51: 52: 53:CASE 54: 55: 56: 57: 58: 59: 60: 61:CASE 62: 63: 64: 65: 66: 67: 68: 69:CASE 70: 71: 72: 73: 74: 75: 76: 77:CASE 78: 79: 80:ENDMODULE
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1