Pause and resume the motion

Now I send the script via 30003 port to control the robot.And I use the dashboard to pause the motions.But I can’t resume the motions by sending “play” via 29999 port.
Is there any ways to pause and resume the motions that is controlled by script?
Thank you in advance.

Hmm not sure this is possible sending individual lines of URscript as the robot is executing those scripts line by line, when you issue PAUSE and STOP it just stops whatever script the robot is currently running, when PLAY is then issued the robot doesn’t know what to run because it basically “killed” that last line of script. (at least this is how I think the robot operates, I could be wrong). Are you monitoring if commands are completed through port 30003 (not sure if UR sends acknowledgements back on this port, might be write only)?

Probably need to have a count or case incrementing the URscripts being sent and monitor if they are not completed (e.g. due to a STOP or PAUSE issued on port 29999). Then resend the last line of URscript before stoppage to resume where you left off in your program. Of course I would use get_actual_tcp_pose() or get_actual_joint_pos() as your start script before resending the last command so your robot starts from its current position then moves to the next.

Not 100% sure what your situation looks like and I haven’t dealt with sending URscript over port 30003, so just I’m spit-balling here but someone else may have the solution or a better idea. Anyways hope that helps and hopefully I don’t lead you down the wrong path, but best of luck!