Exemple #1
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the HP_33210A, and communicates with the wrapper.

        Input:
            name (string)    : name of the instrument
            address (string) : GPIB address
            reset (bool)     : resets to default values, default=false

        Output:
            None
        '''
        
        logging.debug(__name__ + ' : Initializing instrument')
        Instrument.__init__(self, name, tags=['physical'])

        self._address = address
        self._visainstrument = visa.instrument(self._address)

        self.add_parameter('frequency',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                minval=1e-3, maxval=10e6,
                units='Hz')
        self.add_parameter('amplitude',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                minval=10e-3, maxval=10,
                units='V')
        self.add_parameter('offset',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                minval=-10, maxval=10,
                units='V')
        self.add_parameter('burst_count',
                type=types.IntType,
                flags=Instrument.FLAG_GETSET,
                minval=1, maxval=10000,
                units='#')
        self.add_parameter('burst_status',
                type=types.StringType,
                flags=Instrument.FLAG_GETSET,
                option_list=(
                    'on',
                    'off'
                ))


        self.add_function('reset')
        self.add_function('get_all')
        self.add_function('send_trigger')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemple #2
0
    def __init__(self, name, address, reset=False, change_display=True):
        '''
        Initializes the Keithley_2182A, and communicates with the wrapper.

        Input:
            name (string)           : name of the instrument
            address (string)        : GPIB address
            reset (bool)            : resets to default values
            change_display (bool)   : If True (default), automatically turn off
                                        display during measurements.
            change_autozero (bool)  : If True (default), automatically turn off
                                        autozero during measurements.
        Output:
            None
        '''
        # Initialize wrapper functions
        logging.info('Initializing instrument Keithley_2182A')
        Instrument.__init__(self, name, tags=['physical'])

        # Add some global constants
        self._address = address
        self._visainstrument = visa.instrument(self._address)
        self._change_display = change_display

        # Add parameters to wrapper
        self.add_parameter('reading',
                           flags=Instrument.FLAG_GET,
                           units='V',
                           type=types.FloatType,
                           tags=['measure'])
        self.add_parameter('range',
                           flags=Instrument.FLAG_GETSET,
                           units='V',
                           minval=0.0,
                           maxval=120.0,
                           type=types.FloatType)
        self.add_parameter('autorange',
                           flags=Instrument.FLAG_GETSET,
                           units='',
                           type=types.BooleanType)
        self.add_parameter('display',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('nplc',
                           flags=Instrument.FLAG_GETSET,
                           units='#',
                           minval=0.001,
                           maxval=50,
                           type=types.FloatType)
        self.add_parameter('aperture',
                           flags=Instrument.FLAG_GETSET,
                           units='s',
                           minval=200e-6,
                           maxval=1.0,
                           type=types.FloatType)
        self.add_parameter('analog_filter',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('digital_filter',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('digital_filter_count',
                           flags=Instrument.FLAG_GETSET,
                           units='#',
                           minval=1,
                           maxval=100,
                           type=types.IntType)
        self.add_parameter('digital_filter_window',
                           flags=Instrument.FLAG_GETSET,
                           units='%',
                           minval=0,
                           maxval=10,
                           type=types.FloatType)
        self.add_parameter('digital_filter_type',
                           flags=Instrument.FLAG_GETSET,
                           format_map={
                               'MOV': "Moving average filter",
                               'REP': "Repeating filter"
                           },
                           type=types.StringType)
        self.add_parameter('autozero',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('front_autozero',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('line_frequency',
                           flags=Instrument.FLAG_GET,
                           type=types.FloatType)
        self.add_parameter('lsync',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)

        # Add functions to wrapper
        self.add_function('reset')
        self.add_function('get_all')
        self.add_function('enable_fast_mode')

        # Connect to measurement flow to detect start and stop of measurement
        qt.flow.connect('measurement-start', self._measurement_start_cb)
        qt.flow.connect('measurement-end', self._measurement_end_cb)

        if reset:
            self.reset()
        else:
            self.get_all()
            self.set_defaults()
Exemple #3
0
    def __init__(self,
                 name,
                 address,
                 reset=False,
                 change_display=True,
                 change_autozero=True):
        '''
        Initializes the Keithley_2400, and communicates with the wrapper.

        Input:
            name (string)           : name of the instrument
            address (string)        : GPIB address
            reset (bool)            : resets to default values
            change_display (bool)   : If True (default), automatically turn off
                                        display during measurements.
            change_autozero (bool)  : If True (default), automatically turn off
                                        autozero during measurements.
        Output:
            None
        '''
        # Initialize wrapper functions
        logging.info('Initializing instrument Keithley_2400')
        Instrument.__init__(self, name, tags=['physical'])

        # Add some global constants
        self._address = address
        self._visainstrument = visa.instrument(self._address)
        self._sensmodes = ['VOLT:AC', 'VOLT:DC', 'CURR:AC', 'CURR:DC', 'RES']
        self._sourcemodes = ['VOLT']
        self._change_display = change_display
        self._change_autozero = change_autozero
        self._averaging_types = ['MOV', 'REP']
        self._trigger_sent = False

        # Add parameters to wrapper
        self.add_parameter('source_voltage',
                           flags=Instrument.FLAG_GETSET,
                           units='V',
                           minval=-210.,
                           maxval=210.,
                           type=types.FloatType)
        self.add_parameter('range',
                           flags=Instrument.FLAG_GETSET,
                           units='',
                           minval=0.1,
                           maxval=1000,
                           type=types.FloatType)
        self.add_parameter('trigger_continuous',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('trigger_count',
                           flags=Instrument.FLAG_GETSET,
                           units='#',
                           type=types.IntType)
        self.add_parameter('trigger_delay',
                           flags=Instrument.FLAG_GETSET,
                           units='s',
                           minval=0,
                           maxval=999999.999,
                           type=types.FloatType)
        # self.add_parameter('trigger_source',
        #     flags=Instrument.FLAG_GETSET,
        #     units='')
        self.add_parameter('trigger_timer',
                           flags=Instrument.FLAG_GETSET,
                           units='s',
                           minval=0.001,
                           maxval=99999.999,
                           type=types.FloatType)
        self.add_parameter('mode',
                           flags=Instrument.FLAG_GETSET,
                           type=types.StringType,
                           units='')
        self.add_parameter('digits',
                           flags=Instrument.FLAG_GETSET,
                           units='#',
                           minval=4,
                           maxval=7,
                           type=types.IntType)
        self.add_parameter('readval',
                           flags=Instrument.FLAG_GET,
                           units='AU',
                           type=types.FloatType,
                           tags=['measure'])
        self.add_parameter('readlastval',
                           flags=Instrument.FLAG_GET,
                           units='AU',
                           type=types.FloatType,
                           tags=['measure'])
        self.add_parameter('readnextval',
                           flags=Instrument.FLAG_GET,
                           units='AU',
                           type=types.FloatType,
                           tags=['measure'])
        self.add_parameter('nplc',
                           flags=Instrument.FLAG_GETSET,
                           units='#',
                           type=types.FloatType,
                           minval=0.01,
                           maxval=50)
        self.add_parameter('display',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('autozero',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('averaging',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('averaging_count',
                           flags=Instrument.FLAG_GETSET,
                           units='#',
                           type=types.IntType,
                           minval=1,
                           maxval=100)
        self.add_parameter('averaging_type',
                           flags=Instrument.FLAG_GETSET,
                           type=types.StringType,
                           units='')
        self.add_parameter('autorange',
                           flags=Instrument.FLAG_GETSET,
                           units='',
                           type=types.BooleanType)

        # Add functions to wrapper

        self.add_function('set_source_voltage')
        self.add_function('get_source_voltage')

        self.add_function('set_mode_volt_ac')
        self.add_function('set_mode_volt_dc')
        self.add_function('set_mode_curr_ac')
        self.add_function('set_mode_curr_dc')
        self.add_function('set_mode_res')
        self.add_function('set_mode_fres')
        self.add_function('set_mode_temp')
        self.add_function('set_mode_freq')
        self.add_function('set_range_auto')
        self.add_function('set_trigger_cont')
        self.add_function('set_trigger_disc')
        self.add_function('reset_trigger')
        self.add_function('reset')
        self.add_function('get_all')

        self.add_function('read')
        self.add_function('readlast')
        self.add_function('readnext')

        # self.add_function('send_trigger')
        self.add_function('fetch')

        # Connect to measurement flow to detect start and stop of measurement
        qt.flow.connect('measurement-start', self._measurement_start_cb)
        qt.flow.connect('measurement-end', self._measurement_end_cb)

        if reset:
            self.reset()
        else:
            self.get_all()
            self.set_defaults()
Exemple #4
0
    def __init__(self, name, address, reset=False, change_display=True):
        '''
        Initializes the Keithley_6221, and communicates with the wrapper.

        Input:
            name (string)           : name of the instrument
            address (string)        : GPIB address
            reset (bool)            : resets to default values
            change_display (bool)   : If True (default), automatically turn off
                                        display during measurements.
            change_autozero (bool)  : If True (default), automatically turn off
                                        autozero during measurements.
        Output:
            None
        '''
        # Initialize wrapper functions
        logging.info('Initializing instrument Keithley_6221')
        Instrument.__init__(self, name, tags=['physical'])

        # Add some global constants
        self._address = address
        self._visainstrument = visa.instrument(self._address)
        self._change_display = change_display

        # Add parameters to wrapper
        self.add_parameter('current',
                           flags=Instrument.FLAG_GETSET,
                           units='A',
                           minval=-0.105,
                           maxval=0.105,
                           type=types.FloatType)
        self.add_parameter('range',
                           flags=Instrument.FLAG_GETSET,
                           units='A',
                           minval=0.0,
                           maxval=0.105,
                           type=types.FloatType)
        self.add_parameter('autorange',
                           flags=Instrument.FLAG_GETSET,
                           units='',
                           type=types.BooleanType)
        self.add_parameter('compliance',
                           flags=Instrument.FLAG_GETSET,
                           units='V',
                           minval=0.1,
                           maxval=105,
                           type=types.FloatType)
        self.add_parameter('output_response',
                           flags=Instrument.FLAG_GETSET,
                           format_map={
                               'SLOW': "Slow output response",
                               'FAST': "Fast output response"
                           },
                           type=types.StringType)
        self.add_parameter('output',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)
        self.add_parameter('display',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)

        # Add functions to wrapper
        self.add_function('reset')
        self.add_function('get_all')
        self.add_function('clear')

        # Connect to measurement flow to detect start and stop of measurement
        qt.flow.connect('measurement-start', self._measurement_start_cb)
        qt.flow.connect('measurement-end', self._measurement_end_cb)

        if reset:
            self.reset()
        else:
            self.get_all()
            self.set_defaults()