Universal Robots Forum

Passing Information from Installation Node to Program Node

Is there any way for me to pass information from the installation node to the program node? For example, if I wanted to save a specified value in the Installation node and then be able to access/have my program node vary based on that installation value, is there any way to accomplish this?

Thanks for your consideration,
Karsten

The HelloWorld example demonstrates how to get an Installation node, and call public methods within this class.

In the HelloWorldProgramNodeContribution check out this part:

private HelloWorldInstallationNodeContribution getInstallation() {
	return api.getInstallationNode(HelloWorldInstallationNodeContribution.class);
}

This is put into action in this case in the isDefined() method of the program node, in this way:

getInstallation().isDefined()

But in short, you could just do this:

api.getInstallationNode(YourInstallationNodeContribution.class).theMethodYouWantToCall()
1 Like

Thank you for the exceptionally fast reply on this question, very much appreciated!

Karsten

Can the same be applied to passing information between different programnodes?

No - generally not between singular instances of program nodes in a program tree.
However you can from a parent node access and interface with child program nodes, if they provide you with a supported API. E.g. built-in nodes such as Waypoints or Set commands provide an API for you to configure them. If you need to do the same with your URCap-child nodes they need to implement a custom URCap API, as described in the “program_node_configuration” document section “URCap Program Node proprietary API”.