Universal Robots Forum

URScript: Persistent or static variables that retain their values after stopping and starting the robot program or even after rebooting the robot?

Hi,

Is there a way to create persistent or static variables that retain their values after stopping and starting the robot program or even after rebooting the robot with URScript?

I’d like to set a pose feature to a certain value and would like to remember that value, even if the robot program stops.

Thank you in advance for your help and best regards

Klaus

Hi @k.berdel,

That is not possible. With the URCap API it is possible to register a feature that will persisted in the installation file.

Ebbe

1 Like

Hi Ebbe,
thank you for the quick response.
If you like, you can move this post to the Wishlist :wink:

Best regards
Klaus

If you can create an installation variable in the installation file, it is possible to reference this variable from URScript and set the value. These are persisted between runs and even power cycle. It’s just not possible to create this from URScript, has to be done from the installation file.

Thank you, that is a good point.

But I believe in CB-series, they can only be taught, not set to a certain value, e.g p[0,0,0,0,0] (at least i am too stupid to do that). e-series seems more flexible here.

Installation variables work the same with CB3, we’ve deployed a lot of them and set installation variables via IRScript. There’s actually no way of “teaching” an installation variable, has to be created on the installation screen. Now depending on the age of Polyscope installed you might have limited types available but we store poses, strings, lists and numbers in them in production robots.

Try creating an installation variable called i_p1 =p[0,0,0,0,0,0]. Then, in your program go to whatever pose you want to and after arriving at that pose use an assignment to assign current pose to i_p1 (i_p1 = get_actual_tcp_pose()) Now stop program. This value should be stored in the installation variables file within i_p1. Polyscope does this for you but there is no way to force this directly from URscript alone.