Hello to all, sorry for my bad english...
I have a problem using an interrupt.
On the robot I have a system of anti-collision, if It intervene, I must stop and go backward.
This is the function:
Code
INTERRUPT DECL 4 WHEN $IN[27]==TRUE DO ROADAFTERCOLLISION()
INTERRUPT ON 4
FOR contaPunti=1 TO (totalLandingPos)
CRASH_POINT=contaPunti
XAUX_GOING_PTP=landAxisPos[contaPunti]
;FOLD PTP AUX_GOING_PTP Vel=100 % AUX_GOING_PTP;%{PE}%R 8.2.20,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:AUX_GOING_PTP, 3:, 5:100, 7:AUX_GOING_PTP
$BWDSTART=FALSE
PDAT_ACT=PAUX_GOING_PTP
FDAT_ACT=FAUX_GOING_PTP
BAS(#PTP_PARAMS,100)
PTP XAUX_GOING_PTP C_PTP
;ENDFOLD
ENDFOR
INTERRUPT OFF 4
Display More
So i have an other function, in another file .src:
Code
DEF RoadAfterCollision()
INT ContaPunti
;----- TEST
;XAUX_POINT_PTP = $AXIS_INT
;BRAKE
;WAIT SEC 0.5
;RESUME
;----- TEST
;FOLD INI;%{PE}
;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
;ENDFOLD (USER INI)
;ENDFOLD (INI)
;=================================
;===== ROAD AFTER COLLISION ======
;=================================
TEST_IT=TRUE
FOR ContaPunti=1 TO (CRASH_POINT-1)
XAUX_POINT_PTP=departAxisPos[CRASH_POINT-ContaPunti]
;FOLD PTP AUX_POINT_PTP Vel=100 % AUX_POINT_PTP;%{PE}%R 8.2.20,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:AUX_POINT_PTP, 3:, 5:100, 7:AUX_POINT_PTP
$BWDSTART=FALSE
PDAT_ACT=PAUX_POINT_PTP
FDAT_ACT=FAUX_POINT_PTP
BAS(#PTP_PARAMS,100)
PTP XAUX_POINT_PTP C_PTP
;ENDFOLD
ENDFOR
WAIT SEC 5
RETURN
END
Display More
When my input 27 goes to 1 then the robot goes wrong and tells me that there is a programming error. I release the interrupt while the robot is moving, I tried to add the BRAKE and RESUME instructions, but without success.
Do you have any idea?
Thanks a lot in advance and if there are some unclear points tell me as well. Thanks again