Script execution
This commit is contained in:
@@ -8,8 +8,10 @@ from ch.psi.pshell.modbus import ModbusTCP
|
||||
|
||||
|
||||
class RobotTCP(TcpDevice):
|
||||
def __init__(self, name, server):
|
||||
TcpDevice.__init__(self, name, server)
|
||||
def __init__(self, name, server, timeout = 1000, retries = 1):
|
||||
TcpDevice.__init__(self, name, server)
|
||||
self.timeout = timeout
|
||||
self.retries = retries
|
||||
|
||||
def execute(self, system, command, *argv):
|
||||
#print "Done"
|
||||
@@ -19,15 +21,16 @@ class RobotTCP(TcpDevice):
|
||||
cmd = cmd + "\n"
|
||||
ret = ""
|
||||
try:
|
||||
ret = self.write(cmd)
|
||||
ret = sendReceive(cmd, self.timeout, self.retries)
|
||||
finally:
|
||||
self.getLogger().info(cmd + " ret = " + str(ret))
|
||||
return ret
|
||||
|
||||
|
||||
def mount(self, puck, sample):
|
||||
return self.execute('1', '1', puck, sample)
|
||||
#add_device(RobotTCP("robot_tcp", "127.0.0.1:3333"), force = True)
|
||||
add_device(RobotTCP("robot_tcp", "129.129.109.114:1000"), force = True)
|
||||
add_device(RobotTCP("robot_tcp", "129.129.126.100:1000"), force = True)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user