Universal Robots+

Compile changes on instalation

Hi there. thank for offer this community.

I’m facing an issue with my first URcap:
My ProgramNodes use some variables setted on the instalation, and when I change a value of them(on the instalationTab) and save the instalation it doesn’t apply the changes on the URScript until I change something on the program tree and pulse play to compile.

Is there a way to notify polyscope that something has changed on a URCap to make it compile again the URScript the next time the “play” button is pressed???(even when nothing has changed int he program tree)

Thanks in advance.

Hi,

changes applied to both installation and programnodes apply on the urscript layer when playing or saving a robot program. This mechanism takes action when the installation and programnodes have their generateScript methods called.

To apply changes to your programnode from your installationnode, you need to call the datamodel of your installation from the programnode, in this case, a get method and the getInstallation Interface should be implemented.

To assure that the changes apply when needed, the get method should be implemented both in your openView and the generate Script method. This way, your changes will either be viewed or executed.

On my generateScript method of my PorgramNodeContribution I call a public method of my Instalation contribution like this:

“apiProvider.getInstalationNode(My instalationContibution.class).getSetupValue()”

The “getSetupValue” method on my instalation contribution is which consult the dataModel… and it transfer the value correctly when compile, but I doesn’t apply changes until is another change in the program tree to compile.

I didn’t find the way to call the datamodel instance of my instalation contribution from my generateScript method of my programNodeContribution if that is what you are suggesting.

In my generateScript method on my instalation i have:

Integer time = new Integer(modelLocal.get(RunningTime_Key, DefaultRunningTIme));
writer.appendLine(“TimeToRun=”+time.toString());
…etc.

And when I set a new value and save my instalation and press play and it didn’t apply the new value. It do it until I change somethig else in the program tree.

I still have this issue. is even worst than I had observed.

If I have program already running, and I install my URCap wich has an instalation contribution, I go to the instalation Tab and configure it. If I go back to the Run program screen the script code of my contribution is not added, It is added until I open the program and change something on it.

Plese just tell me if this completly normal on polyscope or if I can do something to force polyscope compile again the URScript when me URCap is installed or a value modified in the instalation tab.

I have osberved it in several version from 3.9 thru 3.13.

Hi,

i never noticed such strange behavior. can you upload a minimum example urcap?

Hi, @m.birkholz!..

My “generateScript” metod is like this:

public void generateScript(ScripWriter writer){
if(model.get(Activated_KEY, false) == true){
Float time = new Float(model.get(Time_KEY, 0.0));
writer.appendLine("TimeToExecute = " + time.toString());
writer.appendLine(“AllowExecution = True”);
}else{
writer.appendLine(“URCap not activated”);
}
}

And the slider I have to set the time has the same context than the one “MyFirstURCap” example,… trigering an Change listener, that calls a method of the instalation contribution, wich saves the new value on the datamodel. exactly the same programing than the example and it works… when it compiles, the problem is that I need to make a change in the program tree to see the changes I made in the instalation tab applied, even when are properly saved in the datamodel of the instalation contribution.