Hi lads,
I'm fairly new to kuka. I need to use an Interrupt in my program so I've looked into the manual and made a test program. I'm using a IN1 from my PLC to trigger the Interrupt. It's been working well but after I've introduced LIN $POS_INT after my BRAKE command the robot generates REPOSITION error and I have to clear it and then press the "play" button twice before the moves continue.
Without the LIN $POS_INT the robot resumes the move immediately after the IN1=false which is what I want.
Am I doing something wrong or is there a sequence of signals from the PLC that needs to be done?
I'm testing the whole thing in T1.
I'll be happy for any help, thanks.
Here's the code
------------------------------------------------------------------------------------------------
DEF interruptTest_Main( )
INTERRUPT DECL 1 WHEN $IN[1] DO interruptTest_Wait( )
SPTP HOME1 Vel=100 % DEFAULT
SLIN P1 Vel=2 m/s CPDAT1 Tool[3]:T3_BASE_SPIKE Base[1]:C_RADIAL_BASE
interruptTest_Path( )
SPTP HOME1 Vel=100 % DEFAULT
END
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
DEF interruptTest_Path( )
DECL INT i
i=1
INTERRUPT ON 1 ;activate Interrupt 1
FOR i=1 TO 3 STEP 1
;FOLD SLIN P2 CONT Vel=2 m/s CPDAT2 Tool[3]:T3_BASE_SPIKE Base[1]:C_RADIAL_BASE
;FOLD SLIN P3 CONT Vel=2 m/s CPDAT2 Tool[3]:T3_BASE_SPIKE Base[1]:C_RADIAL_BASE
;FOLD SLIN P4 CONT Vel=2 m/s CPDAT2 Tool[3]:T3_BASE_SPIKE Base[1]:C_RADIAL_BASE
;FOLD SLIN P5 CONT Vel=2 m/s CPDAT2 Tool[3]:T3_BASE_SPIKE Base[1]:C_RADIAL_BASE
;FOLD SLIN P6 CONT Vel=2 m/s CPDAT2 Tool[3]:T3_BASE_SPIKE Base[1]:C_RADIAL_BASE
ENDFOR
WAIT FOR TRUE
END
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
DEF interruptTest_Wait( )
INTERRUPT OFF 1;deactivate interrupt 1
BRAKE ;stop robot motors witha decel ramp
LIN $POS_INT
WAIT FOR NOT ( IN 1 'MillAtSpeed' )
END
------------------------------------------------------------------------------------------------