# How to access a global variable created in one URCap and use it in another URCap?

**URL:** <https://forum.universal-robots.com/t/how-to-access-a-global-variable-created-in-one-urcap-and-use-it-in-another-urcap/5220>\
**Category:** Java\
**Created:** [September 28, 2019, 6:10pm UTC](https://forum.universal-robots.com/t/how-to-access-a-global-variable-created-in-one-urcap-and-use-it-in-another-urcap/5220 "2019-09-28T18:10:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![m.birkholz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/m.birkholz/32/7084_2.png) [@m.birkholz](https://forum.universal-robots.com/u/m.birkholz)\
**Post date:** [September 29, 2019, 8:55am UTC](https://forum.universal-robots.com/t/how-to-access-a-global-variable-created-in-one-urcap-and-use-it-in-another-urcap/5220/2 "2019-09-29T08:55:51Z")

</div>

The easiest way to achieve this is implementing both urcaps in one urcap package and add a singleton class to that package which both urcaps can communicate with. There is also a interface for urcap communication. See [this post](https://forum.universal-robots.com/t/datamodel-is-not-shared-between-nodes/2773/10)

There are also a ton of threads on how to use global (robot) variables in urscript, installaion nodes and for communication (which i wont recommend if you need it on the java layer)

---

_[View the full topic](https://forum.universal-robots.com/t/how-to-access-a-global-variable-created-in-one-urcap-and-use-it-in-another-urcap/5220)._
