Could someone guide me with URScript Looping?

Hello there,

As I am working on a project with a Universal Robots robot and I’m facing some challenges with URScript looping. Specifically, I’m trying to implement a loop that repeats a series of movements, but I’m encountering issues with the syntax and logic.

This is what I am trying to achieve:
while(condition):
# Perform some movements
movej(pose1, a=1.0, v=0.1)
movej(pose2, a=1.0, v=0.1)
end

However, I’m unsure about the correct way to structure the loop and handle the conditions. Can someone provide guidance or an example of how to correctly implement this in URScript?

Also I have taken help from this: https://forum.universal-robots.com/t/loop-according-to-variable/17653aws which definitely help me out a lot.

Any help or advice would be greatly appreciated.

Thank you in advance for your kind assistance.

Hi @gicelay672,
here a couple of examples with loop condition in URscript:

2024-04-16 19-48-26