예제 #1
0
    def performOpen(self, options={}):
        """Perform the operation of opening the instrument connection"""
        # number of demod blocks in the FPGA
        self.num_of_demods = 5
        # self.demod_n_pts = self.num_of_demods * 15
        self.demod_n_pts = 80
        self.bit_stream_name = ''

        # 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'])
        # get PXI chassis
        self.chassis = int(self.dComCfg.get('PXI chassis', 1))
        # create AWG instance
        self.dig = keysightSD1.SD_AIN()
        AWGPart = self.dig.getProductNameBySlot(
            self.chassis, int(self.comCfg.address))
        self.log('Serial:', self.dig.getSerialNumberBySlot(
            self.chassis, int(self.comCfg.address)))
        if not isinstance(AWGPart, str):
            raise 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 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.demod_output_ssb = np.zeros((0,), dtype='complex')
        self.demod_buffer = np.zeros((0,), dtype=np.int16)

        self.dig.openWithSlot(AWGPart, self.chassis, int(self.comCfg.address))
        # get hardware version - changes numbering of channels
        hw_version = self.dig.getHardwareVersion()
        if hw_version >= 4:
            # KEYSIGHT - channel numbers start with 1
            self.ch_index_zero = 1
        else:
            # SIGNADYNE - channel numbers start with 0
            self.ch_index_zero = 0
        self.log('HW:', hw_version)
        self.configure_FPGA()
예제 #2
0
 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 = keysightSD1.SD_AIN()
     AWGPart = self.dig.getProductNameBySlot(1, int(self.comCfg.address))
     if not isinstance(AWGPart, str):
         raise 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 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"""
        # add compatibility with pre-1.5.4 version of Labber
        if not hasattr(self, 'getTrigChannel'):
            self.getTrigChannel = self._getTrigChannel
        # timeout
        self.timeout_ms = int(1000 * self.dComCfg['Timeout'])
        # get PXI chassis
        self.chassis = int(self.dComCfg.get('PXI chassis', 1))
        # create AWG instance
        # get PXI chassis
        self.chassis = int(self.dComCfg.get('PXI chassis', 1))
        self.AWG = keysightSD1.SD_AOU()
        AWGPart = self.AWG.getProductNameBySlot(self.chassis,
                                                int(self.comCfg.address))
        if not isinstance(AWGPart, str):
            raise 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 IdError(AWGPart, dOptionCfg['model_id'])
        # set model
        self.setModel(validName)
        self.AWG.openWithSlot(AWGPart, self.chassis, int(self.comCfg.address))
        # sampling rate and number of channles is set by model
        if validName in ('M3202', 'H3344'):
            # 1GS/s models
            self.dt = 1E-9
            self.nCh = 4
        elif validName == 'M3302':
            # two-channel, 500 MS/s model
            self.dt = 2E-9
            self.nCh = 2
        else:
            # assume 500 MS/s for all other models
            self.dt = 2E-9
            self.nCh = 4
        # keep track of if waveform was updated
        self.waveform_updated = [False] * self.nCh
        self.previous_upload = dict()
        self.waveform_sizes = dict()

        # get hardware version - changes numbering of channels
        hw_version = self.AWG.getHardwareVersion()
        if hw_version >= 4:
            # KEYSIGHT - channel numbers start with 1
            self.ch_index_zero = 1
        else:
            # SIGNADYNE - channel numbers start with 0
            self.ch_index_zero = 0

        # clear old waveforms
        self.clearOldWaveforms()
예제 #4
0
 def performOpen(self, options={}):
     """Perform the operation of opening the instrument connection"""
     # timeout
     self.timeout_ms = int(1000 * self.dComCfg['Timeout'])
     # create AWG instance
     self.AWG = keysightSD1.SD_AOU()
     AWGPart = self.AWG.getProductNameBySlot(1, int(self.comCfg.address))
     if not isinstance(AWGPart, str):
         raise 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 IdError(AWGPart, dOptionCfg['model_id'])
     # set model
     self.setModel(validName)
     self.AWG.openWithSlot(AWGPart, 1, int(self.comCfg.address))
     # sampling rate and number of channles is set by model
     if validName in ('M3202', 'H3344'):
         # 1GS/s models
         self.dt = 1E-9
         self.nCh = 4
     elif validName in ('M3302',):
         # two-channel, 500 MS/s model
         self.dt = 2E-9
         self.nCh = 2
     else:
         # assume 500 MS/s for all other models
         self.dt = 2E-9
         self.nCh = 4
     # keep track of if waveform was updated
     self.lWaveUpdated = [False]*self.nCh
     # get hardware version - changes numbering of channels
     hw_version = self.AWG.getHardwareVersion()
     if hw_version >= 4:
         # KEYSIGHT - channel numbers start with 1
         self.ch_index_zero = 1
     else:
         # SIGNADYNE - channel numbers start with 0
         self.ch_index_zero = 0
     self.log('HW:', hw_version)
     # clear old waveforms
     self.AWG.waveformFlush()
     for ch in range(self.nCh):
         self.AWG.AWGflush(self.get_hw_ch(ch))