def startPbClicked(self): address = str(self.dmmVisaCombo.currentText()) self.dmm = Agilent34401A(address) self.visaId = self.dmm.visaId() thermo = self.thermometerCombo.currentText() if 'DT-470' in thermo: self.diodeCalibration = DT470Thermometer() elif 'DT-670' in thermo: self.diodeCalibration = DT670Thermometer() elif 'Si70' in thermo: self.diodeCalibration = Si70Thermometer() if thermo == 'Magnet stage DT-470': self.suffix = 'Magnet' elif thermo == '3K stage DT-670': self.suffix = '3K' elif thermo == '60K stage Si70': self.suffix = '60K' current = self.currentCombo.currentText() if '10' in current: self.I = 10E-6 else: self.I = 1E-6 thread = DiodeThermometerThread(dmm=self.dmm, 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()
def runPbClicked(self): if self.workerThread is not None: self.workerThread.stop() return self.avs = Avs47(self.bridgeCombo.visaResource()) self.avs.range.bindToEnumComboBox(self.rangeCombo) self.avs.muxChannel.bindToSpinBox(self.channelSb) #self.channelSb.setValue(self.avs.muxChannel.value) self.avs.excitation.bindToEnumComboBox(self.excitationCombo) self.avs.range.caching = True self.avs.excitation.caching = True self.avs.muxChannel.caching = True thread = WorkerThread() thread.setBridge(self.avs) if self.readoutDmmRadio.isChecked(): self.dmm = Agilent34401A(self.dmmCombo.visaResource()) thread.setDmm(self.dmm) connectAndUpdate(self.rangeUpSb, thread.setAutoRangeUp) connectAndUpdate(self.rangeDownSb, thread.setAutoRangeDown) connectAndUpdate(self.autoRangeCb, thread.enableAutoRange) thread.finished.connect(self.threadFinished) thread.readingAvailable.connect(self.collectReading) self.intervalSb.valueChanged.connect(thread.setInterval) self.workerThread = thread self.t0 = time.time() thread.start() self.enableControls(False) self.runPb.setText('Stop')
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): #self.errorDisplayTE.clear() #self.errorDisplayArray[self.index] = "" #self.errorDisplayTE.append(','.join(self.errorDisplayArray)) address = str(self.dmmVisaCombo.currentText()) self.dmm = Agilent34401A(address) self.visaId = self.dmm.visaId() thermo = self.thermometerCombo.currentText() if 'DT-470' in thermo: self.diodeCalibration = DT470Thermometer() elif 'DT-670' in thermo: self.diodeCalibration = DT670Thermometer() elif 'Si70' in thermo: self.diodeCalibration = Si70Thermometer() if thermo == 'Magnet stage DT-470': self.suffix = 'Magnet' elif thermo == '3K stage DT-670': self.suffix = '3K' elif thermo == '60K stage Si70': self.suffix = '60K' self.thermometerName = 'DiodeThermometer' + self.suffix ''' Not sure if zmq will allow multiple publishers with the same name, let's see''' current = self.currentCombo.currentText() if '10' in current: self.I = 10E-6 else: self.I = 1E-6 thread = DiodeThermometerThread(dmm=self.dmm, 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()
@author: Felix Jaeckel <*****@*****.**> """ if __name__ == '__main__': import PyDaqMx as daq import time sys = daq.System() print "DAQmx version:", sys.version devs = sys.findDevices() print "Number of devices:", len(devs) print "Devices: ", devs from Visa.Agilent34401A import Agilent34401A dmm = Agilent34401A('GPIB0::23') randomize = True deviceName = 'USB6002' aoChannel = 'ao0' aiChannel = 'ai0' dev = daq.Device(deviceName) print "SimultaneousSampling: ", dev.simultaneousSamplingSupported() print "AI channels:", dev.findAiChannels() ao = daq.AoChannel('%s/%s' % (deviceName,aoChannel), -10, 10) otask = daq.AoTask('Output') otask.addChannel(ao) otask.start() # No timing necessary for on-demand tasks ai = daq.AiChannel('%s/%s' % (deviceName,aiChannel), -10, 10) itask = daq.AiTask('Input')
from Visa.Agilent6641A import Agilent6641A from Visa.Agilent34401A import Agilent34401A def promptUser(prompt): print prompt while True: response = raw_input('Type enter to proceed, N to abort!') if len(response) == 0: return True elif response.lower() == 'n': return False dmmVisa = 'GPIB0::23' dmm = Agilent34401A(dmmVisa) ps = Agilent6641A('GPIB0::5') if not '6641A' in ps.visaId(): raise Exception('Agilent 6641A not found!') print "Starting MagnetSupply" magnetSupply = MagnetControlThread(ps) magnetSupply.setupDaqChannels() magnetSupply.samplesPerChannel = 10000 magnetSupply.setupDaqTasks() #ps.setVoltage(3.5) magnetSupply.enableMagnetVoltageControl(True) magnetSupply.programMagnetVoltage(-0.1) print "Vps:", ps.measureVoltage()