# Array/list as installation variable?

**URL:** <https://forum.universal-robots.com/t/array-list-as-installation-variable/5229>\
**Category:** URCap Development\
**Created:** [September 30, 2019, 2:46pm UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229 "2019-09-30T14:46:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon94602681](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@anon94602681](https://forum.universal-robots.com/u/anon94602681)\
**Post date:** [September 30, 2019, 2:46pm UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/1 "2019-09-30T14:46:54Z")

</div>

Hi,

I want to have an array/list of positions that I can loop through, however I also want these positions saved during shutdowns. I understand that is only possible when using installation variables, but it seems like it is not possible to have an array in the installation variables.  
The reason why I ask this is because I will have about 70 positions that I want to have saved. I thought there probably has to be a better solution to this than creating 70 separate installation variables.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [October 1, 2019, 7:46am UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/2 "2019-10-01T07:46:35Z")

</div>

You can create list of poses as installation variable:  
`i_var = [p[0, 0.3, 0.1, 0, 3.14, 0], p[0, 1, 2, 3, 4, 5], p[0, 1, 2, 3, 4, 5]]`

Then in your program you can extract pose from a list with “Assignment”, and use pose in move to variable waypoint:  
`var = i_var[index]`  
`Move(var)`

---

<div class="post-metadata">

**Author:** ![anon94602681](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@anon94602681](https://forum.universal-robots.com/u/anon94602681)\
**Post date:** [October 1, 2019, 2:28pm UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/3 "2019-10-01T14:28:41Z")

</div>

Thanks, that seemed to work, the first few tries at least… I now have the issue that the variable won’t update anymore. I’m not sure what I changed that broke it. This is what I do with the variable:  
 ![Untitled](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/3/3bb203291059c1f722dcdefbd7a2093b6ae7270f.png)

When I run this program nothing changes. I defined the installation variable like this: Positions = [p[0, 0, 0, 0, 0, 0], p[0, 0, 0, 0, 0, 0], p[0, 0, 0, 0, 0, 0]…]. So even after running the program the array will look like this.

My goal is to be able to teach screw positions, later these positions will be used to move to the screws and tighten them automatically.

---

<div class="post-metadata">

**Author:** ![anon94602681](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@anon94602681](https://forum.universal-robots.com/u/anon94602681)\
**Post date:** [October 2, 2019, 10:54am UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/4 "2019-10-02T10:54:19Z")

</div>

So it seems like the problem lies in the modifying of the arrays. I tried to modify several data types in the program and the only thing that I cant get to work are the arrays.  
Is there a specific way on how to modify an array? It seems like i\_var\_p[index] = [p[0,0,0,0,0,0]] doesn’t work. Or is this not possible at all?

UPDATE: Turns out the problem was that I modified the .variables on my computer, if I create a new one on the robot it behaves like it should.

---

<div class="post-metadata">

**Author:** ![je1](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@je1](https://forum.universal-robots.com/u/je1)\
**Post date:** [August 16, 2020, 7:09pm UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/5 "2020-08-16T19:09:02Z")

</div>

Hi @anon94602681 and @mmi ,

could you tell me how you define the installation variable? If you do it from Java/urscript. Maybe you could provide a code sample? I am having problems with this.

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [August 17, 2020, 11:49am UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/6 "2020-08-17T11:49:55Z")

</div>

Do you want to create installation variable through your URCap, or through Polyscope GUI?

---

<div class="post-metadata">

**Author:** ![je1](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@je1](https://forum.universal-robots.com/u/je1)\
**Post date:** [August 19, 2020, 2:11pm UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/8 "2020-08-19T14:11:23Z")

</div>

@mmi Through the URCap. I use Java Swing

---

<div class="post-metadata">

**Author:** ![je1](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@je1](https://forum.universal-robots.com/u/je1)\
**Post date:** [August 26, 2020, 9:24am UTC](https://forum.universal-robots.com/t/array-list-as-installation-variable/5229/9 "2020-08-26T09:24:37Z")

</div>

@mmi I would also be happy with a possibility to load the file with installation variables to the URCap in a way, so that they are identified as installation variables by the URCap. I would be very thankful for any advice on that.
