1、ENDFOLD (BASISTECH INI)FOLD USER INIMake your modifications hereENDFOLD (USER INI)GLOBAL INTERRUPT DECL 4 WHEN $IN10=FALSE DO Itrpt1 ()GLOBAL INTERRUPT DECL 5 WHEN $IN11=FALSE DO Itrpt1 ()INTERRUPT DECL 6 WHEN $IN9=TRUE DO Itrpt1 ();地轨异常进入中断INTERRUPT ON 6;开地轨监视中断6IF NOT Gripper_ChkStatus(1,C) THEN G
2、ripper_SetStatus(1,O) Part0InLeft = FALSE Part2InLeft = FALSEENDIFIF NOT Gripper_ChkStatus(2, Gripper_SetStatus(2, Part1InRight = FALSEFOR l = 1 TO 14 $OUTl = FALSEENDFOR;此循环语句在初始化时把所有端口清零复位。IF $IN5 THEN Machine1_OnlyDrop = TRUE Machine2_OnlyDrop = TRUE;机台1有首件信号时,机台1与机台2第一次响应只放标志位置1ELSE Machine1_Onl
3、yDrop = FALSE Machine2_OnlyDrop = FALSE$FLAG8=FALSE;FLAG8是干什么用的?ENDFOLD (INI);初始化完成$OV_PRO=70;限定系统运行速度FOLD PTP HOME Vel=100 % DEFAULT;%PE%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT$BWDSTART=FALSEPDAT_ACT=PDEFAULTFDAT_ACT=FHOMEBAS(#PTP_PARAMS,100)$H_POS=XHOMEPTP XHOME
4、ENDFOLDIF $IN_HOME THEN $OUT5=FALSE $OUT8=FALSE $OUT11=FALSELOOP WAIT SEC 0.05 IF $IN1 AND NOT Part0InLeft AND Gripper_ChkStatus(3,) THEN ToPick_Search() ENDIF IF Part0InLeft AND ($IN3 OR Machine1_OnlyDrop) AND Gripper_ChkStatus(1,) AND Gripper_ChkStatus(2, Machine1() IF Part1InRight AND ($IN6 OR Ma
5、chine2_OnlyDrop) AND Gripper_ChkStatus(2,) AND Gripper_ChkStatus(1, Machine2() IF Part2InLeft AND ($IN8 OR Machine3_OnlyDrop) AND Gripper_ChkStatus(1, Machine3()ENDLOOPENDDEF Itrpt1 ()HALTBRAKE2、 取料程序(采用中断的方法自动探料,完成取料作业)ACCESS RVO2DEF ToPick_Search( ) GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS=TRUE DO I
6、R_STOPM ( );单独用了一个系统中断?ENDFOLD (INI)INTERRUPT DECL 1 WHEN $IN10=TRUE DO FOUND()SevenAxis_Run(1)GOTO MARKFOLD PTP P1 CONT Vel=100 % PDAT2 Tool1 Base0;P1, 3:C_DIS, 5:PDAT2PDAT_ACT=PPDAT2FDAT_ACT=FP1PTP XP1 C_DISFOLD PTP P3 CONT Vel=100 % PDAT8 Tool1 Base0;P3, 3:PDAT8PDAT_ACT=PPDAT8FDAT_ACT=FP3PTP XP3
7、C_DISFOLD LIN P2 CONT Vel=2 m/s CPDAT2 Tool1 Base0;%PE%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P2, 3:C_DIS C_DIS, 5:2, 7:CPDAT2LDAT_ACT=LCPDAT2FDAT_ACT=FP2BAS(#CP_PARAMS,2)LIN XP2 C_DIS C_DISFOLD LIN P1 Vel=0.05 m/s CPDAT1 Tool1 Base0;0.05, 7:CPDAT1LDAT_ACT=LCPDAT1BAS(#CP_PARAMS,0.05)LIN XP1
8、 mark:Search()INTERRUPT OFF 1WAIT SEC 0XP4=$POS_ACTFOLD LIN P4 CONT Vel=2 m/s CPDAT10 Tool1 Base0;P4, 3:CPDAT10LDAT_ACT=LCPDAT10FDAT_ACT=FP4LIN XP4 C_DIS C_DISGripper_SetStatus(1,LIN_RELZ 15LIN_RELZ -17Part0InLeft = TRUEXP0=$POS_ACTXP0.Z=XP0.Z+25 ;看一下寻料程序到底是怎么运转的!FOLD LIN P0 CONT Vel=0.025 m/s CPDAT
9、8 Tool1 Base0;P0, 3:0.025, 7:CPDAT8LDAT_ACT=LCPDAT8FDAT_ACT=FP0BAS(#CP_PARAMS,0.025)LIN XP0 C_DIS C_DISIF NOT $IN10 THEN GOTO markFOLD LIN P1 CONT Vel=2 m/s CPDAT7 Tool1 Base0;CPDAT7LDAT_ACT=LCPDAT7LIN XP1 C_DIS C_DISDEF Search( ) GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS=TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;INTERRUPT ON 1FOLD PTP P1 CONT Vel=100 % PDAT6 Tool1 Base0;PDAT6PDAT_ACT=PPDAT6PTP XP
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1