# Multiple loops from different sub programs

**URL:** <https://forum.universal-robots.com/t/multiple-loops-from-different-sub-programs/19645>\
**Category:** Technical Questions\
**Created:** [March 3, 2022, 4:45pm UTC](https://forum.universal-robots.com/t/multiple-loops-from-different-sub-programs/19645 "2022-03-03T16:45:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon87678620](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon87678620](https://forum.universal-robots.com/u/anon87678620)\
**Post date:** [March 3, 2022, 4:45pm UTC](https://forum.universal-robots.com/t/multiple-loops-from-different-sub-programs/19645/1 "2022-03-03T16:45:01Z")

</div>

Hi all,

I have two different subprograms, each with a single loop in them, that I am trying to call in my main program. However, every time I open my main program, I get this popup message regardless of what I select:

 ![IMG_1579](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/9/922bb07610f5f4a4a04715bd54f7b54a8304b9cb.jpeg)

I imagine that in the background both loops are named “Loop\_1” since they are the only loop in each subprogram and this is what’s causing the message to pop up.

Does anyone know a way that I can change their names or another method of preventing this popup every time I open my main program?

---

<div class="post-metadata">

**Author:** ![terryc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/terryc/32/3006_2.png) [@terryc](https://forum.universal-robots.com/u/terryc)\
**Post date:** [March 3, 2022, 5:52pm UTC](https://forum.universal-robots.com/t/multiple-loops-from-different-sub-programs/19645/2 "2022-03-03T17:52:38Z")

</div>

I would just modify one of your subprograms to have a different loop variable name.

~~I think when you click the node it lets you specify what variable name you want to use.~~

I guess not, you can also get it to create a new loop variable by creating a second loop in your subprogram, thereby forcing Loop\_2 to appear.

Personally, I would just create your own loop variable and use the loop condition box and manually increment the count.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/4/4daa9603dfd21ba81aa02b6cfdb4162b57bde2ec.png)

---

<div class="post-metadata">

**Author:** ![anon87678620](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon87678620](https://forum.universal-robots.com/u/anon87678620)\
**Post date:** [March 3, 2022, 6:11pm UTC](https://forum.universal-robots.com/t/multiple-loops-from-different-sub-programs/19645/3 "2022-03-03T18:11:38Z")

</div>

Hi Terryc,

Thank you for the suggestion!

I should have added that the loops are already not a counter and they’re both expression loops. I also had the “Keep SubProgram File Updated with this Program” box checked. Deselecting this for both subprograms fixed the issue for me.

I did want to keep these subprograms updated across all programs that use them, but i guess ill settle for this fix for now.

---

<div class="post-metadata">

**Author:** ![terryc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/terryc/32/3006_2.png) [@terryc](https://forum.universal-robots.com/u/terryc)\
**Post date:** [March 3, 2022, 7:43pm UTC](https://forum.universal-robots.com/t/multiple-loops-from-different-sub-programs/19645/4 "2022-03-03T19:43:34Z")

</div>

Right on, sometimes you get a tick box freebie haha
