It resumes the motion that was in progress when the mode was switched to teach. Once the motion is finished, it enters the interrupt routine IR_SECURITY
Posts by Amirag
-
-
Hello, I'm working with a KR16 robot and I've been trying to interrupt the current movement with the brake instruction inside an interrupt routine. This is done in case the robot is moved in T1 or T2 mode, then the operation is to be resumed after changing to external mode only after receiving a boolean value at the input 137.
I made some modifications to the cell.src program to look like this:
DEF CELL ( )
EXT IR_SECURITY ( ) ; <--- Modification;FOLD INIT
DECL CHAR DMY[3]
DMY[]="---"
INTERRUPT DECL 4 WHEN $EXT == TRUE DO IR_SECURITY ( ) ; <--- Modification
INTERRUPT ON 4 ; <--- Modification
;ENDFOLD (INIT);FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI);FOLD AUTOEXT INI
P00 (#INIT_EXT,#PGNO_GET,DMY[],0 ) ; Initialize extern mode
;ENDFOLD (AUTOEXT INI)LOOP
P00 (#EXT_PGNO,#PGNO_GET,DMY[],0 )
SWITCH PGNO ; Select with ProgramnumberCASE 1
P00 (#EXT_PGNO,#PGNO_ACKN,DMY[],0 ) ; Reset Progr.No.-Request
routine1 ( ) ; Call User-Program
CASE 2
P00 (#EXT_PGNO,#PGNO_ACKN,DMY[],0 ) ; Reset Progr.No.-Request
routine2 ( ) ; Call User-Program
.
.
.
DEFAULT
P00 (#EXT_PGNO,#PGNO_FAULT,DMY[],0 )
ENDSWITCH
ENDLOOP
ENDCreated the following routine (IR_SECURITY.src):
DEF IR_SECURITY ( )
BRAKE ;Stop robot movement
WAIT FOR $IN[137] == TRUE ;Wait for PLC input
ENDSo, when it is changed to external mode it automatically resumes the current movement and enters the interrupt routine IR_SECURITY only after finishing this movement (in routine1, routine2, etc.). I was wondering if anyone could enlighten me as to what the problem is. Thanks in advance.