I have recently discovered this forum and it seems like a great place to get some advice on KRL programming basics. I have used Fanuc and ABB robots in the past but I will soon be commissioning my first KUKA Pick and Place Robot. In an effort to understand the advance run style of programming I have inserted a code sample here for a typical Pick and Place operation and I was hoping that some of you Kuka experts can tell me if I'm on the right track.
I have used the CONTINUE instruction twice in the example code. The first time is when I want the robot to pause at pPlacePounce if diPlaceReady==FALSE but continue to the Place position without hesitation if diPlaceReady==TRUE. Will This work?
The second time I used CONTINUE is at the decision point where I decide to go home OR go back to the pick position. IF diPickReady==TRUE I want the robot to move straight back to the Pick Position without any hesitation through the air moves. IF diPickReady==FALSE I want the robot to move to a home position without hesitation through the air moves. Will this work?
DEF PickNPlace()
PTP $POS_ACT C_PTP
REPEAT
;Move to Pick
PTP pPickPosAppr C_PTP
TRIGGER WHEN DISTANCE = 1 DELAY = -250 DO PULSE(doCloseGripper,TRUE,1)
LIN pPickPos
WAIT FOR diGripperClosed
LIN pPickPosAppr C_DIS
;Move to a Position Ready To Pounce IF the Place Destination is NOT Ready
;Continue without hesitation IF the Place Destination is Ready
PTP pPlacePounce C_PTP
CONTINUE
IF NOT diPlaceReady THEN
WAIT FOR diPlaceReady
ENDIF
;Move to Place
PTP pPlacePosAppr C_PTP
TRIGGER WHEN DISTANCE = 1 DELAY = -250 DO PULSE(doOpenGripper,TRUE,1)
LIN pPlacePos
WAIT FOR diGripperOpen
PTP pPlacePosAppr C_PTP
PTP pPlacePounce C_PTP
;Continue back to Pick without hesitation IF the Pick Position is Ready
CONTINUE
UNTIL NOT diPickReady
;Go Home without hesitation IF the Pick Position is NOT Ready
PTP pHome
WAIT SEC 0
RETURN
END
Display More
Thanks for taking the time to review my questions. I look forward to any comments or advice in my effort to understand this language a bit better before my first Kuka robot project appears on our shop floor.
Cheers!