def performOpen(self, options={}): """Perform the operation of opening the instrument connection""" # set time step and resolution self.nBit = 16 self.bitRange = float(2**(self.nBit-1)-1) # timeout self.timeout_ms = int(1000 * self.dComCfg['Timeout']) # create AWG instance self.dig = signadyne.SD_AIN() AWGPart = self.dig.getProductNameBySlot(1, int(self.comCfg.address)) if not isinstance(AWGPart, str): raise InstrumentDriver.Error('Unit not available') # check that model is supported dOptionCfg = self.dInstrCfg['options'] for validId, validName in zip(dOptionCfg['model_id'], dOptionCfg['model_str']): if AWGPart.find(validId)>=0: # id found, stop searching break else: # loop fell through, raise ID error raise InstrumentDriver.IdError(AWGPart, dOptionCfg['model_id']) # set model self.setModel(validName) # sampling rate and number of channles is set by model if validName in ('M3102', 'M3302'): # 500 MHz models self.dt = 2E-9 self.nCh = 4 else: # assume 100 MHz for all other models self.dt = 10E-9 self.nCh = 4 # create list of sampled data self.lTrace = [np.array([])] * self.nCh self.dig.openWithSlot(AWGPart, 1, int(self.comCfg.address))
def performOpen(self, options={}): """Perform the operation of opening the instrument connection""" self.freqClock = 100e6 self.hviCtrl = sd.SD_Module() self.hviSetup = sd.SD_HVI() self.dig = sd.SD_AIN() return