Hi everyone,
I have KUKA KRC4-8.6.4 Robot and Siemens S7-1200 PLC. My WorkVisual version is V6.0.16.
I have a problem about searching interrupt. I wrote searching interrupt and it has worked good but If the interrupt did not find the product at the end, I want to generate an error message and stop the running program. After this, I want to start searching interrupt program again.
How can I do this ?
I would be very happy if you help
Code
$CYCFLAG[1]=PulTuttum
INTERRUPT DECL 10 WHEN $CYCFLAG[1] DO StopSearch()
INTERRUPT OFF 10
BefPickPul.X = 0
BefPickPul.Y = 0
BefPickPul.Z = 600
BefPickPul.A = 180
BefPickPul.B = 0
BefPickPul.C = -180
b_partfound=FALSE
$ADVANCE=0
INTERRUPT ON 10
SearchPart()
INTERRUPT OFF 10
$ADVANCE=1
IF b_partfound THEN
iFoundProdNo = iFoundProdNo + 1
ELSE
iNotFoundProdNo = iNotFoundProdNo + 1
fault(40)
PulTut = FALSE
ENDIF
CONTINUE
END
DEF SearchPart()
BefPickPul.X = 0
BefPickPul.Y = 0
BefPickPul.Z = 0
BefPickPul.A = 180
BefPickPul.B = 0
BefPickPul.C = -180
MotionParams(#Linear,0.1,100,100,1,11)
PickPul = BefPickPul
PickPul.Z = 400
LIN PickPul C_DIS
END
DEF StopSearch()
INTERRUPT OFF 10
BRAKE
b_partfound=TRUE
PartPos=$POS_INT
RESUME
END
Display More