Universal Robots Forum

How to update an instalation variable using ur Script commands

Is it possible to update an instalation variable using script commands with TCP (eg: using packetsender)?

3 Likes

Yes is the answer.

  1. from within a program use a script command to assign a value to the already defined installation variable
  2. from a computer connected to port 30001-30003 and if no program is running on the robot controller, issue a script command assigning the variable.
  3. from a computer connected to port 30001-30003 and if a program is running on the robot controller, issue a script secondary function assigning the variable. https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/secondary-program-17257/
1 Like

@pho Assign a value to an installation variable from a secondary program doesn’t work.
To test it I defines the installation variable “var1”, then I send on port 30001 a secondary program

sec set_value():
global var1=2
end

The value in installation variable tab is not modified.
If I replaces “sec” with “def”, now it works.
Should it be possible to modify an installation variable from a secondary program ?
I have a use case where it would be useful