Universal Robots Forum

Array/list as installation variable?

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?

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)

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

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.

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.

Hi @tvdl 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.

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

@mmi Through the URCap. I use Java Swing

@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.