示例#1
0
    def __init__(self, name, address, port, visalib,
                 metadata=None, device_clear=False, terminator='\n',
                 timeout=3, **kwargs):

        # remove IPInstrument-specific kwargs
        ipkwargs = ['write_confirmation']
        newkwargs = {kw: val for (kw, val) in kwargs.items()
                     if kw not in ipkwargs}

        Instrument.__init__(self, name, metadata=metadata, **newkwargs)

        ##################################################
        # __init__ of VisaInstrument

        self.add_parameter('timeout',
                           get_cmd=self._get_visa_timeout,
                           set_cmd=self._set_visa_timeout,
                           unit='s',
                           vals=vals.MultiType(vals.Numbers(min_value=0),
                                               vals.Enum(None)))

        # auxiliary VISA library to use for mocking
        self.visalib = visalib
        self.visabackend = None

        self.set_address(address)
        if device_clear:
            self.device_clear()

        self.set_terminator(terminator)
        self.timeout.set(timeout)
示例#2
0
    def __init__(self, name: str, transport: Transport) -> None:
        super().__init__(name, transport)  # calls CCCore
        Instrument.__init__(self, name)  # calls Instrument

        # validator values
        self._dev_desc.mvals_trigger_impedance = vals.Enum(50),
        self._dev_desc.mvals_trigger_level = vals.Numbers(0, 5.0)

        self._add_parameters()
示例#3
0
    def __init__(self, name, address, timeout=.1, **kwargs):
        Instrument.__init__(self, name)
        self.address = address
        self.timeout = timeout

        self.add_parameter('attenuation', unit='dB',
                           vals=vals.Enum(*np.arange(0, 60.1, 2).tolist()),
                           set_cmd=self._do_set_attenuation,
                           get_cmd=self._do_get_attenuation)

        self.connect_message()
    def __init__(self, name, address, timeout=.1, **kwargs):
        Instrument.__init__(self, name)
        self.address = address
        self.timeout = timeout

        self.add_parameter('attenuation', units='dB',
                           vals=vals.Enum(*np.arange(0, 60.1, 2).tolist()),
                           set_cmd=self._do_set_attenuation,
                           get_cmd=self._do_get_attenuation)

        self.connect_message()
示例#5
0
    def __init__(self, name,  LO, AWG, acquisition_instr='CBox',
                 single_sideband_demod=False, **kw):
        logging.info(__name__ + ' : Initializing instrument')
        Instrument.__init__(self, name, **kw)
        self.LO = LO
        self.AWG = AWG
        self._awg_seq_filename = 'Heterodyne_marker_seq_RF_mod'
        self.add_parameter('frequency',
                           label='Heterodyne frequency',
                           units='Hz',
                           get_cmd=self.do_get_frequency,
                           set_cmd=self.do_set_frequency,
                           vals=vals.Numbers(9e3, 40e9))
        self.add_parameter('f_RO_mod',
                           set_cmd=self.do_set_f_RO_mod,
                           get_cmd=self.do_get_f_RO_mod,
                           vals=vals.Numbers(-200e6, 200e6),
                           label='Intermodulation frequency',
                           units='Hz')
        self.add_parameter('single_sideband_demod',
                           label='Single sideband demodulation',
                           get_cmd=self.do_get_single_sideband_demod,
                           set_cmd=self.do_set_single_sideband_demod)
        self.set('single_sideband_demod', single_sideband_demod)

        self.add_parameter('mod_amp',
                           label='Modulation amplitud',
                           units='V',
                           set_cmd=self._do_set_mod_amp,
                           get_cmd=self._do_get_mod_amp,
                           vals=vals.Numbers(0, 1))

        self.add_parameter('acquisition_instr',
                           set_cmd=self._do_set_acquisition_instr,
                           get_cmd=self._do_get_acquisition_instr,
                           vals=vals.Strings())

        self.add_parameter('nr_averages',
                           parameter_class=ManualParameter,
                           initial_value=1024,
                           vals=vals.Numbers(min_value=0, max_value=1e6))
        # Negative vals should be done by setting the f_RO_mod negative

        self._f_RO_mod = 0  # ensures that awg_seq_par_changed flag is True
        self._mod_amp = .5
        self._frequency = None
        self.set('f_RO_mod', -10e6)
        self.set('mod_amp', .5)
        self._disable_auto_seq_loading = True
        self._awg_seq_parameters_changed = True
        self._mod_amp_changed = True
        self.acquisition_instr(acquisition_instr)
示例#6
0
 def __init__(self, name, **kw):
     Instrument.__init__(self, name=name, **kw)
     self._ensure_connection = True
     self._dummy_instr = True
     self.model = name
     self.version_info = self.get_idn()
     self.add_standard_parameters()
     self.add_additional_parameters()
     self.connect_message()
     # required because of annoying IP instrument
     self._port = ''
     self._confirmation = ''
     self._address = ''
     self._terminator = ''
     self._timeout = ''
     self._persistent = ''
    def __init__(self, name, nr_input_channels=4, nr_output_channels=2,
                 **kw):
        Instrument.__init__(self, name=name, **kw)


        self._dummy_instr = True

        self.modules = [1, 2, 3, 4, 5, 6, 7, 8]
        self.channels = [1, 2, 3, 4]
        self.add_parameters()
        self._address = 'Dummy'
        self._terminator = '\n'
        self._sync_time_and_add_parameter()

        self.IDN({'driver': str(self.__class__), 'model': self.name,
                  'serial': 'Dummy', 'vendor': '', 'firmware': ''})
        self.connect_message()
    def __init__(self, name, nr_input_channels=4, nr_output_channels=2, **kw):
        Instrument.__init__(self, name=name, **kw)
        self._dummy_instr = True
        self.add_parameters(nr_input_channels=nr_input_channels,
                            nr_output_channels=nr_output_channels)
        self.add_parameter('timeout',
                           parameter_class=ManualParameter,
                           initial_value=1)
        self._address = 'Dummy'
        self._terminator = '\n'

        self.IDN({
            'driver': str(self.__class__),
            'model': self.name,
            'serial': 'Dummy',
            'vendor': '',
            'firmware': ''
        })
        self.connect_message()
示例#9
0
    def __init__(self,
                 name: str,
                 address: str,
                 port: Optional[int],
                 visalib: str,
                 device_clear: bool = False,
                 terminator: str = '\n',
                 timeout: float = 3,
                 **kwargs: Any):

        # remove IPInstrument-specific kwargs
        ipkwargs = ['write_confirmation']
        newkwargs = {
            kw: val
            for (kw, val) in kwargs.items() if kw not in ipkwargs
        }

        Instrument.__init__(self, name, **newkwargs)
        self.visa_log = get_instrument_logger(self, VISA_LOGGER)

        ##################################################
        # __init__ of VisaInstrument

        self.add_parameter('timeout',
                           get_cmd=self._get_visa_timeout,
                           set_cmd=self._set_visa_timeout,
                           unit='s',
                           vals=vals.MultiType(vals.Numbers(min_value=0),
                                               vals.Enum(None)))

        # auxiliary VISA library to use for mocking
        self.visalib = visalib
        self.visabackend = ''

        self.set_address(address)
        if device_clear:
            self.device_clear()

        self.set_terminator(terminator)
        self.timeout.set(timeout)
示例#10
0
    def __init__(self, name,  RF, LO, AWG, acquisition_instr='CBox',
                 single_sideband_demod=False, **kw):
        logging.info(__name__ + ' : Initializing instrument')
        Instrument.__init__(self, name, **kw)

        self.LO = LO
        self.RF = RF
        self.AWG = AWG

        self.add_parameter('frequency',
                           label='Heterodyne frequency',
                           units='Hz',
                           get_cmd=self.do_get_frequency,
                           set_cmd=self.do_set_frequency,
                           vals=vals.Numbers(9e3, 40e9))
        self.add_parameter('f_RO_mod', parameter_class=ManualParameter,
                           vals=vals.Numbers(-600e6, 600e6),
                           label='Intermodulation frequency',
                           units='Hz', initial_value=10e6)
        self.add_parameter('RF_power', label='RF power',
                           units='dBm',
                           set_cmd=self.do_set_RF_power,
                           get_cmd=self.do_get_RF_power)
        self.add_parameter('single_sideband_demod',
                           label='Single sideband demodulation',
                           parameter_class=ManualParameter)
        self.add_parameter('acquisition_instr',
                           set_cmd=self._do_set_acquisition_instr,
                           get_cmd=self._do_get_acquisition_instr,
                           vals=vals.Strings())
        self.add_parameter('nr_averages',
                           parameter_class=ManualParameter,
                           initial_value=1024,
                           vals=vals.Numbers(min_value=0, max_value=1e6))

        self.set('single_sideband_demod', single_sideband_demod)
        self._awg_seq_filename = 'Heterodyne_marker_seq_RF_mod'
        self._disable_auto_seq_loading = True
        self.acquisition_instr(acquisition_instr)
示例#11
0
    def common_init(self,
                    name,
                    LO,
                    AWG,
                    acquisition_instr='CBox',
                    single_sideband_demod=False,
                    **kw):
        logging.info(__name__ + ' : Initializing instrument')
        Instrument.__init__(self, name, **kw)

        self.LO = LO
        self.AWG = AWG
        self.add_parameter('frequency',
                           label='Heterodyne frequency',
                           unit='Hz',
                           vals=vals.Numbers(9e3, 40e9),
                           get_cmd=self._get_frequency,
                           set_cmd=self._set_frequency)
        self.add_parameter('f_RO_mod',
                           label='Intermodulation frequency',
                           unit='Hz',
                           vals=vals.Numbers(-600e6, 600e6),
                           set_cmd=self._set_f_RO_mod,
                           get_cmd=self._get_f_RO_mod)
        self.add_parameter('single_sideband_demod',
                           vals=vals.Bool(),
                           label='Single sideband demodulation',
                           parameter_class=ManualParameter,
                           initial_value=single_sideband_demod)
        self.add_parameter('external_trigger',
                           vals=vals.Bool(),
                           label='wait for external trigger',
                           parameter_class=ManualParameter,
                           initial_value=False)
        self.add_parameter('acquisition_instr',
                           vals=vals.Strings(),
                           label='Acquisition instrument',
                           set_cmd=self._set_acquisition_instr,
                           get_cmd=self._get_acquisition_instr)
        self.add_parameter('nr_averages',
                           label='Number of averages',
                           vals=vals.Numbers(min_value=0, max_value=1e6),
                           parameter_class=ManualParameter,
                           initial_value=1024)
        self.add_parameter('status',
                           vals=vals.Enum('On', 'Off'),
                           set_cmd=self._set_status,
                           get_cmd=self._get_status)
        self.add_parameter('trigger_separation',
                           label='Trigger separation',
                           unit='s',
                           vals=vals.Numbers(0),
                           set_cmd=self._set_trigger_separation,
                           get_cmd=self._get_trigger_separation)
        self.add_parameter('RO_length',
                           label='Readout length',
                           unit='s',
                           vals=vals.Numbers(0),
                           set_cmd=self._set_RO_length,
                           get_cmd=self._get_RO_length)
        self.add_parameter('auto_seq_loading',
                           vals=vals.Bool(),
                           label='Automatic AWG sequence loading',
                           parameter_class=ManualParameter,
                           initial_value=True)
        self.add_parameter(
            'acq_marker_channels',
            vals=vals.Strings(),
            label='Acquisition trigger channels',
            docstring='comma (,) separated string of marker channels',
            set_cmd=self._set_acq_marker_channels,
            get_cmd=self._get_acq_marker_channels)

        self._trigger_separation = 10e-6
        self._RO_length = 2274e-9
        self._awg_seq_filename = ''
        self._awg_seq_parameters_changed = True
        self._UHFQC_awg_parameters_changed = True
        self.acquisition_instr(acquisition_instr)
        self.status('Off')
        self._f_RO_mod = 10e6
        self._frequency = 5e9
        self.frequency(5e9)
        self.f_RO_mod(10e6)
        self._eps = 0.01  # Hz slack for comparing frequencies
        self._acq_marker_channels = ('ch4_marker1,ch4_marker2,' +
                                     'ch3_marker1,ch3_marker2')
示例#12
0
    def __init__(self, name, timeout=5, address=''):
        Instrument.__init__(self, name)
        self._address = address
        self._terminator = ''
        self.add_parameter('timeout',
                           unit='s',
                           initial_value=5,
                           parameter_class=ManualParameter,
                           vals=vals.MultiType(vals.Numbers(min_value=0),
                                               vals.Enum(None)))
        self.add_parameter('address',
                           unit='',
                           initial_value='',
                           parameter_class=ManualParameter,
                           vals=vals.Strings())
        self.add_parameter('DC_output',
                           label='DC Output (ON/OFF)',
                           parameter_class=ManualParameter,
                           vals=vals.Ints(0, 1))

        for i in range(1, 5):
            self.add_parameter('ch{}_state'.format(i),
                               initial_value=1,
                               label='Status channel {}'.format(i),
                               parameter_class=ManualParameter,
                               vals=vals.Ints(0, 1))
            self.add_parameter('ch{}_amp'.format(i),
                               initial_value=1.,
                               label='Amplitude channel {}'.format(i),
                               unit='Vpp',
                               parameter_class=ManualParameter,
                               vals=vals.Numbers(0.02, 4.5))
            self.add_parameter('ch{}_offset'.format(i),
                               initial_value=0,
                               label='Offset channel {}'.format(i),
                               unit='V',
                               parameter_class=ManualParameter,
                               vals=vals.Numbers(-.1, .1))
            self.add_parameter('ch{}_waveform'.format(i),
                               initial_value="",
                               label='Waveform channel {}'.format(i),
                               parameter_class=ManualParameter,
                               vals=vals.Strings())
            self.add_parameter('ch{}_direct_output'.format(i),
                               initial_value=1,
                               label='Direct output channel {}'.format(i),
                               parameter_class=ManualParameter,
                               vals=vals.Ints(0, 1))
            self.add_parameter('ch{}_filter'.format(i),
                               initial_value='INF',
                               label='Low pass filter channel {}'.format(i),
                               unit='Hz',
                               parameter_class=ManualParameter,
                               vals=vals.Enum(20e6, 100e6, 9.9e37, 'INF',
                                              'INFinity'))
            self.add_parameter('ch{}_DC_out'.format(i),
                               initial_value=0,
                               label='DC output level channel {}'.format(i),
                               unit='V',
                               parameter_class=ManualParameter,
                               vals=vals.Numbers(-3, 5))

            for j in range(1, 3):
                self.add_parameter('ch{}_m{}_del'.format(i, j),
                                   initial_value=0,
                                   label='Channel {} Marker {} delay'.format(
                                       i, j),
                                   unit='ns',
                                   parameter_class=ManualParameter,
                                   vals=vals.Numbers(0, 1))
                self.add_parameter(
                    'ch{}_m{}_high'.format(i, j),
                    initial_value=2,
                    label='Channel {} Marker {} high level'.format(i, j),
                    unit='V',
                    parameter_class=ManualParameter,
                    vals=vals.Numbers(-2.7, 2.7))
                self.add_parameter(
                    'ch{}_m{}_low'.format(i, j),
                    initial_value=0,
                    label='Channel {} Marker {} low level'.format(i, j),
                    unit='V',
                    parameter_class=ManualParameter,
                    vals=vals.Numbers(-2.7, 2.7))

        self.add_parameter('clock_freq',
                           label='Clock frequency',
                           unit='Hz',
                           vals=vals.Numbers(1e6, 1.2e9),
                           parameter_class=ManualParameter,
                           initial_value=1.2e9)

        self.awg_files = {}
        self.file = None
        self.stop()  # to init self._state