bin/gpib_detect

changeset 79
b8eec4f9db52
parent 70
4cd8edd2b4e7
--- a/bin/gpib_detect	Fri Sep 05 00:25:19 2008 +0200
+++ b/bin/gpib_detect	Wed Mar 18 00:26:27 2009 +0100
@@ -10,7 +10,7 @@
     sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
     from pygpibtoolkit.gpibcontroller import GPIBController
 import pygpibtoolkit.HP3562A
-
+from pygpibtoolkit.prologix import GPIB
 def main():
     import optparse
     opt = optparse.OptionParser("A simple tool for detecting connected GPIB devices")
@@ -20,7 +20,9 @@
     options, argv = opt.parse_args(sys.argv)
 
     print "Detecting GPIB devices on the bus. Please wait until completion."
-    c = GPIBController(device=options.device)
+    cnx = GPIB(device=options.device)
+    c = GPIBController(cnx)
+    
     signal.signal(signal.SIGINT, c.stop)
     signal.signal(signal.SIGQUIT, c.stop)
     
@@ -31,7 +33,7 @@
     print "GPIB devices:"
     for k in sorted(devices.keys()):
         print "%-3d: %s"%(k, devices[k])
-    
+    return c, devices
 if __name__ == "__main__":
-    main()
+    c, dev = main()
     

mercurial