# Need to skip part of a program when input is high

**URL:** <https://forum.universal-robots.com/t/need-to-skip-part-of-a-program-when-input-is-high/37647>\
**Category:** URScript\
**Created:** [December 12, 2024, 10:11pm UTC](https://forum.universal-robots.com/t/need-to-skip-part-of-a-program-when-input-is-high/37647 "2024-12-12T22:11:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathen](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jonathen](https://forum.universal-robots.com/u/jonathen)\
**Post date:** [December 12, 2024, 10:11pm UTC](https://forum.universal-robots.com/t/need-to-skip-part-of-a-program-when-input-is-high/37647/1 "2024-12-12T22:11:09Z")

</div>

Hello,  
TLDR: I’m trying to get this UR10 cobot to skip part of a program, and run a different part.

I have my UR10 setup to tend a new robodrill. Currently, I have a macro setup to stop the robodrill every X parts so I know I need to preform a repeatability check on 10 parts. This means it will stop at night which id rather not have. So withen the macro I added a output to the cobot, so now when it hits x parts, it will make a input (on the cobot) high. Now comes my issue, im not sure how to skip part of the code where it dumps the parts in the finish bin. As I need it to set the part in a separate spot based on the status of the input. Then go back to the finished part pile when the input is low. Coming from fanuc b macros, I would just use a goto but I’m not sure if that’s the same here. Thanks!

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [December 13, 2024, 9:34am UTC](https://forum.universal-robots.com/t/need-to-skip-part-of-a-program-when-input-is-high/37647/2 "2024-12-13T09:34:45Z")

</div>

Your explanation is a bit vague, but to me it sounds like your issue could be solved with a simple if/else? 🙂  
I imagine you’re familiar with that command, though, so that probably doesn’t do it for you.

Have a read here: [UR3e, Inspection program, Jump position - #4 by laska](https://forum.universal-robots.com/t/ur3e-inspection-program-jump-position/34487/4)

This could be the same thing you’re looking for, since you mention goto. 🙂

---

<div class="post-metadata">

**Author:** ![jonathen](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jonathen](https://forum.universal-robots.com/u/jonathen)\
**Post date:** [December 14, 2024, 6:27pm UTC](https://forum.universal-robots.com/t/need-to-skip-part-of-a-program-when-input-is-high/37647/3 "2024-12-14T18:27:27Z")

</div>

Not sure what I was thinking that day, an If/Else statement works perfectly, thanks.
