diff --git a/script/RobotTCP.py b/script/RobotTCP.py index 9c2c79b..22f10da 100644 --- a/script/RobotTCP.py +++ b/script/RobotTCP.py @@ -400,7 +400,11 @@ class RobotTCP(TcpDevice, Stoppable): if self.get_task_status(task)[0]>=0: raise Exception("Ongoing high-level task: " + task) self.task_create(program, *args, **kwargs) - time.sleep(0.5) #get_task_status needs time + start = time.time() + while self.get_task_status(program)[0] < 0: + if time.time() - start > 3000: + raise Exception("Cannot start task " + task) + time.sleep(0.1) self.current_task = program def stop_task(self):