RTDE script stop

Hello,

I am building my own SDK using RTDE. In a separate thread (let’s call it t1) I keep a check of whether rtde control interface is connected or not. In another thread (t2) I issue move commands, inverseKinematics commands etc. If rtde control interface is
disconnected by any chance t1 raises a flag and commands in t2 will not be executed.

I observe that if an unreachable pose is give to a move command the rtde script stops, however the rtde control interface is still connected.

I have two questions:

  1. Should I keep a check on let’s say robot status parameter in a new thread t3 to see if script is running or not (I noticed robot status changes from 3 to 1 if the script stops)? Is there a better way to deal this issue?

  2. To reupload the script there are two ways I can think of a) use the reupload function in script client b) disconnect the control interface and reconnect it again. Which one is suggested? And how can I close the pop up “RTDE script not running…” on the teach pendant using SDK?

Thanks in advance!