Universal Robots Forum

Jumping program tree levels

Is there a way to jump to a higher level in the program tree?

For example, I have a set up like this:

if count = 1
    do this
if count >1, if count < total
   do this
if count = total
  do this

but I want to create something like this:

if count = 1
    if cycle = true
       count = 2
       **do this**
   (do this)
if count >1, if count < total
   do this
if count = total
  do this

and after the ** do this ** I want it to ignore the (do this) and jump up a level in the program to re-evaluate the value of “count” and move to the middle section. Maybe I’m over -thinking it and there is an easier way to do this but in testing, it never ignores the “(do this)” portion of the program.

I hope my question makes sense and thank you so much in advance.

Just an update, I found one way to do it but I am still open to any better ideas people may have. All I did was add another if statement for the part count so now my program looks like this:

if count = 1
    if cycle = true
       count = 2
       **do this**
   if count = 1
      (do this)
if count >1, if count < total
   do this
if count = total
  do this

So I moved the original “do this” under an if statement and that seems to work perfect so far.

Can you simply add an else statement?

if count = 1
    if cycle = true
       count = 2
       **do this**
    else:
       (do this)
if count >1, if count < total
   do this
if count = total
  do this
3 Likes

Took me a couple nights to get around to it but that works perfect and looks much better than mine. Thank you!