Commit 9d14c910 authored by Projects's avatar Projects

software: modified scripts to use SLOT parameter from ei2cdefine

parent ffa923c7
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#=============================================================================== #===============================================================================
# last changes: # last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -50,28 +51,15 @@ if __name__ == "__main__": ...@@ -50,28 +51,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
# 2014-05-02 Theodor Stana File created # 2014-05-02 Theodor Stana File created
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware, # 2017-02-02 M. Suminski Updated mem map to match v4 gateware,
# renamed from setsr.py to seterr.py # renamed from setsr.py to seterr.py
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -57,28 +58,15 @@ if __name__ == "__main__": ...@@ -57,28 +58,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
# 2014-05-02 Theodor Stana Changed to print the bits of the SR # 2014-05-02 Theodor Stana Changed to print the bits of the SR
# in turn. # in turn.
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -49,28 +50,15 @@ if __name__ == "__main__": ...@@ -49,28 +50,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#=============================================================================== #===============================================================================
# last changes: # last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -50,28 +51,15 @@ if __name__ == "__main__": ...@@ -50,28 +51,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#=============================================================================== #===============================================================================
# last changes: # last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -50,10 +51,12 @@ if __name__ == "__main__": ...@@ -50,10 +51,12 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
# 2014-05-02 Theodor Stana File created # 2014-05-02 Theodor Stana File created
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware, # 2017-02-02 M. Suminski Updated mem map to match v4 gateware,
# renamed from setsr.py to seterr.py # renamed from setsr.py to seterr.py
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -57,28 +58,15 @@ if __name__ == "__main__": ...@@ -57,28 +58,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
# last changes: # last changes:
# 2017-02-02 M. Suminski Updated to work with gateware v4 # 2017-02-02 M. Suminski Updated to work with gateware v4
# (read regs storing UID & temperature) # (read regs storing UID & temperature)
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -56,28 +57,15 @@ if __name__ == "__main__": ...@@ -56,28 +57,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
# last changes: # last changes:
# 2014-08-18 Theodor Stana File created # 2014-08-18 Theodor Stana File created
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -48,28 +49,15 @@ if __name__ == "__main__": ...@@ -48,28 +49,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#=============================================================================== #===============================================================================
# last changes: # last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -48,28 +49,15 @@ if __name__ == "__main__": ...@@ -48,28 +49,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#=============================================================================== #===============================================================================
# last changes: # last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -47,28 +48,15 @@ if __name__ == "__main__": ...@@ -47,28 +48,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#=============================================================================== #===============================================================================
# last changes: # last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -49,28 +50,15 @@ if __name__ == "__main__": ...@@ -49,28 +50,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = testelma.get_bid(slot) bid = testelma.get_bid(slot)
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#=============================================================================== #===============================================================================
# last changes: # last changes:
# 2013-08-13 Theodor Stana File created # 2013-08-13 Theodor Stana File created
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -72,30 +73,15 @@ if __name__ == "__main__": ...@@ -72,30 +73,15 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else: else:
ip = raw_input("ELMA crate IP or hostname : ") ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ") user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ") pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
elma = EI2C(ip, user, pwd) elma = EI2C(ip, user, pwd)
elma.open() elma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except ValueError as e :
print ("%s is not a valid integer." % e.args[0].split(": ")[1])
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot # Print which board is detected in the selected slot
bid = elma.get_bid(slot) bid = elma.get_bid(slot)
......
...@@ -12,24 +12,10 @@ if __name__ == "__main__": ...@@ -12,24 +12,10 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Get board ID and gateware version, fail if incorrect # Get board ID and gateware version, fail if incorrect
bloid = testelma.read(slot, 0x00) bloid = testelma.read(slot, 0x00)
fwvers = testelma.read(slot, 0x04) & 0xFF fwvers = testelma.read(slot, 0x04) & 0xFF
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
# last changes: # last changes:
# 2014-07-02 Theodor Stana Setting the frequency to 0 Hz does not # 2014-07-02 Theodor Stana Setting the frequency to 0 Hz does not
# enable the channel # enable the channel
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -85,24 +86,10 @@ if __name__ == "__main__": ...@@ -85,24 +86,10 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Get board ID and gateware version, fail if incorrect # Get board ID and gateware version, fail if incorrect
bloid = testelma.read(slot, 0x00) bloid = testelma.read(slot, 0x00)
fwvers = testelma.read(slot, 0x04) & 0xFF fwvers = testelma.read(slot, 0x04) & 0xFF
......
...@@ -12,24 +12,10 @@ if __name__ == "__main__": ...@@ -12,24 +12,10 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Get board ID and gateware version, fail if incorrect # Get board ID and gateware version, fail if incorrect
bloid = testelma.read(slot, 0x00) bloid = testelma.read(slot, 0x00)
fwvers = testelma.read(slot, 0x04) & 0xFF fwvers = testelma.read(slot, 0x04) & 0xFF
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
# last changes: # last changes:
# 2013-08-13 Theodor Stana File created # 2013-08-13 Theodor Stana File created
# 2014-03-06 Theodor Stana Added description above # 2014-03-06 Theodor Stana Added description above
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - # TODO: -
#=============================================================================== #===============================================================================
...@@ -58,24 +59,10 @@ if __name__ == "__main__": ...@@ -58,24 +59,10 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
testelma = EI2C(ip, user, pwd) testelma = EI2C(ip, user, pwd)
testelma.open() testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Ask how long to run the test # Ask how long to run the test
print "How long would you like to run the test?" print "How long would you like to run the test?"
while 1: while 1:
...@@ -130,7 +117,7 @@ if __name__ == "__main__": ...@@ -130,7 +117,7 @@ if __name__ == "__main__":
f.write("Nr. slots: %d\n" % nrslots) f.write("Nr. slots: %d\n" % nrslots)
f.write("Runtime: %d hrs, %d mins, %d s\n" % (hrs, mins, secs)) f.write("Runtime: %d hrs, %d mins, %d s\n" % (hrs, mins, secs))
f.write("------------------------------------------------------------\r\n") f.write("------------------------------------------------------------\r\n")
f.write("%s: starting test\r\n" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime())) f.write("%s: starting test\r\n" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime()))
print "%s: starting test" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime()) print "%s: starting test" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime())
f.write("------------------------------------------------------------\r\n") f.write("------------------------------------------------------------\r\n")
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
# last changes: # last changes:
# 2014-08-25 Theodor Stana File created # 2014-08-25 Theodor Stana File created
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware # 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#=============================================================================== #===============================================================================
# TODO: - It was not tested with gateware v4, there are now separate counters # TODO: - It was not tested with gateware v4, there are now separate counters
# for TTL and blocking pulses. Blocking pulse counters are not handled. # for TTL and blocking pulses. Blocking pulse counters are not handled.
...@@ -50,24 +51,10 @@ if __name__ == "__main__": ...@@ -50,24 +51,10 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME ip = ei2cdefine.HNAME
user = ei2cdefine.USER user = ei2cdefine.USER
pwd = ei2cdefine.PWD pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
elma = EI2C(ip, user, pwd) elma = EI2C(ip, user, pwd)
elma.open() elma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Ask how long to run the test # Ask how long to run the test
print("") print("")
print("How long would you like to run the test?") print("How long would you like to run the test?")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment