Universal Robots Forum

Continuous if-statement in UR-Script


in Polyscope I can check the box “Check condition continuously” for if-statements. How can I manage to do that in UR-Script programming?

Thanks in advance

Use a while loop. That’s what a checked if statement turns into when polyscope converts to script.

1 Like

To extend @mbush answer:
If you want to see how exactly this is done, open .script file, that is generated after you run .urp program.

1 Like

Thanks a lot for your answers. I thought there might be some special if-statement I could use but I can also do it with the while loop and see how it is done with the conversion from Polyscope to UR-Script.

To be more specific, it actually makes use of a thread and a while loop to constantly monitor the variable.


Yes, I figured it out and got everything working. Thanks for the help.