# \[IMPLEMENTED\] Adding variables

**URL:** <https://forum.universal-robots.com/t/implemented-adding-variables/675>\
**Category:** Product Wishlist\
**Created:** [April 11, 2017, 8:02am UTC](https://forum.universal-robots.com/t/implemented-adding-variables/675 "2017-04-11T08:02:54Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![roman.reiner](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/roman.reiner/32/1294_2.png) [@roman.reiner](https://forum.universal-robots.com/u/roman.reiner)\
**Post date:** [March 22, 2018, 5:00pm UTC](https://forum.universal-robots.com/t/implemented-adding-variables/675/8 "2018-03-22T17:00:58Z")

</div>

In the installation contribution part of your URCap you add and remove functions that can be used to assign variables during run time. Here is an example of how to add/remove functions to the function model. ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/08e343df67eed842d7861e23c78a7c7903693d1b.png)

The functions will need to be within the generateScript(ScriptWriter writer) portion of the URCap installation contribution example: ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/d50de8bf9cc2d6c103a6fa45a1999688e32f2de8.png)

Adding the function to the function model would then be: ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/d0c6b93ffb2d52d90475954cefdba89a404dceb7.png)

Now within the program tree of the UR you can assign a variable from the function drop down menu example:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/afafb1c8db8de2cb924481d8fd0d7eafd20b4d8e.png) ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/a7e86a750e40f294edcd61544036c9a478c73687.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/03a44d01b2a29cfaf5f9cde57bc2e710452174dc.png)

Sorry for long post but hope this helps you out!

---

_[View the full topic](https://forum.universal-robots.com/t/implemented-adding-variables/675)._
