Hello,
Is there an easy way to use KRL-conditions (IF, SWITCH / CASE,...) and loops (FOR, WHILE, REPEAT,...) in KUKA|prc?
Simple example:
I want to run a series of LIN motions n times through a FOR-loop with counter variable and increase the Z-coordinates of each LIN per iteration (e.g. P.Z = n*100).
Thanks a lot!
Hi,
Sure, you can just use the Custom KRL component to insert the structure.
Just note that it won't be simulated if it's just in the Custom KRL component.
Best,
Johannes
Hi Johannes,
Thanks a lot.
Are there examples in KUKA|prc where custom Softkey-Dialogs were implemented as part of a ROB-procedure (via $MSG_T ?) – e.g. to have the user decide whether to increase the loop count or not and therefore repeat the last or go for the next iteration?
With a snippet like the following:
;-------- Softkey Dialog --------
DECL INT ANSW
DECL BOOL REPEAT_THIS
$MSG_T.VALID = FALSE
$MSG_T.RELEASE = FALSE
$MSG_T.TYP = #DIALOG
$MSG_T.KEY[] = "Loop finished"
$MSG_T.DLG_FORMAT[] = "0 Repeat|1 Next"
$MSG_T.ANSWER = 0
$MSG_T.VALID = TRUE
WAIT FOR ($MSG_T.VALID == FALSE)
ANSW = $MSG_T.ANSWER
IF ANSW == 1 THEN
; 0 Repeat -> repeat same iteration, n=n
REPEAT_THIS = TRUE
ELSE
; 1 Next -> next iteration, n=n+1
REPEAT_THIS = FALSE
ENDIF
Hmm... I don't think your code is accessing the softkeys, it just shows a dialog box. Which I think is the better approach than using the softkeys on the side.
I would also tend to make that accessible by all programs and then just call the method from the Custom KRL component in KUKA|prc.
Regarding the KRL, I'd say this is a typical AI question by now - possibly also taking a look at robot-forum!
Best,
Johannes