Return to the beginning of the program

Hello,
Is there a simpel way to return to the beginning off the program, i have a check in the middle of the program, after the check is done have inserted a pop-up, when the user presses continue the program sould return to the beginning en restart
Thx

Not sure if the best way to do it, but you could insert your code in a < Loop > node that monitors an exit variable as its looping condition such as the below image. Doing this will cause the cursor not to follow the execution of your code.

Alternatively, there is this < break > node available or you can probably create your own script to do this also.

For any loop/if statement that is checked continuously, if there is any robot motion within the statement, the first command after the loop/if needs to be a stopj() or stopl() script command. This allows the robot to properly stop its previous motion before executing new motion. Without this, you are likely to see protective stops.

Further explanation of the stopj() and stopl() commands can be found in the script manual.

How do you restart a program after a counter has been reached to call a subprogram move? For example, I have a counter so every 10 parts the robot sets a part to the side with a sub program. I want that program to retsart from the beginning after the sub is run on the 10th part.

1 Like

This is a little late, but if you want to jump from a middle portion of the program to the beginning in order to skip everything else that comes after, you can use the script command “continue()”. It will jump from wherever the script line is to the very beginning of the program.

2 Likes