Script execution

This commit is contained in:
gac-S_Changer
2017-01-26 15:27:12 +01:00
parent 129a4a2c25
commit 8dc307b426

View File

@@ -50,12 +50,13 @@ class RobotModbus(DeviceBase):
robot_args.write(to_array(args, 'i'))
try:
self.request()
ret = robot_ret.read()
if ret == 1:
return True
if ret == 2:
err = robot_ack.take()
if err == 1:
ret = robot_ret.read()
return ret
if err == 2:
raise Exception("Invalid command: " + str(command))
raise Exception("Unknown error: " + str(ret))
raise Exception("Unknown error: " + str(err))
finally:
self.cancel_request()
@@ -66,7 +67,7 @@ class RobotModbus(DeviceBase):
def cancel_request(self):
robot_req.write(0)
while robot_ack.read() == 1:
while robot_ack.read() != 0:
time.sleep(0.001)
def mount(self, puck, sample):