Hello,
I am trying to rewrite the trajectory of my robot using the Interrupt function Can this code work.
the robot stop move but this trajectory don't change.
i chearch for change the points of xpt_app2 and xpt_laying during the phase interrup.
sorry my english is very bad
thanks,
this new code:
DEF Robot_Evac()
DECL INT M_Prestack_Height
INTERRUPT OFF 4
M_Pallet_Height=X_Pallet_Height
X_Stack_Height=M_Pallet_Height
;Prestack memorizing
M_Prestack_Height=X_Prestack_Height
Xpt_App2_Laying.Z=(X_Stack_Height+50)+X_Laying_Offset_Z
IF Xpt_App2_Laying.Z<150 THEN
Xpt_App2_Laying.Z=150
ENDIF
Xpt_Laying.Z=X_Stack_Height
IF Xpt_Laying.Z<110 THEN
Xpt_Laying.Z=110
ENDIF
IF ((X_Stack_Height+M_Prestack_Height+100)>(660+X_Taking_Offset_Z)) THEN ;F_RefPoint_Post331.Z - F_RefPoint_Post381.Z = 660mm
IF ((X_Stack_Height+M_Prestack_Height)<=K_Max_Height_Moving) THEN
Xpt_Rem_Laying.Z=(X_Stack_Height+M_Prestack_Height+100)
ELSE
Xpt_Rem_Laying.Z=(X_Stack_Height+100)
ENDIF
ELSE
Xpt_Rem_Laying.Z=(660+X_Taking_Offset_Z)
ENDIF
F_RefOffset_Post381=$NULLFRAME
F_RefOffset_Post381.X=((K_Post381_Distance_Stop[X_Stop_Number_Post381]-(X_Pallet_Length/2))+X_Taking_Offset_X)+X_Laying_Offset_X ;Limitation of the offset to avoid collisions
IF (F_RefOffset_Post381.X<-250) THEN
F_RefOffset_Post381.X=-250
ENDIF
F_RefOffset_Post381.Y=X_Laying_Offset_Y
F_RefOffset_Post381.A=X_Laying_Offset_A
;Base and tool assignment
BASE_DATA[3]= F_RefPoint_Post381:F_RefOffset_Post381
BAS (#BASE,3)
BAS (#TOOL,1)
;Movements datas loading
$APO.CDIS=200
BAS(#VEL_CP,0.5)
BAS(#ACC_CP,50)
BAS(#VEL_PTP,25)
BAS(#ACC_PTP,50)
BRAKE
HALT
WAIT FOR NOT X_Robot_Evac
INTERRUPT ON 4
WAIT SEC 1
END