Universal Robots Forum

Access a flag (0-29 flags) from a urp program in teach pendant?

How can i access flags (internal digital pins as described in Ur5 script manual) from a urp program? I am planning to manipulate a flag from a Client interface and access that from a urp program. How can i achieve that in urp program in teach pendant ?
Any help or solution would be great help?

Thanks in Advance

Hello aswathamang,
I understood your question to be how to set a digital output pin using the program tree, is that correct?
This can be done using the ‘Set’ node.
Alternatively, you can always use a ‘Script’ node and write out the desired URScript yourself.
Hope that helps :slight_smile:

hai rbr,

Firstly, Thanks for the reponse.
My question is not about setting the digital pin, it is about the flags that are present in UR5e . We can set a flag value using Ur5 script api → set flag(n, b). The manual says that Flags behave like internal digital outputs. The keep information between program runs. I did not find a way to set the value to these flags from “Set” node.

As you have mentioned in the later part of your answer, Which i found useful. If I get the flag value using get flag(n) in a script will it be possible to assign it to a variable in urp program??

Thank you for the clarification. I believe you are correct that flags are not usable directly in the Set node - so Script nodes are the way to go here.
In order to assign to a variable, use the Assignment node. In this node you can type a URScript expression directly in the text field, e.g. ‘get_flag(1)’
Hope that helps!