&ACCESS RVP1
&REL 323
&COMMENT Dach ablegen
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM EDITMASK = *
DEF ba_zt2( )
;FOLD INI
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD SPOTTECH INI
USERSPOT(#INIT)
;ENDFOLD (SPOTTECH INI)
;FOLD GRIPPERTECH INI
USER_GRP(0,DUMMY,DUMMY,GDEFAULT)
;ENDFOLD (GRIPPERTECH INI)
;FOLD USER INI
;Make your modifications here
;ENDFOLD (USER INI)
;ENDFOLD (INI)
; ===================================
;[ Unterprogramm Bauteil ablegen ]
;[Progra.ablauf Glasdach V212 ablegen]
; ===================================
;FOLD WAIT FOR ( IN 164 'FG zt2' );%{PE}%R 5.5.32,%MKUKATPBASIS,�XT_WAIT_FOR,%VEXT_WAIT_FOR,%P 2:, 4:, 5:$IN, 6:164, 7:FG zt2, 9:
WAIT FOR ( $IN[164] )
;ENDFOLD
;FOLD OUT 164 'PF zt2' State=FALSE ;%{PE}%R 5.5.32,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:164, 3:PF zt2, 5:FALSE, 6:
$OUT[164]=FALSE
;ENDFOLD4
interrupt on 22 在下件程序中,开启优先级为22的中断函数,该中断接收来自PLC的164信号,当下件台开关按下,或者安全光幕被遮挡,则PLC发出164信号给机器人,机器人调用中断,执行刹车。
;Bewegung zur Ausgabe
;FOLD PTP P31 CONT Vel=100 % PDAT5 Tool[10]:Gripper1 Base[0];%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P31, 3:C_PTP, 5:100, 7:PDAT5
$BWDSTART=FALSE
PDAT_ACT=PPDAT5
FDAT_ACT=FP31
BAS(#PTP_PARAMS,100)
PTP XP31 C_PTP
;ENDFOLD
;FOLD LIN P34 CONT Vel=0.2 m/s PDAT18 Tool[10]:Gripper1 Base[0];%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P34, 3:C_DIS, 5:0.2, 7:PDAT18
$BWDSTART=FALSE
LDAT_ACT=LPDAT18
FDAT_ACT=FP34
BAS(#CP_PARAMS,0.2)
LIN XP34 C_DIS
;ENDFOLD
;FOLD OUT 162 'Ausgang' State=TRUE CONT;%{PE}%R 5.5.32,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:162, 3:Ausgang, 5:TRUE, 6:CONTINUE
CONTINUE
$OUT[162]=TRUE 判断胶型指示灯的输出
;ENDFOLD
;FOLD WAIT FOR NOT ( IN 162 'Eingang' );%{PE}%R 5.5.32,%MKUKATPBASIS,�XT_WAIT_FOR,%VEXT_WAIT_FOR,%P 2:NOT, 4:, 5:$IN, 6:162, 7:Eingang, 9:
WAIT FOR NOT ( $IN[162] ) 判断胶型指示灯的输入
;ENDFOLD
;FOLD OUT 162 'Ausgang' State=FALSE CONT;%{PE}%R 5.5.32,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:162, 3:Ausgang, 5:FALSE, 6:CONTINUE
CONTINUE
$OUT[162]=FALSE 复位胶型指示灯
;ENDFOLD
;FOLD PTP P25 CONT Vel=100 % PDAT35 Tool[10]:Gripper1 Base[0];%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P25, 3:C_PTP, 5:100, 7:PDAT35
$BWDSTART=FALSE
PDAT_ACT=PPDAT35
FDAT_ACT=FP25
BAS(#PTP_PARAMS,100)
PTP XP25 C_PTP
;ENDFOLD
;FOLD PTP P26 CONT Vel=100 % PDAT36 Tool[10]:Gripper1 Base[2]:Output Station;%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P26, 3:C_PTP, 5:100, 7:PDAT36
$BWDSTART=FALSE
PDAT_ACT=PPDAT36
FDAT_ACT=FP26
BAS(#PTP_PARAMS,100)
PTP XP26 C_PTP
;ENDFOLD
;FOLD PTP P18 CONT Vel=100 % PDAT37 Tool[10]:Gripper1 Base[2]:Output Station;%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P18, 3:C_PTP, 5:100, 7:PDAT37
$BWDSTART=FALSE
PDAT_ACT=PPDAT37
FDAT_ACT=FP18
BAS(#PTP_PARAMS,100)
PTP XP18 C_PTP
;ENDFOLD
;FOLD LIN P17 Vel=0.15 m/s PDAT3 Tool[10]:Gripper1 Base[2]:Output Station;%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P17, 3:, 5:0.15, 7:PDAT3
$BWDSTART=FALSE
LDAT_ACT=LPDAT3
FDAT_ACT=FP17
BAS(#CP_PARAMS,0.15)
LIN XP17
;ENDFOLD
interrupt off 20
interrupt off 21
;FOLD WAIT Time=0.5 sec;%{PE}%R 5.5.32,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 2:0.5
WAIT SEC 0.5
;ENDFOLD
_Abbl_kl ( ) 小件吹
_Abbl_gr ( ) 大件吹
;FOLD LIN P21 Vel=0.5 m/s PDAT6 Tool[10]:Gripper1 Base[2]:Output Station;%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P21, 3:, 5:0.5, 7:PDAT6
$BWDSTART=FALSE
LDAT_ACT=LPDAT6
FDAT_ACT=FP21
BAS(#CP_PARAMS,0.5)
LIN XP21
;ENDFOLD
;Frei fahren
_Vak_kl_aus ( ) 抓手复位
_Vak_gr_aus ( ) 抓手复位
;warte auf bauteil kontrolle
;FOLD WAIT FOR ( IN 1 'TK kl nicht vorh' ) AND ( NOT IN 2 'TK kl vorh' ) AND ( IN 3 'TK gr nicht vorh' ) AND ( NOT IN 4 'TK gr vorh' );%{PE}%R 5.5.32,%MKUKATPBASIS,�XT_WAIT_FOR,%VEXT_WAIT_FOR,%P 2:, 4:, 5:$IN, 6:1, 7:TK kl nicht vorh, 9:AND, 10:, 12:NOT, 13:$IN, 14:2, 15:TK kl vorh, 17:AND, 18:, 20:, 21:$IN, 22:3, 23:TK gr nicht vorh, 25:AND, 26:, 28:NOT, 29:$IN, 30:4, 31:TK gr vorh, 33:
WAIT FOR ( $IN[1] ) AND ( NOT $IN[2] ) AND ( $IN[3] ) AND ( NOT $IN[4] )
;ENDFOLD
;FOLD OUT 167 'DT gr gegriffen' State=FALSE ;%{PE}%R 5.5.32,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:167, 3:DT gr gegriffen, 5:FALSE, 6:
$OUT[167]=FALSE 放件完成
;ENDFOLD
;FOLD OUT 166 'DT kl gegriffen' State=FALSE ;%{PE}%R 5.5.32,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:166, 3:DT kl gegriffen, 5:FALSE, 6:
$OUT[166]=FALSE 放件完成
;ENDFOLD
;FOLD OUT 165 'GFE_zyl_runter' State=TRUE ;%{PE}%R 5.5.32,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:165, 3:GFE_zyl_runter, 5:TRUE, 6:
$OUT[165]=TRUE 小件有气缸 暂无用!
;ENDFOLD
;zurueck to home
;FOLD PTP P28 CONT Vel=100 % PDAT38 Tool[10]:Gripper1 Base[0];%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P28, 3:C_PTP, 5:100, 7:PDAT38
$BWDSTART=FALSE
PDAT_ACT=PPDAT38
FDAT_ACT=FP28
BAS(#PTP_PARAMS,100)
PTP XP28 C_PTP
;ENDFOLD
;FOLD PTP P32 CONT Vel=100 % PDAT22 Tool[10]:Gripper1 Base[0];%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P32, 3:C_PTP, 5:100, 7:PDAT22
$BWDSTART=FALSE
PDAT_ACT=PPDAT22
FDAT_ACT=FP32
BAS(#PTP_PARAMS,100)
PTP XP32 C_PTP
;ENDFOLD
continue
interrupt off 22 在下件程序中,关闭优先级为22的中断函数,该中断接收来自PLC的164信号,当下件台开关按下,或者安全光幕被遮挡,则PLC发出164信号给机器人,机器人调用中断,执行刹车。
;FOLD OUT 164 'PF zt2' State=TRUE CONT;%{PE}%R 5.5.32,%MKUKATPBASIS,%COUT,%VOUTX,%P 2:164, 3:PF zt2, 5:TRUE, 6:CONTINUE
CONTINUE
$OUT[164]=TRUE 放完件,回原点
;ENDFOLD
;FOLD PTP P29 CONT Vel=100 % PDAT19 Tool[10]:Gripper1 Base[0];%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P29, 3:C_PTP, 5:100, 7:PDAT19
$BWDSTART=FALSE
PDAT_ACT=PPDAT19
FDAT_ACT=FP29
BAS(#PTP_PARAMS,100)
PTP XP29 C_PTP
;ENDFOLD
;FOLD PTP P33 CONT Vel=100 % PDAT23 Tool[10]:Gripper1 Base[0];%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P33, 3:C_PTP, 5:100, 7:PDAT23
$BWDSTART=FALSE
PDAT_ACT=PPDAT23
FDAT_ACT=FP33
BAS(#PTP_PARAMS,100)
PTP XP33 C_PTP
;ENDFOLD
;FOLD PTP HOME CONT Vel=100 % DEFAULT;%{PE}%R 5.5.32,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:C_PTP, 5:100, 7:DEFAULT
$BWDSTART=FALSE
PDAT_ACT=PDEFAULT
FDAT_ACT=FHOME
BAS(#PTP_PARAMS,100)
$H_POS=XHOME
PTP XHOME C_PTP
;ENDFOLD
END