def setupDaqChannels(self): # AI device = 'USB6002_A' terminalConfig = daq.AiChannel.TerminalConfiguration.DIFF self.fetOutputMonitorChannel = daq.AiChannel( '%s/ai0' % device, -10., +10., terminalConfig=terminalConfig) self.currentChannelCoarse = daq.AiChannel( '%s/ai1' % device, -10., +10., terminalConfig=terminalConfig) self.currentChannelFine = daq.AiChannel('%s/ai2' % device, -10., +10., terminalConfig=terminalConfig) self.magnetVoltageChannel = daq.AiChannel( '%s/ai3' % device, -10., +10., terminalConfig=terminalConfig) # Digital self.doLineDisableFeedback = daq.DoChannel('%s/port1/line3' % device) self.diLineDisableFeedbackCheck = daq.DiChannel('%s/port1/line0' % device) self.doLineResetIntegrator = daq.DoChannel('%s/port1/line2' % device) # AO self.magnetVoltageControlChannel = daq.AoChannel( '%s/ao0' % device, -3.4, +3.4) self.outputVoltageControlChannel = daq.AoChannel( '%s/ao1' % device, 0, self.OutputVoltageLimit / self.OutputVoltageControlGain)
def setupDaqChannels(self): device = 'USB6002_B' # AI terminalConfig = daq.AiChannel.TerminalConfiguration.DIFF self.fetOutputMonitorChannel = daq.AiChannel( '%s/ai0' % device, -10., +10., terminalConfig=terminalConfig) self.magnetVoltageChannel = daq.AiChannel( '%s/ai1' % device, -10., +10., terminalConfig=terminalConfig) self.currentChannelFine = daq.AiChannel('%s/ai2' % device, -10., +10., terminalConfig=terminalConfig) self.currentChannelCoarse = daq.AiChannel( '%s/ai3' % device, -10., +10., terminalConfig=terminalConfig) # AO self.magnetVoltageControlChannel = daq.AoChannel( '%s/ao0' % device, -10., +10.) # TODO Figure out proper limits self.outputVoltageControlChannel = daq.AoChannel( '%s/ao1' % device, 0, self.OutputVoltageLimit / self.OutputVoltageControlGain) # Digital self.doLineDisableFeedback = daq.DoChannel( '%s/port1/line0' % device) # HIGH=Disable, LOW=Enable self.diLineDisableFeedbackCheck = daq.DiChannel( '%s/port2/line0' % device) # Readback for DisableFeedback self.doLineMagnetVoltageLoopGain = daq.DoChannel( '%s/port1/line1' % device) # HIGH=21x, LOW=441x self.doLineMagnetVoltageReadoutGain = daq.DoChannel( '%s/port1/line2' % device) # HIGH=441x, LOW=21x # Might be backwards
def checkForLeak(self): #print "Checking for leak" task = daq.DiTask('Check leak sensor') channel = daq.DiChannel('PXI6025E/port0/line7') task.addChannel(channel) task.commit() data = task.readData(10) #print data n = np.count_nonzero(data) print n if n > 7: leak = False elif n < 3: leak = True self.alarmLed.setValue(leak) #print leak if leak and self.armPb.isChecked(): self.sendAlert() self.armPb.setChecked(False)