def __init__(self, visa, voltageRange=10, complianceCurrent=10E-3): sm = Keithley6430(visa) sm.setSourceFunction(Keithley6430.MODE.VOLTAGE) sm.setSenseFunction(Keithley6430.MODE.CURRENT) sm.setComplianceCurrent(complianceCurrent) sm.setSourceVoltageRange(voltageRange) sm.enableOutput() self.sm = sm
def magnetSupplyTest(): import sys from Visa.Agilent6641A import Agilent6641A from Visa.Keithley6430 import Keithley6430 from Visa.Agilent34401A import Agilent34401A print "1" ps = Agilent6641A('GPIB0::5') if not '6641A' in ps.visaId(): raise Exception('Agilent 6641A not found!') print "2" dmm = Agilent34401A('GPIB0::22') if not '34401A' in dmm.visaId(): raise Exception('Agilent 34401A not found!') print "3" voltageSource = 'DAQ' if voltageSource == 'Keithley6430': vs = Keithley6430('GPIB0::24') visaId = vs.visaId() if not '6430' in visaId: raise Exception('Keithley 6430 not found!') else: logger.info('Have Keithley 6430:%s' % visaId) elif voltageSource == 'DAQ': vs = DaqVoltageSource('USB6002', 'ao0','ai0') logger.info('Have USB6002 voltage source') else: raise Exception("Don't know what to use as the programming source!") print "4" print "Starting MagnetSupply" magnetSupply = MagnetSupply(ps, vs) print "5" from PyQt4.QtGui import QApplication app = QApplication(sys.argv) app.setOrganizationName('McCammonLab') app.setOrganizationDomain('wisp.physics.wisc.edu') app.setApplicationName('ADR3 Magnet Control') magnetThread = MagnetControlThread(magnetSupply, dmm) magnetThread.run() #QTimer.singleShot(2000, magnetThread.start) #magnetThread.run() try: app.exec_() except: print "Exiting"
def startPbClicked(self): address = str(self.k6430VisaCombo.currentText()) sourceMeter = Keithley6430(address) self.visaId = sourceMeter.visaId() thread = PiezoControlThread(sourceMeter = sourceMeter, parent = self) thread.measurementReady.connect(self.collectMeasurement) thread.error.connect(self.displayError) thread.finished.connect(self.threadFinished) self.stopPb.clicked.connect(thread.stop) self.msmThread = thread self.enableWidgets(False) self.msmThread.start() print "Thread started" #self.goPb.clicked.connect(self.startRamp) self.goPb.toggled.connect(self.goToggled) self.msmThread.rampComplete.connect(self.rampComplete)
def startPbClicked(self): address = str(self.k6430VisaCombo.currentText()) sourceMeter = Keithley6430(address) print "Instrument ID:", sourceMeter.visaId() name = self.calibrationCombo.currentText() self.cal = diodeCalibration(name) thread = DiodeThermometerThread(sourceMeter=sourceMeter, parent=self) thread.measurementReady.connect(self.collectMeasurement) thread.error.connect(self.displayError) thread.finished.connect(self.threadFinished) self.stopPb.clicked.connect(thread.stop) self.msmThread = thread self.enableWidgets(False) self.msmThread.start() print "Thread started"
if powerSupply == 'Agilent6641A': print "Checking for Agilent 6641A..." from Visa.Agilent6641A import Agilent6641A ps = Agilent6641A('GPIB0::5') visaId = ps.visaId() if not '6641A' in visaId: raise Exception('Agilent 6641A not found!') else: logger.info('Have Agilent 6641A:%s' % visaId) voltageSource = 'DAQ' if voltageSource == 'Keithley6430': print "Checking for Keithley 6430..." from Visa.Keithley6430 import Keithley6430 vs = Keithley6430('GPIB0::24') visaId = vs.visaId() if not '6430' in visaId: raise Exception('Keithley 6430 not found!') else: logger.info('Have Keithley 6430:%s' % visaId) elif voltageSource == 'DAQ': print "Checking for DAQ USB6002..." from MagnetSupply import DaqVoltageSource vs = DaqVoltageSource('USB6002', 'ao0','ai0', continuousReadback=False) logger.info('Have USB6002 voltage source') else: raise Exception("Don't know what to use as the programming source!") from MagnetSupply import MagnetSupply magnetSupply = MagnetSupply(ps, vs)
#from Utility.Utility import ExceptionHandler #exceptionHandler = ExceptionHandler() #sys._excepthook = sys.excepthook #sys.excepthook = exceptionHandler.handler from PyQt4.QtGui import QApplication app = QApplication(sys.argv) app.setOrganizationName('McCammonLab') app.setOrganizationDomain('wisp.physics.wisc.edu') app.setApplicationName('TES_IVSweepDaq') mw = TESIVSweepDaqWidget() mw.show() app.exec_() faulthandler.disable() faultFile.write('TES_IVSweepsDaq ending at %s' % time.time()) faultFile.close() if __name__ == '__main__': runIvSweepsDaq() from Visa.Keithley6430 import Keithley6430 k = Keithley6430('GPIB0::24') print "present:", k.checkPresence() k.setComplianceVoltage(60) print "Compliance voltage:", k.complianceVoltage() ao = AnalogOutDaq('USB6002', 'ao1') ao.setDcDrive(0)