Continue in program after asking question without doing movement twice

I got this really weird behaviour that makes me question everything I’ve done before.

I get the robot to move to an initial position. I then put up a UIMessageBox where I ask the user to jog the robot to the correct position and then press OK. However after pressing OK, the last movement is done again, even though we have already done it. I don’t want that behaviour.

!This moves above the calibration position

MoveJ reltool(pToolCalibration,0,0,-100),v2000,z0,tSuction\WObj:=wobj0;

calibration:=UIMessageBox(\Header:=“Jogga roboten”\MsgArray:=[“Jog the robot to the calibration position”]\Buttons:=btnOK\Icon:=iconInfo);

pTempPosition := CRobT(\Tool:=tSuction\WObj:=wobj0);
MoveJ reltool(pSomeOtherPoint,0,0,-100),v2000,z0,tSuction\WObj:=wobj0;

Instead of going to “pSomeOtherPoint” after the user presses OK, the robot does the move to the toolCalibration again, which makes the “jogging” undone. I am sure I’ve done it like this before, and wonder if this is just a bug in Robotstudio.

Do anyone know how to do this properly?

Try StopMove and Clearpath

I always use this method, operator must press ok before jogging so \NoRegain is executed.

MoveJ reltool(pToolCalibration,0,0,-100),v2000,z0,tSuction\WObj:=wobj0;
reg1:=UIMessageBox(\Header:=“Jogga roboten”\MsgArray:=[“Press OK and then jog the robot to the calibration position”]\Buttons:=btnOK\Icon:=iconInfo);
Stop\NoRegain;
pTempPosition:=CRobT(\Tool:=tSuction\WObj:=wobj0);
MoveJ reltool(pSomeOtherPoint,0,0,-100),v2000,z0,tSuction\WObj:=wobj0;

This seems to have done it, I tried StopMove but never found Clearpath!

The other solution by Tompanhuhu didn’t work for me as the Stop\NoRegain does not get into effect before pressing OK

operator must press ok before jogging so \NoRegain is executed. :slight_smile:

Hi…
I believe the movement has not been completed, hence the return.
Change to FINE movement, I believe it will solve your problem.

MoveJ reltool(pToolCalibration,0,0,-100),v2000,fine,tSuction\WObj:=wobj0;

Good Job