From 4662ee7db9df53c10238b13cf6f8b19d0ba53198 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Wed, 29 Mar 2017 16:56:37 +0200 Subject: [PATCH] Closedown --- script/RobotTCP.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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):