Universal Robots+

Get/set value of installation variables

Hi!

I am developing an InstallationNode and I am able to get the names of the installation variables:

Collection vars = apiProvider.getInstallationAPI().getVariableModel().getAll();
Iterator<Variable> iter = vars.iterator();
while (iter.hasNext()) { String name = iter.next().getDisplayName(); }

BUT I am NOT able to get or set their values outside the generateScript method. Am I doing something wrong?

Thanks!
Giacomo

1 Like

From your code, I see that you are getting the Variable out and iterates through them to get the name of the variable. From the Variable interface (The API), the following methods are possible to call:


Therefore, it is not possible to call the method to set or get the value of the Variable.
If you do wish to have this feature, it would be recommended to suggest this as a feature request.

Thanks for the reply! I think that it would be a nice feature to have.

3 Likes

Hi, is this feature already released? I really need to set an installation variable via script inside a UR Caps…

1 Like

It is possible to set/get the values of variable (ex var_1, var_2) on installation/robotprogram from urcap.

I know that it can be realized by using XMLRPC server.
I found also the way which be realized by using java code only without XMLRPC server, but it is difficult.