Hi,
I want to move without advance run stop to F_MOVEDOWN position.
Pseudo code:
PTP to F_MOVE2 C_PTP
PTP to F_PICK C_PTP
start interrupts
PTP to F_MOVEDOWN and stop when interrupts are triggered and Z position is saved to F_TEMP.Z
but the problem is I want to move with C_PTP between F_PICK an F_MOVEDOWN.
Interrupt ON is stopping ADVANCE run.
Is there a possibility to run INTERRUPT ON somehow between two movements without stopping advance run?
I tried to just add function and running:
CONTINUE
interrupt on etc.
but I'm worried that interrupt will be triggered before ptp to F_PICK movement end and there will be collision.
Any suggestions?
Here is the code:
Code
INTERRUPT DECL 21 WHEN $CYCFLAG[1] == FALSE DO IR_MOVESTOP()
INTERRUPT DECL 22 WHEN I_HSENS == FALSE DO IR_MOVESTOP()
go to pick pos but dont change z
;FOLD PTP F_MOVE2 Tool[1] Base[1]
$BWDSTART = FALSE
PDAT_ACT=PPDATMAX
BAS(#PTP_DAT)
FDAT_ACT=FB1
BAS(#FRAMES)
BAS(#VEL_PTP,100)
PTP F_MOVE2 C_PTP
;ENDFOLD
;FOLD PTP F_PICK Tool[1] Base[1]
$BWDSTART = FALSE
PDAT_ACT=PPDATMAX
BAS(#PTP_DAT)
FDAT_ACT=FB1
BAS(#FRAMES)
BAS(#VEL_PTP,100)
PTP F_PICK
;ENDFOLD
;**********************************************
;******** LIN F_MOVEDOWN **********************
;**********************************************
F_TEMP.Z = 0
INTERRUPT ON 21; $CYCFLAG[1]
INTERRUPT ON 22; $I_HSENS
MOVEDOWN()
INTERRUPT OFF 22
INTERRUPT OFF 21
$ADVANCE = 3
Display More
Code
DEF MOVEDOWN()
;FOLD LIN F_MOVEDOWN
$BWDSTART = FALSE
LDAT_ACT=LCPDATMAX
BAS(#CP_DAT)
FDAT_ACT=FB1
BAS(#FRAMES)
BAS(#VEL_CP,0.3)
ENDIF
LIN F_MOVEDOWN
;ENDFOLD
$ADVANCE = 0
END
;********* INTERRUPT FROM SENSORS**************
DEF IR_MOVESTOP()
INTERRUPT OFF 21
INTERRUPT OFF 22
BRAKE
F_TEMP = $POS_INT
RESUME
END
Display More