diff --git a/script/local.py b/script/local.py index 2f0115b..95f3322 100644 --- a/script/local.py +++ b/script/local.py @@ -8,7 +8,7 @@ from ch.psi.pshell.modbus import ModbusTCP class RobotTCP(TcpDevice): - def __init__(self, name, server, timeout = 1000, retries = 1): + def __init__(self, name, server, timeout = 500, retries = 1): TcpDevice.__init__(self, name, server) self.timeout = timeout self.retries = retries @@ -25,8 +25,8 @@ class RobotTCP(TcpDevice): if (self.trailer != None): tx = tx + self.trailer rx = self.sendReceive(tx, None, self.trailer , 0, self.timeout, self.retries) self.getLogger().finer("RX = " + str(rx)) - if rx[:3] != id: - raise Exception("Received invalid message id: " + str(rx[:3]) + " - expecting:" + id ) + if rx[:3] != msg_id: + raise Exception("Received invalid message id: " + str(rx[:3]) + " - expecting:" + msg_id ) if len(rx)<4: raise Exception("Invalid message size: " + str(len(rx)) ) if rx[3] == "*":