# Reading installation/global variables in java

**URL:** <https://forum.universal-robots.com/t/reading-installation-global-variables-in-java/22555>\
**Category:** Java\
**Created:** [July 8, 2022, 2:08pm UTC](https://forum.universal-robots.com/t/reading-installation-global-variables-in-java/22555 "2022-07-08T14:08:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![anon25659393](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@anon25659393](https://forum.universal-robots.com/u/anon25659393)\
**Post date:** [July 8, 2022, 3:25pm UTC](https://forum.universal-robots.com/t/reading-installation-global-variables-in-java/22555/3 "2022-07-08T15:25:57Z")

</div>

Okay, apparently there is a way to do this via an undocumented command in the dashboard server:

> [@Possible to obtain the value of variable on dashboard server](https://forum.universal-robots.com/t/possible-to-obtain-the-value-of-variable-on-dashboard-server/15637):
>
> Hi, I have happend to find dashboard command to obtain the values of variables that is undescribed in manual. This feature is very useful for checking the state of robot program flow remotely! ex: getVariable var\_1

So to get this working, you would have to build a python daemon.

```auto
#!/usr/bin/env python

import socket
import time
import sys

import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer

def getVar(variableName):
	s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	s.settimeout(2)
	s.connect(('127.0.0.1', 29999))
	cmd = 'getVariable ' + variableName
	cmd = cmd + '\n'
	print(cmd)
	s.sendall(cmd.encode())
	rcvd = s.recv(4096)
	return rcvd

server = SimpleXMLRPCServer(("127.0.0.1", 12345))
server.register_function(getVar, "getVar")
server.serve_forever()

```

Then you’d have to put this daemon in the resources folder in your urcap directory, register the daemon service and then call this daemon out from the java code and it should work.

But haven’t tested it yet so can’t be 100% sure

---

_[View the full topic](https://forum.universal-robots.com/t/reading-installation-global-variables-in-java/22555)._
