Exemplo n.º 1
0
    def __init__(self, name, address):
        '''
        Initializes the LeCroy 44Xi.

        Input:
            name (string)    : name of the instrument
            address (string) : VICP address

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


        self._address = address
        self._visainstrument = visa.instrument(self._address)
        self._values = {}

        # Add parameters
        self.add_parameter('timebase', type=types.FloatType,
            flags=Instrument.FLAG_GETSET)
        self.add_parameter('vertical', type=types.FloatType,
            flags=Instrument.FLAG_GETSET, channels=(1, 4),
            channel_prefix='ch%d_')
        self.add_parameter('msize', type=types.FloatType,
            flags=Instrument.FLAG_GETSET)

        # Make Load/Delete Waveform functions for each channel
        for ch in range(1, 5):
            self._add_save_data_func(ch)

        self.get_all()
    def __init__(self, name, address, number=1):
        '''
        Initializes the Oxford Instruments ILM 200 Helium Level Meter.

        Input:
            name (string)    : name of the instrument
            address (string) : instrument address
            number (int)     : ISOBUS instrument number

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


        self._address = address
        self._number = number
        self._visainstrument = visa.SerialInstrument(self._address)
        self._values = {}
        self._visainstrument.stop_bits = 2

        #Add parameters
        self.add_parameter('level', type=types.FloatType,
            flags=Instrument.FLAG_GET)
        self.add_parameter('status', type=types.StringType,
            flags=Instrument.FLAG_GET)

        # Add functions
        self.add_function('get_all')
        self.get_all()
Exemplo n.º 3
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the Agilent_E8257D, and communicates with the wrapper.

        Input:
          name (string)    : name of the instrument
          address (string) : GPIB address
          reset (bool)     : resets to default values, default=False
        '''
        logging.info(__name__ + ' : Initializing instrument Agilent_E8257D')
        Instrument.__init__(self, name, tags=['physical'])

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

        self.add_parameter('power',
            flags=Instrument.FLAG_GETSET, units='dBm', minval=-135, maxval=16, type=types.FloatType)
        self.add_parameter('phase',
            flags=Instrument.FLAG_GETSET, units='rad', minval=-numpy.pi, maxval=numpy.pi, type=types.FloatType)
        self.add_parameter('frequency',
            flags=Instrument.FLAG_GETSET, units='Hz', minval=1e5, maxval=20e9, type=types.FloatType)
        self.add_parameter('status',
            flags=Instrument.FLAG_GETSET, type=types.StringType)

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


        if (reset):
            self.reset()
        else:
            self.get_all()
Exemplo n.º 4
0
    def __init__(self, name, address, reset=False):
        logging.info(__name__ + ' : Initializing instrument Newport ESP100')
        Instrument.__init__(self, name, tags=['physical'])

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

        # Add functions
        self.add_function('init_default')
        self.add_function('define_home')
        self.add_function('move_1000mu_p')
        self.add_function('move_0100mu_p')
        self.add_function('move_0010mu_p')
        self.add_function('move_0001mu_p')
        self.add_function('move_1000mu_n')
        self.add_function('move_0100mu_n')
        self.add_function('move_0010mu_n')
        self.add_function('move_0001mu_n')

        # Add parameters
        self.add_parameter('position',
                           tags=['sweep'],
                           flags=Instrument.FLAG_GETSET,
                           units='mm',
                           minval=-300,
                           maxval=300,
                           type=types.FloatType)
        self.add_parameter('ismoving',
                           flags=Instrument.FLAG_GET,
                           type=types.StringType)

        #self.init_default()

        if reset:
            self.init_default()
Exemplo n.º 5
0
    def __init__(self, name, address, ctr_addr=1, reset=False):
        Instrument.__init__(self, name)

        self._address = address
        self._visa = visa.instrument(self._address,
                        baud_rate=57600, data_bits=8, stop_bits=1,
                        parity=visa.no_parity, term_chars='\r\n')
        self._ctr_addr = ctr_addr

        self.add_parameter('position',
            flags=Instrument.FLAG_GETSET,
            type=types.FloatType,
            units='mm')

        self.add_parameter('state',
            flags=Instrument.FLAG_GET,
            type=types.StringType)

        self.add_parameter('velocity',
            flags=Instrument.FLAG_GETSET,
            type=types.FloatType,
            units='mm/s')

        # Functions
        self.add_function('stop_motion')
        self.add_function('set_state_ready')
        self.add_function('get_error')
        self.add_function('go_home')
        self.add_function('go_left')
        self.add_function('go_right')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 6
0
    def __init__(self, name, address, reset=False, **kwargs):
        Instrument.__init__(self, name, address=address, reset=reset, **kwargs)

        self._address = address
        self._visa = visa.instrument(self._address,
                                     baud_rate=57600,
                                     data_bits=8,
                                     stop_bits=1,
                                     parity=visa.no_parity,
                                     term_chars='',
                                     timeout=2)

        self.add_parameter('mode',
                           flags=Instrument.FLAG_SET,
                           type=types.IntType,
                           format_map={
                               0: 'CONT',
                               1: 'SINGLE',
                           },
                           doc="""
            Get/set mode:
                0: Continuous
                1: Single measurement
            """)

        self.add_parameter('refvoltage',
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           type=types.IntType,
                           format_map={
                               0: 5,
                               1: 3,
                               2: 1,
                               3: 0.5,
                               4: 0.3,
                               5: 0.1,
                           },
                           units='V')

        self.add_parameter('units',
                           flags=Instrument.FLAG_SET,
                           type=types.IntType,
                           format_map={
                               0: '%',
                               1: 'um',
                               2: 'mm',
                               3: 'V',
                               4: 'mS',
                               5: 'S',
                           })

        self.add_parameter('position',
                           flags=Instrument.FLAG_GET,
                           format='%.03f, %.03f, %.03f')

        if reset:
            self.reset()
        else:
            self.set_mode(1)
            self.set_units('%')
            self.get_all()
Exemplo n.º 7
0
    def __init__(self, name, id=0):
        Instrument.__init__(self, name, tags=['physical'])

        self._h = 0
        self._id = id

        self.add_parameter('wavelength',
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           type=types.IntType,
                           units='nm')

        self.add_parameter('power',
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           type=types.IntType,
                           units='%',
                           help='Set crystal power')

        self.add_parameter('wlenopt',
                           flags=Instrument.FLAG_SET,
                           type=types.IntType,
                           units='nm',
                           help='Set wavelength and optimal power')

        self.add_function('enable')
        self._open()
        self.enable()

        # Close AOTF before exiting QTlab
        qt.flow.register_exit_handler(self._close)
Exemplo n.º 8
0
    def __init__(self, name, remote_name, inssrv=None, server=None):
        Instrument.__init__(self, name, tags=['remote'])

        self._remote_name = remote_name
        if inssrv is None:
            inssrv = objsh.helper.find_object('%s:instrument_server' % server)
        self._srv = inssrv
        params = self._srv.get_ins_parameters(remote_name)
        for name, info in params.iteritems():
            if info['flags'] & Instrument.FLAG_GET:
                info['get_func'] = self._get
            elif info['flags'] & Instrument.FLAG_SOFTGET:
                info['flags'] ^= (Instrument.FLAG_SOFTGET
                                  | Instrument.FLAG_GET)
                info['get_func'] = self._get
            if info['flags'] & Instrument.FLAG_SET:
                info['set_func'] = self._set
            info['channel'] = name
            self.add_parameter(name, **info)

        funcs = self._srv.get_ins_functions(remote_name)
        for name, info in funcs.iteritems():
            try:
                func = self.create_lambda(name, info.get('argspec', None))
                if 'doc' in info:
                    func.__doc__ = info['doc']
                setattr(self, name, func)
                self.add_function(name, **info)
            except Exception, e:
                logging.warning('Failed to create function %s: %s', name, e)
Exemplo n.º 9
0
  def __init__(self, name, address, reset=False):
    logging.info(__name__ + ' : Initializing instrument Newport ESP100')
    Instrument.__init__(self, name, tags=['physical'])

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

    # Add functions
    self.add_function('init_default')
    self.add_function('define_home')
    self.add_function('move_1000mu_p')
    self.add_function('move_0100mu_p')
    self.add_function('move_0010mu_p')
    self.add_function('move_0001mu_p')
    self.add_function('move_1000mu_n')
    self.add_function('move_0100mu_n')
    self.add_function('move_0010mu_n')
    self.add_function('move_0001mu_n')

    # Add parameters
    self.add_parameter('position',tags=['sweep'],
      flags=Instrument.FLAG_GETSET, units='mm', minval=-300, maxval=300, type=types.FloatType)
    self.add_parameter('ismoving',
      flags=Instrument.FLAG_GET, type=types.StringType)

    #self.init_default()

    if reset:
      self.init_default()
Exemplo n.º 10
0
    def __init__(self, name, address, reset=False):
        Instrument.__init__(self, name)

        self._address = address
        self._visa = visa.instrument(self._address,
                        baud_rate=115200, data_bits=8, stop_bits=1,
                        parity=visa.no_parity, term_chars='\r\n')

        self.add_parameter('identification',
            flags=Instrument.FLAG_GET)

        self.add_parameter('power',
            flags=Instrument.FLAG_GET,
            type=types.FloatType,
            units='W')

        self.add_parameter('head_info',
            flags=Instrument.FLAG_GET,
            type=types.StringType)

        self.add_parameter('wavelength',
            flags=Instrument.FLAG_GETSET,
            type=types.FloatType,
            units='m')

        self.add_parameter('filter_freq',
            flags=Instrument.FLAG_GETSET,
            type=types.IntType,
            units='Hz')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 11
0
    def __init__(self, name, address, reset=False):
        Instrument.__init__(self, name)

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

        self.add_parameter('identification', flags=Instrument.FLAG_GET)

        self.add_parameter('power',
                           flags=Instrument.FLAG_GET,
                           type=types.FloatType,
                           units='W')

        self.add_parameter('head_info',
                           flags=Instrument.FLAG_GET,
                           type=types.StringType)

        self.add_parameter('wavelength',
                           flags=Instrument.FLAG_GETSET,
                           type=types.FloatType,
                           units='m')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 12
0
    def __init__(self, name, address, reset=False):
        '''
        address = COM port
        '''
        logging.info(__name__ + ' : Initializing Spectra Physics Millenia')
        Instrument.__init__(self, name, tags=['physical'])

        # Set parameters
        self._address = address

        self.add_parameter('id',
            flags=Instrument.FLAG_GET,
            type=types.StringType)

        self.add_parameter('power',
            flags=Instrument.FLAG_GETSET,
            format='%.02f',
            type=types.FloatType)

        # Add functions
        self.add_function('reset')
        self.add_function('on')
        self.add_function('off')
        self.add_function('get_all')

        self._open_serial_connection()

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 13
0
    def __init__(self, name, address, reset=False):
        Instrument.__init__(self, name)

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

        self.add_parameter('identification',
            flags=Instrument.FLAG_GET)

        self.add_parameter('power',
            flags=Instrument.FLAG_GET,
            type=types.FloatType,
            units='W')

        self.add_parameter('head_info',
            flags=Instrument.FLAG_GET,
            type=types.StringType)

        self.add_parameter('wavelength',
            flags=Instrument.FLAG_GETSET,
            type=types.FloatType,
            units='m')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 14
0
  def __init__(self,name, HWSerialNumber='83828433', StageType='PRM1MZ8'):

    logging.info(__name__ + ' : Initializing instrument Thorlabs driver')
    Instrument.__init__(self, name, tags=['physical'])

    # TODO: Fix when device is already initialized and driver is reloaded!!
    # Obtain handle from driver itself

    try:
      L = f.listDevices()
    except f.DeviceError:
      print "No active devices!!"
      L = ['None']

    print L

    if '83828433' in L:
      self.g = f.openEx('83828433')
    else:
      # Alternative load
      f.createDeviceInfoList()
      t = f.getDeviceInfoDetail()
      if '83828433' == t['serial']:
        h = t['handle']
        H = h.value
        self.g = f.FTD2XX(H)


    self.g.setBaudRate(115200)
    self.g.setDataCharacteristics(f.defines.BITS_8, f.defines.STOP_BITS_1, f.defines.PARITY_NONE)

    sleep(0.2)
    self.g.purge(f.defines.PURGE_RX | f.defines.PURGE_TX)
    sleep(0.2)

    self.g.resetDevice()
    self.g.setFlowControl(f.defines.FLOW_RTS_CTS,0,0)
    self.g.setRts()

    # Add functions
    self.add_function('Identify')
    self.add_function ('GoHome')
    self.add_function ('Close')
    self.add_function ('StopMoving')
    self.add_function ('EnableChannel1')
    self.add_function ('DisableChannel1')
    self.add_function ('MoveJogPos')
    self.add_function ('MoveJogNeg')
    self.add_function ('MoveRelative')
    self.add_function ('ReturnStatus')

    # Add parameters
    self.add_parameter('Position',
      flags=Instrument.FLAG_GETSET, units='deg', minval=-720, maxval=720, type=types.FloatType)
    self.add_parameter('IsMoving',
      flags=Instrument.FLAG_GET, type=types.BooleanType)


    self.status = {}
    self.get_Position()
Exemplo n.º 15
0
    def __init__(self, name, address, reset=False):
        Instrument.__init__(self, name, tags=['physical'])

        # Set parameters
        self._address = address

        # Add functions
        self.add_function('reset')
        self.add_function('get_all')
#        self.add_function('optimize_LBO')
#        self.add_function('optimize_diodes')

        self.add_parameter('tgt_power',
            type=types.FloatType, units='W', format='%.04f',
            flags=Instrument.FLAG_GETSET)
        self.add_parameter('output_power',
            type=types.FloatType, units='W', format='%.03f',
            flags=Instrument.FLAG_GET)
        self.add_parameter('shutter',
            type=types.IntType, format_map={0: 'Closed', 1: 'Open'},
            flags=Instrument.FLAG_GETSET)
        self.add_parameter('mode',
            type=types.IntType, format_map={1: 'Light', 0: 'Current'},
            flags=Instrument.FLAG_GET)
        self.add_parameter('current',
            type=types.FloatType, units='A', format='%.01f',
            flags=Instrument.FLAG_GET)
        self.add_parameter('Tbaseplate',
            type=types.FloatType, units='C', format='%.02f',
            flags=Instrument.FLAG_GET)
        self.add_parameter('Tetalon',
            type=types.FloatType, units='C', format='%.02f',
            flags=Instrument.FLAG_GET)
        self.add_parameter('TLBO',
            type=types.FloatType, units='C', format='%.02f',
            flags=Instrument.FLAG_GET)
        self.add_parameter('Tdiode',
            type=types.FloatType, units='C', format='%.02f',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('THSdiode',
            type=types.FloatType, units='C', format='%.02f',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('Idiode',
            type=types.FloatType, units='A', format='%.01f',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('Tvanadate',
            type=types.FloatType, units='C', format='%.02f',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('PCdiode',
            type=types.FloatType, units='W', format='%.02f',
            flags=Instrument.FLAG_GET, channels=(1,2))

        self._visa = visa.SerialInstrument(address,
                        data_bits=8, stop_bits=1, parity=0,
                        baud_rate=19200, term_chars='\r\n')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 16
0
    def __init__(self, name, id=0):
        Instrument.__init__(self, name, tags=['physical'])

        self._h = 0
        self._id = id

        self.add_parameter('wavelength',
            flags=Instrument.FLAG_SET|Instrument.FLAG_SOFTGET,
            type=types.IntType,
            units='nm')

        self.add_parameter('power',
            flags=Instrument.FLAG_SET|Instrument.FLAG_SOFTGET,
            type=types.IntType,
            units='%',
            help='Set crystal power')

        self.add_parameter('wlenopt',
            flags=Instrument.FLAG_SET,
            type=types.IntType,
            units='nm',
            help='Set wavelength and optimal power')

        self.add_function('enable')
        self._open()
        self.enable()

        # Close AOTF before exiting QTlab
        qt.flow.register_exit_handler(self._close)
Exemplo n.º 17
0
    def __init__(self, name, address):
        '''
        Initializes the RS_Step_Attenuator, and communicates with the wrapper.

        Input:
            name (string)    : name of the instrument
            address (string) : GPIB address

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

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

        self.add_parameter('attenuation',
                           flags=Instrument.FLAG_SET,
                           units='dB',
                           minval=1,
                           maxval=139,
                           type=types.IntType)

        self.set_attenuation(139)
Exemplo n.º 18
0
    def __init__(self, name, address):
        '''
        Initializes the Cryocon62, and comunicates with the wrapper.

        Input:
            name (string)    : name of the instrument
            address (string) : GPIB address

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

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

        self.add_parameter('temperature', type=types.FloatType,
            channel_prefix='ch%d_',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('units', type=types.StringType,
            channel_prefix='ch%d_',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('sensor_index', type=types.IntType,
            channel_prefix='ch%d_',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('vbias', type=types.StringType,
            channel_prefix='ch%d_',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('channel_name', type=types.StringType,
            channel_prefix='ch%d_',
            flags=Instrument.FLAG_GET, channels=(1,2))
        self.add_parameter('sensor_name', type=types.StringType,
            channel_prefix='ch%d_',
            flags=Instrument.FLAG_GET, channels=(1,2))
Exemplo n.º 19
0
    def __init__(self, name, address, reset=False):
        Instrument.__init__(self, name)

        self._address = address
        self._visa = visa.instrument(self._address)
        self._channels = ('A', 'B', 'C', 'D')

        self.add_parameter('identification',
            flags=Instrument.FLAG_GET)

        self.add_parameter('kelvin',
            flags=Instrument.FLAG_GET,
            type=types.FloatType,
            channels=self._channels,
            units='K')

        self.add_parameter('sensor',
            flags=Instrument.FLAG_GET,
            type=types.FloatType,
            channels=self._channels,
            units='')

        self.add_parameter('heater_range',
            flags=Instrument.FLAG_GETSET,
            type=types.IntType,
            format_map={
                1: '25 W',
                2: '2.5 W',
                3: '250 mW',
                4: '25 mW',
                5: '2.5 mW',
                })

        self.add_parameter('heater_output',
            flags=Instrument.FLAG_GET,
            type=types.FloatType,
            units='%')

        self.add_parameter('mode',
            flags=Instrument.FLAG_GETSET,
            type=types.IntType,
            format_map={1: 'Local', 2: 'Remote', 3: 'Remote, local lock'})

        self.add_parameter('pid',
            flags=Instrument.FLAG_GETSET,
            type=types.TupleType,
            channels=(1,4))

        self.add_parameter('setpoint',
            flags=Instrument.FLAG_GETSET,
            type=types.FloatType,
            channels=(1,4))

        self.add_function('local')
        self.add_function('remote')

        if reset:
            self.reset()
        else:
            self.get_all()
    def __init__(self, name, address, number=1):
        '''
        Initializes the Oxford Instruments ILM 200 Helium Level Meter.

        Input:
            name (string)    : name of the instrument
            address (string) : instrument address
            number (int)     : ISOBUS instrument number

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

        self._address = address
        self._number = number
        self._visainstrument = visa.SerialInstrument(self._address)
        self._values = {}
        self._visainstrument.stop_bits = 2

        #Add parameters
        self.add_parameter('level',
                           type=types.FloatType,
                           flags=Instrument.FLAG_GET)
        self.add_parameter('status',
                           type=types.StringType,
                           flags=Instrument.FLAG_GET)

        # Add functions
        self.add_function('get_all')
        self.get_all()
    def __init__(self, name, address, number=5):
        '''
        Initializes the Oxford Instruments Kelvinox IGH Dilution Refrigerator.

        Input:
            name (string)    : name of the instrument
            address (string) : instrument address
            number (int)     : ISOBUS instrument number

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


        self._address = address
        self._number = number
        self._visainstrument = visa.SerialInstrument(self._address)
        self._values = {}
        self._visainstrument.stop_bits = 2

        #Add parameters
        self.add_parameter('1K_pot_temp', type=types.FloatType,
            flags=Instrument.FLAG_GET)
        self.add_parameter('mix_chamber_temp', type=types.FloatType,
            flags=Instrument.FLAG_GET)

        # Add functions
        self.add_function('get_all')
        self.get_all()
Exemplo n.º 22
0
    def __init__(self, name, address, deviceid=2, reset=False):
        '''
        address = COM port
        deviceid = device id
        '''
        logging.info(__name__ + ' : Initializing Zaber TNM')
        Instrument.__init__(self, name, tags=['physical'])

        # Set parameters
        self._address = address
        self._deviceid = deviceid

        self.add_parameter('firmware',
                           flags=Instrument.FLAG_GET,
                           type=types.IntType)

        self.add_parameter('position',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType)

        self.add_parameter('cursetposition',
                           flags=Instrument.FLAG_SET,
                           type=types.IntType)

        self.add_parameter('max_position',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType)

        self.add_parameter('max_relmove',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType)

        self.add_parameter('speed',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType)

        self.add_parameter('acceleration',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType)

        self.add_parameter('microsteps',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType)

        # Add functions
        self.add_function('reset')
        self.add_function('home')
        self.add_function('renumber')
        self.add_function('store_pos')
        self.add_function('move_rel')
        self.add_function('get_all')

        self._open_serial_connection()

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 23
0
    def __init__(self, name, address, reset=False, numdacs=8,
        polarity=['BIP', 'BIP', 'BIP', 'BIP']):
        '''
        Initialzes the IVVI, and communicates with the wrapper

        Input:
            name (string)        : name of the instrument
            address (string)     : ASRL address
            reset (bool)         : resets to default values, default=false
            numdacs (int)        : number of dacs, multiple of 4, default=8
            polarity (string[4]) : list of polarities of each set of 4 dacs
                                   choose from 'BIP', 'POS', 'NEG',
                                   default=['BIP', 'BIP', 'BIP', 'BIP']
        Output:
            None
        '''
        logging.info('Initializing instrument IVVI')
        Instrument.__init__(self, name, tags=['physical'])

        # Set parameters
        self._address = address
        if numdacs % 4 == 0 and numdacs > 0:
            self._numdacs = int(numdacs)
        else:
            logging.error('Number of dacs needs to be multiple of 4')
        self.pol_num = range(self._numdacs)


        # Add functions
        self.add_function('reset')
        self.add_function('get_all')
        self.add_function('set_dacs_zero')
        self.add_function('get_numdacs')

        # Add parameters
        self.add_parameter('pol_dacrack',
            type=types.StringType,
            channels=(1, self._numdacs/4),
            flags=Instrument.FLAG_SET)
        self.add_parameter('dac',
            type=types.FloatType,
            flags=Instrument.FLAG_GETSET,
            channels=(1, self._numdacs),
            maxstep=10, stepdelay=50,
            units='mV', format='%.02f',
            tags=['sweep'])

        self._open_serial_connection()

        # get_all calls are performed below (in reset or get_all)
        for j in range(numdacs / 4):
            self.set('pol_dacrack%d' % (j+1), polarity[j], getall=False)

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 24
0
    def __init__(self, name, id):
        Instrument.__init__(self, name, tags=['physical'])

        self._id = id

        for ch_in in self._get_input_channels():
            ch_in = _get_channel(ch_in)
            self.add_parameter(ch_in,
                flags=Instrument.FLAG_GET,
                type=types.FloatType,
                units='V',
                tags=['measure'],
                get_func=self.do_get_input,
                channel=ch_in)

        for ch_out in self._get_output_channels():
            ch_out = _get_channel(ch_out)
            self.add_parameter(ch_out,
                flags=Instrument.FLAG_SET,
                type=types.FloatType,
                units='V',
                tags=['sweep'],
                set_func=self.do_set_output,
                channel=ch_out)

        for ch_ctr in self._get_counter_channels():
            ch_ctr = _get_channel(ch_ctr)
            self.add_parameter(ch_ctr,
                flags=Instrument.FLAG_GET,
                type=types.IntType,
                units='#',
                tags=['measure'],
                get_func=self.do_get_counter,
                channel=ch_ctr)
            self.add_parameter(ch_ctr + "_src",
                flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                type=types.StringType,
                set_func=self.do_set_counter_src,
                channel=ch_ctr)

        self.add_parameter('chan_config',
            flags=Instrument.FLAG_SET|Instrument.FLAG_SOFTGET,
            type=types.StringType,
            option_list=('Default', 'RSE', 'NRSE', 'Diff', 'PseudoDiff'))

        self.add_parameter('count_time',
            flags=Instrument.FLAG_SET|Instrument.FLAG_SOFTGET,
            type=types.FloatType,
            units='s')

        self.add_function('reset')
        self.add_function('digital_out')

        self.reset()
        self.set_chan_config('RSE')
        self.set_count_time(0.1)
        self.get_all()
Exemplo n.º 25
0
    def __init__(self, name, address, reset=False, **kwargs):
        Instrument.__init__(self, name, address=address, reset=reset, **kwargs)

        self._address = address
        self._visa = visa.instrument(self._address,
                        baud_rate=57600, data_bits=8, stop_bits=1,
                        parity=visa.no_parity, term_chars='',
                        timeout=2)

        self.add_parameter('mode',
            flags=Instrument.FLAG_SET,
            type=types.IntType,
            format_map={
                0: 'CONT',
                1: 'SINGLE',
            },
            doc="""
            Get/set mode:
                0: Continuous
                1: Single measurement
            """)

        self.add_parameter('refvoltage',
            flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
            type=types.IntType,
            format_map={
                0: 5,
                1: 3,
                2: 1,
                3: 0.5,
                4: 0.3,
                5: 0.1,
            }, units='V')

        self.add_parameter('units',
            flags=Instrument.FLAG_SET,
            type=types.IntType,
            format_map={
                0: '%',
                1: 'um',
                2: 'mm',
                3: 'V',
                4: 'mS',
                5: 'S',
            })

        self.add_parameter('position',
            flags=Instrument.FLAG_GET,
            format='%.03f, %.03f, %.03f')

        if reset:
            self.reset()
        else:
            self.set_mode(1)
            self.set_units('%')
            self.get_all()
Exemplo n.º 26
0
    def __init__(self, name, address=None, reset=False):
        Instrument.__init__(self, name, tags=['measure'])

        self.add_parameter('target_temperature', type=types.IntType,
                flags=Instrument.FLAG_GETSET,
                units='C')

        self.add_parameter('temperature', type=types.IntType,
                flags=Instrument.FLAG_GET,
                units='C')

        self.add_parameter('exposure_time', type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                units='s')

        grbase = winspec.get_ngratings() * winspec.get_current_turret()
        gratings = {}
        for i in range(winspec.get_ngratings()):
            gr = winspec.get_grating_grooves(grbase + i + 1)
            name = winspec.get_grating_name(grbase + i + 1)
            gratings[i+1] = '%s (%s)' % (gr, name)

        self.add_parameter('grating', type=types.IntType,
                flags=Instrument.FLAG_GETSET,
                format_map=gratings)

        self.add_parameter('wavelength', type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                units='nm')

        self.add_parameter('newwindow', type=types.BooleanType,
                flags=Instrument.FLAG_GETSET,
                help='Create new winodw for each measurement?')
        self.add_parameter('autosave', type=types.IntType,
                flags=Instrument.FLAG_GETSET,
                format_map={
                1: 'Ask',
                2: 'Autosave',
                3: "Don't autosave / ask"
                },
                help='Autosave every spectrum?')
        self.add_parameter('fileincenable', type=types.BooleanType,
                flags=Instrument.FLAG_GETSET,
                help='File name increment enable?')

        self.add_function('get_spectrum')
        self.add_function('take_spectrum')
        self.add_function('save_spectrum')
        self.add_function('plus_1nm')
        self.add_function('minus_1nm')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 27
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the HP_33120A, 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
        '''
        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=10e-3, maxval=1e6,
                units='Hz')
        self.add_parameter('amplitude',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                minval=-10, 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()
Exemplo n.º 28
0
    def __init__(self, name, address=None, reset=False):
        Instrument.__init__(self, name, tags=['measure'])

        self.add_parameter('cooler_on',
                           type=types.BooleanType,
                           flags=Instrument.FLAG_GETSET)

        self.add_parameter('target_temperature',
                           type=types.IntType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           units='C')

        self.add_parameter('temperature',
                           type=types.IntType,
                           flags=Instrument.FLAG_GET,
                           units='C')

        self.add_parameter('exposure_time',
                           type=types.FloatType,
                           flags=Instrument.FLAG_SET,
                           units='s')

        grbase = winspec.get_ngratings() * winspec.get_current_turret()
        gratings = {}
        for i in range(winspec.get_ngratings()):
            gr = winspec.get_grating_grooves(grbase + i + 1)
            name = winspec.get_grating_name(grbase + i + 1)
            gratings[i + 1] = '%s (%s)' % (gr, name)

        self.add_parameter('grating',
                           type=types.IntType,
                           flags=Instrument.FLAG_GETSET,
                           format_map=gratings)

        self.add_parameter('wavelength',
                           type=types.FloatType,
                           flags=Instrument.FLAG_GETSET,
                           units='nm')

        self.initialize_andor()
        self.add_function('take_spectrum')
        #        self.add_function('take_spectra')
        self.add_function('save_spectrum')
        self.add_function('plus_1nm')
        self.add_function('minus_1nm')
        self.add_function('initialize_andor')
        self.add_function('cooldown_andor')
        self.add_function('warmup_andor')
        self.add_function('shutdown_andor')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 29
0
    def __init__(self, name, address, numdacs=8):
        logging.info(__name__+ ': Initializing instrument OPTO')
        Instrument.__init__(self, name, tags=['physical'])
        self._address=address
        self._numdacs=8
        self._sleeptime=0.0
        self.add_parameter('dac', type=types.FloatType,
                        flags=Instrument.FLAG_SET, channels=(1, self._numdacs),
                           minval=-5000.00, maxval=5000, units='mV',
                           format='%.02f', tags=['sweep'])

        self._open_serial_connection()
Exemplo n.º 30
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the HP_8753C, and communicates with the wrapper

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

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

        self._visainstrument.timeout = 30
        # BEWARE! in case of low IFWB, it might be
        # necessary to add additional delay
        # ( ~ numpoints / IFBW ) yourself!
        # see for example get_trace()

        self._visainstrument.send_end = False
        self._visainstrument.term_chars = ''
        # BEWARE! need to end strings with ';' yourself!

        self.add_parameter('IF_Bandwidth', flags=Instrument.FLAG_GETSET, type=types.IntType)
        self.add_parameter('numpoints', flags=Instrument.FLAG_GETSET, type=types.IntType)
        self.add_parameter('start_freq', flags=Instrument.FLAG_GETSET, type=types.FloatType)
        self.add_parameter('stop_freq', flags=Instrument.FLAG_GETSET, type=types.FloatType)
        self.add_parameter('power', flags=Instrument.FLAG_GETSET, type=types.FloatType)

        self.add_function('set_freq_3GHz')
        self.add_function('set_freq_6GHz')
        self.add_function('set_measurement_S11')
        self.add_function('set_measurement_S22')
        self.add_function('set_measurement_S12')
        self.add_function('set_measurement_S21')
        self.add_function('set_format_logm')
        self.add_function('set_format_phas')
        self.add_function('set_lin_freq')

        self.add_function('set_conversion_off')
        self.add_function('set_average_off')
        self.add_function('set_smooth_off')
        self.add_function('set_correction_off')
        self.add_function('set_trigger_exttoff')

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

        self.get_all()
Exemplo n.º 31
0
    def __init__(self, name, host, port):
        Instrument.__init__(self, name, tags=['measure'])

        self.add_parameter('position', type=types.FloatType,
                flags=Instrument.FLAG_GETSET)

        self.add_function('reset')
        self.add_function('step')

        self._host = host
        self._port = port
        self._connect()

        self.reset()
Exemplo n.º 32
0
    def __init__(self, name, address=None):
        Instrument.__init__(self, name, tags=['measure', 'generate'])

        self.add_parameter('wave_type',
                           type=types.StringType,
                           flags=Instrument.FLAG_GETSET,
                           option_list=('SIN', 'SQUARE', 'SAW'))

        self.add_parameter('amplitude',
                           type=types.FloatType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           minval=0,
                           maxval=1000,
                           units='AU')

        self.add_parameter('frequency',
                           type=types.FloatType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           minval=0,
                           maxval=1000,
                           units='Hz')

        self.add_parameter('wave',
                           type=types.FloatType,
                           tags=['measure'],
                           flags=Instrument.FLAG_GET,
                           units='AU',
                           doc="""
                Return the current value of the generated wave.
                Arbitrary units.
                """)

        self.add_parameter('slow_wave',
                           type=types.FloatType,
                           tags=['measure'],
                           flags=Instrument.FLAG_GET,
                           units='AU',
                           doc="""
                Return the current value of the generated wave.
                Arbitrary units. (takes 1sec)
                """)

        self.add_function('reset')

        self.set_wave_type('SIN')
        self.set_amplitude(1)
        self.set_frequency(0.2)

        self._start_time = time.time()
Exemplo n.º 33
0
    def __init__(self, name, address, reset=False):
        Instrument.__init__(self, name)

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

        self.add_parameter('identification', flags=Instrument.FLAG_GET)

        self.add_parameter('units',
                           flags=Instrument.FLAG_GETSET,
                           type=types.StringType)

        self.add_parameter('mode',
                           flags=Instrument.FLAG_GETSET,
                           format_map={
                               'S': 'Sample',
                               'C': 'Continuous'
                           },
                           type=types.StringType)

        self.add_parameter('length',
                           flags=Instrument.FLAG_GET,
                           type=types.FloatType)

        self.add_parameter('lastval',
                           flags=Instrument.FLAG_GET,
                           type=types.FloatType,
                           units='cm')

        self.add_parameter('interval',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType,
                           minval=0,
                           units='s')

        self.add_parameter('alarmlim',
                           flags=Instrument.FLAG_GETSET,
                           type=types.FloatType,
                           minval=0,
                           units='cm')

        self.add_function('local')
        self.add_function('remote')
        self.add_function('measure')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 34
0
    def __init__(self, name, address=None, reset=False):
        Instrument.__init__(self, name, tags=['measure'])

        self.add_parameter('cooler_on', type=types.BooleanType,
                flags=Instrument.FLAG_GETSET)

        self.add_parameter('target_temperature', type=types.IntType,
                flags=Instrument.FLAG_SET|Instrument.FLAG_SOFTGET,
                units='C')

        self.add_parameter('temperature', type=types.IntType,
                flags=Instrument.FLAG_GET,
                units='C')

        self.add_parameter('exposure_time', type=types.FloatType,
                flags=Instrument.FLAG_SET,
                units='s')

        grbase = winspec.get_ngratings() * winspec.get_current_turret()
        gratings = {}
        for i in range(winspec.get_ngratings()):
            gr = winspec.get_grating_grooves(grbase + i + 1)
            name = winspec.get_grating_name(grbase + i + 1)
            gratings[i+1] = '%s (%s)' % (gr, name)

        self.add_parameter('grating', type=types.IntType,
                flags=Instrument.FLAG_GETSET,
                format_map=gratings)

        self.add_parameter('wavelength', type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                units='nm')

        self.initialize_andor()
        self.add_function('take_spectrum')
#        self.add_function('take_spectra')
        self.add_function('save_spectrum')
        self.add_function('plus_1nm')
        self.add_function('minus_1nm')
        self.add_function('initialize_andor')
        self.add_function('cooldown_andor')
        self.add_function('warmup_andor')
        self.add_function('shutdown_andor')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 35
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the RS_SMR40, 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.info(__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
                           | Instrument.FLAG_GET_AFTER_SET,
                           minval=1e9,
                           maxval=40e9,
                           units='Hz',
                           format='%.04e',
                           tags=['sweep'])
        self.add_parameter('power',
                           type=types.FloatType,
                           flags=Instrument.FLAG_GETSET
                           | Instrument.FLAG_GET_AFTER_SET,
                           minval=-30,
                           maxval=25,
                           units='dBm',
                           tags=['sweep'])
        self.add_parameter('status',
                           type=types.StringType,
                           flags=Instrument.FLAG_GETSET
                           | Instrument.FLAG_GET_AFTER_SET)

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

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 36
0
    def __init__(self, name, address, type, reset=False, freq=1e6, pow=None):
        '''
        Initializes the HP_8657A/B, and communicates with the wrapper.
        This instrument does not support GPIB talking, so 'get' functions
        are not available.
        Only use with reset=True, otherwise warning will be given.

        Input:
            name (string)    : name of the instrument
            address (string) : GPIB address
            reset (bool)     : resets to default values, default=False
            freq (float)     : initial frequency in Hz, default=1e9
            pow (float)      : initial power in dBm, default=-143.4
        '''
        logging.info(__name__ + ' : Initializing instrument')
        Instrument.__init__(self, name, tags=['physical'])

        lim = HP_8657.LIMITS[type]

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

        # Implement parameters
        self.add_parameter('frequency', type=types.FloatType,
            flags=Instrument.FLAG_SET,
            minval=lim['minfreq'], maxval=lim['maxfreq'],
            units='Hz', format='%.04e',
            tags=['sweep'])
        self.add_parameter('power', type=types.FloatType,
            flags=Instrument.FLAG_SET,
            minval=lim['minpow'], maxval=lim['maxpow'],
            units='dBm', tags=['sweep'])
        self.add_parameter('status', type=types.StringType,
            flags=Instrument.FLAG_SET)

        # Implement functions
        self.add_function('reset')

        # (re)set device to specified values
        if reset:
            if pow is None:
                pow = lim['minpow']
            self.reset(freq, pow)
        else:
            logging.warning('instrument does not support getting of values \
                you need to run set_power and set_frequency manually!')
Exemplo n.º 37
0
    def __init__(self, name, address):
        '''
        Initializes the Cryocon62, and comunicates with the wrapper.

        Input:
            name (string)    : name of the instrument
            address (string) : GPIB address

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

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

        self.add_parameter('temperature',
                           type=types.FloatType,
                           channel_prefix='ch%d_',
                           flags=Instrument.FLAG_GET,
                           channels=(1, 2))
        self.add_parameter('units',
                           type=types.StringType,
                           channel_prefix='ch%d_',
                           flags=Instrument.FLAG_GET,
                           channels=(1, 2))
        self.add_parameter('sensor_index',
                           type=types.IntType,
                           channel_prefix='ch%d_',
                           flags=Instrument.FLAG_GET,
                           channels=(1, 2))
        self.add_parameter('vbias',
                           type=types.StringType,
                           channel_prefix='ch%d_',
                           flags=Instrument.FLAG_GET,
                           channels=(1, 2))
        self.add_parameter('channel_name',
                           type=types.StringType,
                           channel_prefix='ch%d_',
                           flags=Instrument.FLAG_GET,
                           channels=(1, 2))
        self.add_parameter('sensor_name',
                           type=types.StringType,
                           channel_prefix='ch%d_',
                           flags=Instrument.FLAG_GET,
                           channels=(1, 2))
Exemplo n.º 38
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the HP_4195A, and communicates with the wrapper

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

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

        self._visainstrument.timeout = 30
        # BEWARE! in case of low IFWB, it might be
        # necessary to add additional delay
        # ( ~ numpoints / IFBW ) yourself!

        self.add_parameter('resbw', flags=Instrument.FLAG_GETSET, type=types.IntType)
        self.add_parameter('numpoints', flags=Instrument.FLAG_GETSET, type=types.IntType)
        self.add_parameter('start_freq', flags=Instrument.FLAG_GETSET, type=types.FloatType)
        self.add_parameter('stop_freq', flags=Instrument.FLAG_GETSET, type=types.FloatType)
        self.add_parameter('power', flags=Instrument.FLAG_GETSET, type=types.FloatType)
        self.add_parameter('center_freq', flags=Instrument.FLAG_GETSET, type=types.FloatType)
        self.add_parameter('span_freq', flags=Instrument.FLAG_GETSET, type=types.FloatType)
        self.add_parameter('att_t1', flags=Instrument.FLAG_GETSET, type=types.IntType)
        self.add_parameter('att_r1', flags=Instrument.FLAG_GETSET, type=types.IntType)
        self.add_parameter('sweep_time', flags=Instrument.FLAG_GET, type=types.FloatType)

        #self.add_function('set_measurement_S11')
        #self.add_function('set_measurement_S22')
        #self.add_function('set_measurement_S12')
        #self.add_function('set_measurement_S21')
        #self.add_function('set_format_logm')
        #self.add_function('set_format_phas')
        #self.add_function('set_lin_freq')
        #self.add_function('set_log_freq')

        #self.add_function('set_trigger_continuous')
        #self.add_function('set_trigger_single')
        #self.add_function('set_trigger_manual')
        #self.add_function('send_trigger')
        #self.add_function('reset')

        self.get_all()
Exemplo n.º 39
0
    def __init__(self, name, devid=1):
        logging.info(__name__ + ' : Initializing Meadowlark LCVR')
        Instrument.__init__(self, name, tags=['physical'])

        self._devhandle = open_device(devid)
        self._pipe0 = open_pipe(devid, 0)
        self._pipe1 = open_pipe(devid, 1)
        self._alias_info = {}

        self.add_parameter('version',
                           flags=Instrument.FLAG_GET,
                           type=types.StringType)

        self.add_parameter('voltage',
                           flags=Instrument.FLAG_GETSET,
                           channels=(1, 4),
                           type=types.FloatType)
Exemplo n.º 40
0
    def __init__(self, name, address, numdacs=8):
        logging.info(__name__ + ': Initializing instrument OPTO')
        Instrument.__init__(self, name, tags=['physical'])
        self._address = address
        self._numdacs = 8
        self._sleeptime = 0.0
        self.add_parameter('dac',
                           type=types.FloatType,
                           flags=Instrument.FLAG_SET,
                           channels=(1, self._numdacs),
                           minval=-5000.00,
                           maxval=5000,
                           units='mV',
                           format='%.02f',
                           tags=['sweep'])

        self._open_serial_connection()
Exemplo n.º 41
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the Agilent_E8257D, and communicates with the wrapper.

        Input:
          name (string)    : name of the instrument
          address (string) : GPIB address
          reset (bool)     : resets to default values, default=False
        '''
        logging.info(__name__ + ' : Initializing instrument Agilent_E8257D')
        Instrument.__init__(self, name, tags=['physical'])

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

        self.add_parameter('power',
                           flags=Instrument.FLAG_GETSET,
                           units='dBm',
                           minval=-135,
                           maxval=16,
                           type=types.FloatType)
        self.add_parameter('phase',
                           flags=Instrument.FLAG_GETSET,
                           units='rad',
                           minval=-numpy.pi,
                           maxval=numpy.pi,
                           type=types.FloatType)
        self.add_parameter('frequency',
                           flags=Instrument.FLAG_GETSET,
                           units='Hz',
                           minval=1e5,
                           maxval=20e9,
                           type=types.FloatType)
        self.add_parameter('status',
                           flags=Instrument.FLAG_GETSET,
                           type=types.StringType)

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

        if (reset):
            self.reset()
        else:
            self.get_all()
Exemplo n.º 42
0
    def __init__(self, name, address, reset=False):
        '''
        Initializes the HP_81110A, 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
        '''

        Instrument.__init__(self, name, tags=['physical'])

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

        self.add_parameter('delay', type=types.FloatType,
            flags=Instrument.FLAG_GETSET | Instrument.FLAG_GET_AFTER_SET,
            channels=(1, self._channels), minval=0.0, maxval=999, units='sec',channel_prefix='ch%d_')
        self.add_parameter('width', type=types.FloatType,
            flags=Instrument.FLAG_GETSET | Instrument.FLAG_GET_AFTER_SET,
            channels=(1, self._channels), minval=-6.25e-9, maxval=999.5, units='sec',channel_prefix='ch%d_')
        self.add_parameter('high', type=types.FloatType,
            flags=Instrument.FLAG_GETSET | Instrument.FLAG_GET_AFTER_SET,
            channels=(1, self._channels), minval=-9.90, maxval=10.0, units='Volts',channel_prefix='ch%d_')
        self.add_parameter('low', type=types.FloatType,
            flags=Instrument.FLAG_GETSET | Instrument.FLAG_GET_AFTER_SET,
            channels=(1, self._channels), minval=-10.0, maxval=9.90, units='Volts',channel_prefix='ch%d_')
        self.add_parameter('status', type=types.StringType, channels=(1, self._channels),
            flags=Instrument.FLAG_GETSET | Instrument.FLAG_GET_AFTER_SET,channel_prefix='ch%d_')
        self.add_parameter('display', type=types.StringType,
            flags=Instrument.FLAG_GETSET | Instrument.FLAG_GET_AFTER_SET)

        self.add_function('reset')
        self.add_function('get_all')
        self.add_function('set_mode_triggered')
        self.add_function('set_mode_continuous')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 43
0
    def __init__(self, name, devid, reset=False):
        Instrument.__init__(self, name, tags=['physical'])

        self._devid = devid
        self._create_dev()

        self.add_parameter('resolution',
                           type=types.IntType,
                           flags=Instrument.FLAG_GET,
                           units='ps',
                           doc='''Bin size''')

        self.add_parameter(
            'range',
            type=types.IntType,
            flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
            doc='''Range, 0 = 1xbase, 1 = 2xbase, 2 = 4xbase, up to 7''')

        self.add_parameter('counts',
                           type=types.IntType,
                           channels=(0, 1),
                           flags=Instrument.FLAG_GET)

        self.add_parameter('inttime',
                           type=types.FloatType,
                           units='sec',
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET)

        self.add_parameter('divider',
                           type=types.IntType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET)

        self.add_function('reset')
        self.add_function('get_all')
        self.add_function('open')
        self.add_function('close')
        self.add_function('start')
        self.add_function('plot')

        self.set_inttime(10)

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 44
0
    def __init__(self, name, address=None):
        Instrument.__init__(self, name, tags=['measure', 'generate'])

        self.add_parameter('wave_type', type=types.StringType,
                flags=Instrument.FLAG_GETSET,
                option_list=(
                    'SIN',
                    'SQUARE',
                    'SAW'
                ))

        self.add_parameter('amplitude', type=types.FloatType,
                flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                minval=0, maxval=1000,
                units='AU')

        self.add_parameter('frequency', type=types.FloatType,
                flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                minval=0, maxval=1000,
                units='Hz')

        self.add_parameter('wave', type=types.FloatType,
                tags=['measure'],
                flags=Instrument.FLAG_GET,
                units='AU', doc="""
                Return the current value of the generated wave.
                Arbitrary units.
                """)

        self.add_parameter('slow_wave', type=types.FloatType,
                tags=['measure'],
                flags=Instrument.FLAG_GET,
                units='AU', doc="""
                Return the current value of the generated wave.
                Arbitrary units. (takes 1sec)
                """)

        self.add_function('reset')

        self.set_wave_type('SIN')
        self.set_amplitude(1)
        self.set_frequency(0.2)

        self._start_time = time.time()
Exemplo n.º 45
0
    def __init__(self, name, reset=False):
        Instrument.__init__(self, name, tags=['dummy'])

        self.add_parameter('start',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=0, maxval=1,
                units='sec')
        self.add_parameter('length',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=0, maxval=1,
                units='sec')
        self.add_parameter('amplitude',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=-3.8, maxval=3.8,
                units='Volts')
        self.add_parameter('status',
                type=types.StringType,
                option_list=('on', 'off'),
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET)

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

        # these are dummy values for an instrument that
        # is already running
        self._dummy_start = 1e-9
        self._dummy_length = 1e-9
        self._dummy_amplitude = 1
        self._dummy_status = 'off'

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 46
0
    def __init__(self, name, reset=False):
        Instrument.__init__(self, name, tags=['dummy'])

        self.add_parameter('start',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=0, maxval=1,
                units='sec')
        self.add_parameter('length',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=0, maxval=1,
                units='sec')
        self.add_parameter('amplitude',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=-3.8, maxval=3.8,
                units='Volts')
        self.add_parameter('status',
                type=types.StringType,
                option_list=('on', 'off'),
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET)

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

        # these are dummy values for an instrument that
        # is already running
        self._dummy_start = 1e-9
        self._dummy_length = 1e-9
        self._dummy_amplitude = 1
        self._dummy_status = 'off'

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 47
0
    def __init__(self, name, address, reset=False):
        logging.info(__name__ + ' : Initializing instrument Fluke PM5138A')
        Instrument.__init__(self, name, tags=['physical'])

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

        # Add functions
        self.add_function('init_default')
        self.add_function('get_all')

        # Add parameters
        self.add_parameter('frequency',
                           flags=Instrument.FLAG_GETSET,
                           units='Hz',
                           minval=0,
                           maxval=16000,
                           type=types.FloatType)
        self.add_parameter('ac_amplitude',
                           flags=Instrument.FLAG_GETSET,
                           units='V',
                           minval=-15,
                           maxval=25,
                           type=types.FloatType)
        self.add_parameter('dc_amplitude',
                           flags=Instrument.FLAG_GETSET,
                           units='V',
                           minval=-15,
                           maxval=25,
                           type=types.FloatType)
        self.add_parameter('dutycycle',
                           flags=Instrument.FLAG_GETSET,
                           units='pct',
                           minval=0,
                           maxval=100,
                           type=types.FloatType)

        if reset:
            self.init_default()
        self.get_all()
Exemplo n.º 48
0
   def __init__(self, name, address, reset=False):
      logging.info(__name__ + ' : Initializing instrument EG&G Model 5209')
      Instrument.__init__(self, name, tags=['physical'])

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

      # Sensitivity
      self._sen = 1.0

      # Add functions
      self.add_function('init_default')
      self.add_function ('get_all')
      self.add_function ('auto_measure')
      self.add_function ('auto_phase')

      # Add parameters
      self.add_parameter('value',
        flags=Instrument.FLAG_GET, units='V', type=types.FloatType,tags=['measure'])
      self.add_parameter('frequency',
        flags=Instrument.FLAG_GET, units='mHz', type=types.FloatType)
      self.add_parameter('sensitivity',
        flags=Instrument.FLAG_GETSET, units='', minval=1, maxval=15, type=types.IntType)
      self.add_parameter('timeconstant',
        flags=Instrument.FLAG_GETSET, units='', minval=1, maxval=15, type=types.IntType)
      self.add_parameter('sensitivity_v',
        flags=Instrument.FLAG_GETSET, units='V', minval=0.0, maxval=15.0, type=types.FloatType)
      self.add_parameter('timeconstant_t',
        flags=Instrument.FLAG_GETSET, units='s', minval=0.0, maxval=15.0, type=types.FloatType)

      self.add_parameter('filter',
        flags=Instrument.FLAG_GETSET, units='', minval=0, maxval=3, type=types.IntType)


      if reset:
       self.init_default()
      #self.get_all()

      self.get_sensitivity_v()
Exemplo n.º 49
0
    def __init__(self, name, channels=3):
        Instrument.__init__(self, name, tags=['positioner'])

        # Instrument parameters
        self.add_parameter('position',
            type=types.TupleType,
            flags=Instrument.FLAG_GET,
            format='%.03f, %.03f, %.03f')
        self.add_parameter('speed',
            type=types.TupleType,
            flags=Instrument.FLAG_SET|Instrument.FLAG_SOFTGET,
            format='%.1f, %.01f, %.01f')
        self.add_parameter('channels',
            type=types.IntType,
            flags=Instrument.FLAG_SET|Instrument.FLAG_SOFTGET)

        self.set_channels(channels)

        # Instrument functions
        self.add_function('start')
        self.add_function('stop')
        self.add_function('move_abs')
Exemplo n.º 50
0
    def __init__(self, name, id, serial, version):
        Instrument.__init__(self, name)

        self._id = id
        self._serial = serial
        self._version = version

        self.add_parameter('serial',
                           flags=Instrument.FLAG_GET,
                           type=types.StringType)

        self.add_parameter('version',
                           flags=Instrument.FLAG_GET,
                           type=types.StringType)

        self.add_parameter('position',
                           flags=Instrument.FLAG_GETSET,
                           type=types.IntType,
                           units='#')

        self.add_parameter('power',
                           flags=Instrument.FLAG_GETSET,
                           type=types.BooleanType)

        self.add_parameter('speed',
                           flags=Instrument.FLAG_GETSET,
                           type=types.FloatType,
                           doc="Speed, in (partial) steps per second")

        self.add_parameter('limits',
                           flags=Instrument.FLAG_GET,
                           doc="State of limit switches")

        self.add_function('move')
        self.add_function('reset')
        self.add_function('stop')

        self.reset()
        self.get_all()
Exemplo n.º 51
0
    def __init__(self, name, id, serial, version):
        Instrument.__init__(self, name)

        self._id = id
        self._serial = serial
        self._version = version

        self.add_parameter('serial',
            flags=Instrument.FLAG_GET,
            type=types.StringType)

        self.add_parameter('version',
            flags=Instrument.FLAG_GET,
            type=types.StringType)

        self.add_parameter('position',
            flags=Instrument.FLAG_GETSET,
            type=types.IntType,
            units='#')

        self.add_parameter('power',
            flags=Instrument.FLAG_GETSET,
            type=types.BooleanType)

        self.add_parameter('speed',
            flags=Instrument.FLAG_GETSET,
            type=types.FloatType,
            doc="Speed, in (partial) steps per second")

        self.add_parameter('limits',
            flags=Instrument.FLAG_GET,
            doc="State of limit switches")

        self.add_function('move')
        self.add_function('reset')
        self.add_function('stop')

        self.reset()
        self.get_all()
Exemplo n.º 52
0
    def __init__(self, name, channels=3):
        Instrument.__init__(self, name, tags=['positioner'])

        # Instrument parameters
        self.add_parameter('position',
                           type=types.TupleType,
                           flags=Instrument.FLAG_GET,
                           format='%.03f, %.03f, %.03f')
        self.add_parameter('speed',
                           type=types.TupleType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           format='%.1f, %.01f, %.01f')
        self.add_parameter('channels',
                           type=types.IntType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET)

        self.set_channels(channels)

        # Instrument functions
        self.add_function('start')
        self.add_function('stop')
        self.add_function('move_abs')
Exemplo n.º 53
0
    def __init__(self, name, address, ctr_addr=1, reset=False):
        Instrument.__init__(self, name)

        self._address = address
        self._visa = visa.instrument(self._address,
                                     baud_rate=57600,
                                     data_bits=8,
                                     stop_bits=1,
                                     parity=visa.no_parity,
                                     term_chars='\r\n')
        self._ctr_addr = ctr_addr

        self.add_parameter('position',
                           flags=Instrument.FLAG_GETSET,
                           type=types.FloatType,
                           units='mm')

        self.add_parameter('state',
                           flags=Instrument.FLAG_GET,
                           type=types.StringType)

        self.add_parameter('velocity',
                           flags=Instrument.FLAG_GETSET,
                           type=types.FloatType,
                           units='mm/s')

        # Functions
        self.add_function('stop_motion')
        self.add_function('set_state_ready')
        self.add_function('get_error')
        self.add_function('go_home')
        self.add_function('go_left')
        self.add_function('go_right')

        if reset:
            self.reset()
        else:
            self.get_all()
Exemplo n.º 54
0
    def __init__(self, name, reset=False):
        Instrument.__init__(self, name)

        self.add_parameter('frequency',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=0, maxval=20e9,
                units='Hz')
        self.add_parameter('power',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=-120, maxval=25,
                units='dBm')
        self.add_parameter('phase',
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET,
                minval=-180, maxval=180)
        self.add_parameter('status',
                type=types.StringType,
                option_list=('on', 'off'),
                flags=Instrument.FLAG_GETSET | \
                Instrument.FLAG_GET_AFTER_SET)

        # these are dummy values for an instrument that
        # is already running
        self._dummy_frequency = -99
        self._dummy_power = -99
        self._dummy_phase = -99
        self._dummy_status = 'on'

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