Turning on variable that tracks position with tolerance

Hi

How to turn on a variable upon position reached with ±2mm tolerance. If someone jogs the robot, the variable should be off.

Robot= UR10e
UR SW=5.21.3

Thanks in advance.

You can’t change variable values (ro any other signals for that matter) while the robot program isn’t running. :slight_smile:

You can, however, check the robot position and measure the distance with a script function within your program as seen here:

Thanks. I will check pose_dist function.