您好,欢迎访问三七文档
1码垛工作站案例分析1、IO单元信号定义DSQC652IO单元2、系统信号的关联3、程序数据PERSwobjdataWobjPallet_L:=[FALSE,TRUE,,[[-456.216,-2058.49,-233.373],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];PERSwobjdataWobjPallet_R:=[FALSE,TRUE,,[[-421.764,1102.39,-233.373],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];PERStooldatatGripper:=[TRUE,[[0,0,527],[1,0,0,0]],[20,[0,0,150],[1,0,0,0],0,0,0]];PERSloaddataLoadFull:=[20,[0,0,300],[1,0,0,0],0,0,0.1];PERSwobjdataCurWobj;PERSjointtargetjposHome:=[[0,0,0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];CONSTrobtargetpPlaceBase0_L:=[[296.473529255,212.21064316,3.210904169],[0,0.70711295,-0.707100612,0],[-2,0,-3,0],[9E9,9E9,9E9,9E9,9E9,9E9]];CONSTrobtargetpPlaceBase90_L:=[[218.407102669,695.953395421,3.210997808],[0,-0.000001669,1,0],[-2,0,-2,0],[9E9,9E9,9E9,9E9,9E9,9E9]];CONSTrobtarget2pPlaceBase0_R:=[[296.473529255,212.21064316,3.210904169],[0,0.707221603,-0.70699194,0],[1,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];CONSTrobtargetpPlaceBase90_R:=[[218.407102669,695.953395421,3.210997808],[0,-0.00038594,0.999999926,0],[1,0,1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];CONSTrobtargetpPick_L:=[[1627.550991372,-426.974661352,-26.736921885],[0,0.707109873,-0.707103689,0],[-1,0,-2,0],[9E9,9E9,9E9,9E9,9E9,9E9]];CONSTrobtargetpPick_R:=[[1611.055992534,442.364097921,-26.736584068],[0,0.707220363,-0.706993181,0],[0,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];CONSTrobtargetpHome:=[[1505.00,-0.00,878.55],[1.28548E-06,0.707107,-0.707107,-1.26441E-06],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];PERSrobtargetpPlaceBase0;PERSrobtargetpPlaceBase90;PERSrobtargetpPick;PERSrobtargetpPlace;PERSrobtargetpPickSafe;PERSnumnCycleTime:=3.263;PERSnumnCount_L:=9;PERSnumnCount_R:=13;PERSnumnPallet:=1;PERSnumnPalletNo:=2;PERSnumnPickH:=300;PERSnumnPlaceH:=400;PERSnumnBoxL:=605;PERSnumnBoxW:=405;PERSnumnBoxH:=300;VARclockTimer1;PERSboolbReady:=TRUE;PERSboolbPalletFull_L:=FALSE;PERSboolbPalletFull_R:=FALSE;PERSboolbGetPosition:=TRUE;VARtriggdataHookAct;VARtriggdataHookOff;VARintnumiPallet_L;VARintnumiPallet_R;PERSspeeddatavMinEmpty:=[2000,400,6000,1000];PERSspeeddatavMidEmpty:=[3000,400,6000,1000];PERSspeeddatavMaxEmpty:=[5000,500,6000,1000];PERSspeeddatavMinLoad:=[1000,200,6000,1000];PERSspeeddatavMidLoad:=[2500,500,6000,1000];PERSspeeddatavMaxLoad:=[4000,500,6000,1000];PERSnumCompensation{15,3}:=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]];4.主程序PROCmain()rInitAll;WHILETRUEDOIFbReadyTHENrPick;rPlace;ENDIFrCycleCheck;3ENDWHILEENDPROC5.其他例行程序PROCrInitAll()rCheckHomePos;ConfL\OFF;ConfJ\OFF;nCount_L:=1;nCount_R:=1;nPallet:=1;nPalletNo:=1;bPalletFull_L:=FALSE;bPalletFull_R:=FALSE;bGetPosition:=FALSE;Resetdo00_ClampAct;Resetdo01_HookAct;ClkStopTimer1;ClkResetTimer1;TriggEquipHookAct,100,0.1\DOp:=do01_HookAct,1;TriggEquipHookOff,100\Start,0.1\DOp:=do01_HookAct,0;IDeleteiPallet_L;CONNECTiPallet_LWITHtEjectPallet_L;ISignalDIdi02_PalletInPos_L,0,iPallet_L;IDeleteiPallet_R;CONNECTiPallet_RWITHtEjectPallet_R;ISignalDIdi03_PalletInPos_R,0,iPallet_R;ENDPROCPROCrPick()ClkResetTimer1;ClkStartTimer1;rCalPosition;MoveJOffs(pPick,0,0,nPickH),vMaxEmpty,z50,tGripper\WObj:=wobj0;MoveLpPick,vMinLoad,fine,tGripper\WObj:=wobj0;Setdo00_ClampAct;Waittime0.3;GripLoadLoadFull;TriggLOffs(pPick,0,0,nPickH),vMinLoad,HookAct,z50,tGripper\WObj:=wobj0;MoveLpPickSafe,vMaxLoad,z100,tGripper\WObj:=wobj0;ENDPROCPROCrPlace()MoveJOffs(pPlace,0,0,nPlaceH),vMaxLoad,z50,tGripper\WObj:=CurWobj;TriggLpPlace,vMinLoad,HookOff,fine,tGripper\WObj:=CurWobj;Resetdo00_ClampAct;Waittime0.3;GripLoadLoad0;MoveLOffs(pPlace,0,0,nPlaceH),vMinEmpty,z50,tGripper\WObj:=CurWobj;rPlaceRD;MoveJpPickSafe,vMaxEmpty,z50,tGripper\WObj:=wobj0;4ClkStopTimer1;nCycleTime:=ClkRead(Timer1);ENDPROCPROCrCycleCheck()TPErase;TPWriteTheRobotisrunning!;TPWriteLastcycletimeis:\Num:=nCycleTime;TPWriteThenumberoftheBoxesintheLeftpalletis:\Num:=nCount_L-1;TPWriteThenumberoftheBoxesintheRightpalletis:\Num:=nCount_R-1;IF(bPalletFull_L=FALSEANDdi02_PalletInPos_L=1ANDdi00_BoxInPos_L=1)OR(bPalletFull_R=FALSEANDdi03_PalletInPos_R=1ANDdi01_BoxInPos_R=1)THENbReady:=TRUE;ELSEbReady:=FALSE;WaitTime0.1;ENDIFENDPROCPROCrCalPosition()bGetPosition:=FALSE;WHILEbGetPosition=FALSEDOTESTnPalletCASE1:IFbPalletFull_L=FALSEANDdi02_PalletInPos_L=1ANDdi00_BoxInPos_L=1THENpPick:=pPick_L;pPlaceBase0:=pPlaceBase0_L;pPlaceBase90:=pPlaceBase90_L;CurWobj:=WobjPallet_L;pPlace:=pPattern(nCount_L);bGetPosition:=TRUE;nPalletNo:=1;ELSEbGetPosition:=FALSE;ENDIFnPallet:=2;CASE2:IFbPalletFull_R=FALSEANDdi03_PalletInPos_R=1ANDdi01_BoxInPos_R=1THENpPick:=pPick_R;pPlaceBase0:=pPlaceBase0_R;pPlaceBase90:=pPlaceBase90_R;CurWobj:=WobjPallet_R;pPlace:=pPattern(nCount_R);bGetPosition:=TRUE;nPalletNo:=2;ELSEbGetPosition:=FALSE;ENDIFnPallet:=1;DEFAULT:5TPERASE;TPWRITEThedata'nPallet'iserror,pleasecheckit!;Stop;ENDTESTENDWHILEENDPROCFUNCrobtargetpPattern(numnCount)VARrobtargetpTarget;IFnCount=1ANDnCount=5THENpPickSafe:=Offs(pPick,0,0,400);ELSEIFnCount=6ANDnCount=10THENpPickSafe:=Offs(pPick,0,0,600);ELSEIFnCount=11ANDnCount=15THENpPickSaf
本文标题:码垛案例分析
链接地址:https://www.777doc.com/doc-5340273 .html