SICS-843: Add Galil I/O arrays @IN and @OUT with SB and CB commands.
Added extra (non galil) IB command to set entries in @IN.
This commit is contained in:
@ -13,6 +13,8 @@ class GalilController(object):
|
||||
print "GalilController ctor: %d" % int(thePort)
|
||||
self.port = thePort
|
||||
self.motors = {}
|
||||
self.IN = 256*[1]
|
||||
self.OUT = 256*[1]
|
||||
for letter in "ABCDEFGH":
|
||||
self.motors[letter] = GalilMotor(letter)
|
||||
self.reset_powerup()
|
||||
@ -76,6 +78,10 @@ class GalilController(object):
|
||||
response.append(" 0000000000")
|
||||
elif item == "_XQ0":
|
||||
response.append(" 0000000123")
|
||||
elif item[:3] == "@IN":
|
||||
response.append(' ' + str(self.IN[int(item[3:].strip('[]'))]))
|
||||
elif item[:4] == "@OUT":
|
||||
response.append(' ' + str(self.OUT[int(item[4:].strip('[]'))]))
|
||||
elif item[0] == "@":
|
||||
response.append(" 1.0000")
|
||||
elif len(item) == 4 and item[0] == "_":
|
||||
@ -123,6 +129,13 @@ class GalilController(object):
|
||||
self.doCommandDA(cmd, arg)
|
||||
elif action == "MG":
|
||||
self.doCommandMG(cmd, arg)
|
||||
elif action == "SB":
|
||||
self.OUT[int(arg)] = 1
|
||||
elif action == "CB":
|
||||
self.OUT[int(arg)] = 0
|
||||
elif action == "IB":
|
||||
(bit, val) = arg.split()
|
||||
self.IN[int(bit)] = int(val)
|
||||
|
||||
def processDataReceived(self, data):
|
||||
#print "PDU: \"" + data + "\""
|
||||
|
Reference in New Issue
Block a user