Universal Robots Forum

Set Installation Variable PolyScope With Java

Hello everyone,

I have an question about variables.

Is it possible to set an installation variable True or False with the java code (in a PolyScope program that already exist) which is not created in the Java code?

The purpose is to set e.g. variable Start True with the java code. Is that possible?

Start is an existing variable in PolyScope and doesn’t need to be created.

With regards,


PolyScope (and hence the URCaps API) are only familiar with the existence of a variable at the time of configuration.
The actual runtime value is evaluated in the URScript, and is then relayed back to be shown in PolyScope.

So the value should be assigned in the URScript, i.e. from the Installation node, which adds script to the preamble.

Hi @jbm,

I can’t find an information anywhere, how to create the installation variable in the first place. Could you tell/provide code?
I can create a variable using writter.assign(“var”, “5”) or writer.appendLine(“global var=5”) but I need it to be visible in the Variables tab AND show in the list of variables, when an assignment node is created.

Best regards