Controller: KRC4
WV: V3.1.8_Build22
I have searched the forum's and followed what I have found here as well as what I could find in the Systems Integrator manual for programming Interrupts.
By what I can see these 2 interrupts should work, but neither is triggered.
We are using a vacuum sensor on $IN[82] and a Prox sensor on $IN[81].
I have tested both of them outside of this program and they both show as working on the teach pendents I/O display.
When I run the below program the Vacuum sensor triggers but it does not start the interrupt. I have manually triggered the Prox sensor to show true by placing an object infront of it and it doesnt trigger its interrupt either
Any help anyone can provide me would be very much appreciated
Code
DEF AcrylicFramePickup ( )
;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 USER INI
;Make your modifications here
INTERRUPT DECL 20 WHEN $IN[82] == TRUE DO SheetFound()
INTERRUPT DECL 21 WHEN $IN[81] == TRUE DO NoSheetFound ()
;ENDFOLD (USER INI)
;ENDFOLD (INI)
$ADVANCE = 0
INTERRUPT ON 20
INTERRUPT ON 21
FindSheet ( )
$BASE = Base_Data[1]
$Tool = Tool_Data[8]
SLIN {X -3140, Y 256, Z -350, A -90, B 7.75, C -179.93} WITH $VEL.cp = .1
HALT
END
DEF FindSheet ()
;FOLD SPTP P1 Vel=10 % PDAT1 Tool[8]:VacHead Base[1]:InspectionStation;%{PE}%R 8.3.31,%MKUKATPBASIS,%CSPLINE,%VSPTP_SB,%P 1:SPTP_SB, 2:P1, 3:, 5:10, 7:PDAT1
SPTP XP1 WITH $VEL_AXIS[1]= SVEL_JOINT( 10), $TOOL= STOOL2( FP1), $BASE= SBASE( FP1.BASE_NO),$IPO_MODE= SIPO_MODE( FP1.IPO_FRAME), $LOAD= SLOAD( FP1.TOOL_NO), $ACC_AXIS[1]= SACC_JOINT( PPDAT1), $GEAR_JERK[1]= SGEAR_JERK( PPDAT1)
;ENDFOLD
$BASE = Base_Data[1]
$Tool = Tool_Data[8]
SLIN {X -3140, Y 256, Z -700, A -90, B 7.75, C -179.93} WITH $VEL.cp = .1
$OUT[49] = TRUE
$OUT[57] = TRUE
SLIN {X -3140, Y 256, Z -30, A -90, B 7.75, C -179.93} WITH $VEL.cp = .01
;$APO.CVEL = 1
;LIN_REL {Z 30} C_VEL
;DEF_APO_CVEL = 100
END
DEF SheetFound ()
DECL INT ClampCount
ClampCount = 0
$BASE = Base_Data[1]
$Tool = Tool_Data[8]
WAIT SEC 5
$OUT[17] = TRUE
LOOP
IF $IN[33] AND $IN[35] AND $IN[37] AND $IN[39] == TRUE THEN
RETURN
ELSE
ClampCount = ClampCount + 1
ENDIF
IF ClampCount == 10 THEN
$OUT[49] = FALSE
$OUT[50] = TRUE
WAIT SEC 10
SLIN {X -3140, Y 256, Z 300, A -90, B 7.75, C -179.93} WITH $VEL.cp = .1
; NEED TO SEND SIGNAL TO PLC HERE
ENDIF
ENDLOOP
$OUT[17] = FALSE
WAIT FOR $IN[82] == TRUE
RESUME
END
DEF NoSheetFound()
HALT
END
Display More