as the title,i really want to use a interrupt like this:
the main program is in a loop where every 1 second to show something like $pos_act in pedant.
and when the interrupt is on(by ethernet xml),the subprogram B is called,in B, use LIN_REL to move up 10mm.then stop in its moved position,and return to main program.
i wrote the src program,but the pedant tell me "repostion error",can you give some suggestion?i will be very glad to hear your advice.thank you.
this is code:
Code
&ACCESS RVP
&REL 6
&PARAM SensorITMASK = *
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM DISKPATH = KRC:\R1\Program
DEF FinalXML( )
REAL temp
BOOL GIsLoop
DECL EKI_STATUS RET
GIsLoop=TRUE
temp=0;
BAS (#INITMOV,0 )
INTERRUPT DECL 89 WHEN $FLAG[998]==TRUE DO GET_DATA()
INTERRUPT ON 89
$BWDSTART = FALSE
PDAT_ACT = {VEL 15,ACC 30,APO_DIST 50}
FDAT_ACT = {TOOL_NO 1,BASE_NO 1,IPO_FRAME #BASE}
BAS (#PTP_PARAMS,10)
PTP {A1 20, A2 -70, A3 132, A4 24, A5 -64, A6 29, E1 0, E2 0, E3 0, E4 0}
$VEL.CP=0.25
$APO.CDIS=1.5
$ADVANCE=3
PTP {E6POS: X 431.593, Y -203.802, Z 223.299, A 0, B 90, C 0, E1 0, E2 0, E3 0, E4 0, S 'B 110'} C_PTP
LIN {E6POS: X 431.593, Y -203.802, Z 223.299, A 0, B 90, C 0, E1 0, E2 0, E3 0, E4 0} C_DIS
RET=EKI_Init("FinalXML")
RET=EKI_Open("FinalXML")
EKI_CHECK(RET,#QUIT)
WHILE GIsLoop==TRUE
RET=EKI_SetReal("FinalXML","Robot/Data/RealA", temp)
temp=temp+1
RET = EKI_Send("FinalXML","Robot")
WAIT SEC 1
ENDWHILE
RET=EKI_Close("FinalXML")
RET=EKI_Clear("FinalXML")
END
;;===============================================
DEF GET_DATA()
DECL EKI_STATUS RET
REAL valueReal
FRAME valueFrame
$FLAG[998]=FALSE
valueReal=0.0
valueFrame={X 0.0,Y 0.0,A 0.0,B 0.0,C 0.0}
;RET=EKI_GetReal("FinalXML","Command/RealA",valueReal)
;valueFrame.Z=valueReal
valueFrame.Z=10
LIN_REL valueFrame
END
Display More