Hello All,
Can someone tell me how to put a loop / repeat instruction into a program on KRC v8.3 ?
Hello All,
Can someone tell me how to put a loop / repeat instruction into a program on KRC v8.3 ?
Program must not be selected, you must 'open"itin the editor. Then you can type in the loop/endloop as usual.
And login as Expert
KRL has several Loop constructs:
; non-rejecting loop, always runs at least once
REPEAT
UNTIL (boolean expression is True)
; rejecting loop -- only runs if the boolean expression is True
WHILE (boolean expression)
ENDWHILE
; endless Loop, no escape except using EXIT or RETURN
LOOP
IF (boolean expression) THEN
EXIT
ENDIF
ENDLOOP
FOR (integer variable)=(start value) TO (end value) STEP (increment)
ENDFOR
And there's also the GOTO command, which is a direct "jump to line", and can work as a loop:
My_Goto_Label:
GOTO My_Goto_Label
Procedures loop
Display MoreKRL has several Loop constructs:
; non-rejecting loop, always runs at least once
REPEAT
UNTIL (boolean expression is True)
; rejecting loop -- only runs if the boolean expression is True
WHILE (boolean expression)
ENDWHILE
; endless Loop, no escape except using EXIT or RETURN
LOOP
IF (boolean expression) THEN
EXIT
ENDIF
ENDLOOP
FOR (integer variable)=(start value) TO (end value) STEP (increment)
ENDFOR
And there's also the GOTO command, which is a direct "jump to line", and can work as a loop:
My_Goto_Label:
GOTO My_Goto_Label
Is it not possible to make the "end value" a variable? Whenever I try and write that as a variable it gets mad and then when i try and do it from the pendant it says it must be an interger.
So i guess my question is what should I do to make the end value variable? I want my operator to be able to put in the amount of times it wants the robot to cycle through the routine i've written.
Typo, UNTILE -->UNTIL