RE = RunEngine({})
db = Broker.named('local_file')  # a broker poses queries for saved data sets

# Insert all metadata/data captured into db.
RE.subscribe(db.insert)

# ------------------------------------------------
#           Lock-In Amplifier
# ------------------------------------------------
print(
    'Warning ... The address to the serial adapter \n (E.g. /dev/tty.USA19H141113P1.1) can change '
)
scpi_lia = open_by_name(
    name='srs_lockin')  # name within the configuration file (config.yaml)
LIA, component_dict = generate_ophyd_obj(name='LockIn', scpi_obj=scpi_lia)
lia = LIA(name='lockin')
lia.reset.set(0)
RE.md['lock_in'] = lia.id.get()

# setup lock-in
# similar to a stage, but specific to this experiment
test_frequency = 5e6 / 512 / 8
lia.reset.set(None)
lia.fmode.set('Ext')
lia.in_gnd.set('float')
lia.in_config.set('A')
lia.in_couple.set('DC')
lia.freq.set(test_frequency)
lia.sensitivity.set(20e-6)  # 20 uV RMS full-scale
tau = 0.1
示例#2
0
from instrbuilder.instrument_opening import open_by_name

RE = RunEngine({})
db = Broker.named('temp')  # a broker poses queries for saved data sets

# Insert all metadata/data captured into db.
RE.subscribe(db.insert)

# ------------------------------------------------
#           Function Generator
# ------------------------------------------------
fg_scpi = open_by_name(
    name='old_fg')  # name within the configuration file (config.yaml)
fg_scpi.name = 'fg'
FG, component_dict = generate_ophyd_obj(name='fg', scpi_obj=fg_scpi)
fg = FG(name='fg')
RE.md['fg'] = fg.id.get()

# setup control of the amplitude sweep
fg.v.delay = 0.05

# configure the function generator
fg.reset.set(None)  # start fresh
fg.function.set('SIN')
fg.load.set('INF')
fg.freq.set(1000)
fg.v.set(1.6)
fg.offset.set(0)
fg.output.set('ON')
    )

from instrbuilder.instrument_opening import open_by_name
from instrbuilder.instruments import create_ada2200

RE = RunEngine({})
db = Broker.named('local_file')  # a broker poses queries for saved data sets
# Insert all metadata/data captured into db.
RE.subscribe(db.insert)

# ------------------------------------------------
#           Multimeter
# ------------------------------------------------
scpi_dmm = open_by_name(name='my_multi')
scpi_dmm.name = 'dmm'
DMM, component_dict = generate_ophyd_obj(name='Multimeter', scpi_obj=scpi_dmm)
dmm = DMM(name='multimeter')

# configure for fast burst reads
dmm.volt_autozero_dc.set(0)
dmm.volt_aperture.set(20e-6)
dmm.volt_range_auto_dc.set(0)  # turn off auto-range
dmm.volt_range_dc.set(10)  # set range

# create an object that returns statistics calculated on the arrays returned by read_buffer
# the name is derived from the parent
# (e.g. lockin and from the signal that returns an array e.g. read_buffer)
dmm_burst_stats = BasicStatistics(name='', array_source=dmm.burst_volt_timer)
dmm_filter_stats = FilterStatistics(name='', array_source=dmm.burst_volt_timer)

# ------------------------------------------------
示例#4
0
    print('Ophyd fork is not installed')
    print('First, (if needed) uninstall base ophyd:')
    print('  $ python -m pip uninstall ophyd')
    print('Next, install the fork:')
    print(
        '  $ python -m pip install git+https://github.com/lucask07/ophyd@master#egg=ophyd'
    )

from instrbuilder.instrument_opening import open_by_name
from instrbuilder.instruments import create_ada2200

# ------------------------------------------------
#           Multimeter
# ------------------------------------------------
scpi_dmm = open_by_name(name='my_multi')
DMM, component_dict = generate_ophyd_obj(name='Multimeter', scpi_obj=scpi_dmm)
dmm = DMM(name='multimeter')

# ------------------------------------------------
#           ADA2200 SPI Control with Aardvark
# ------------------------------------------------
ada2200_scpi = create_ada2200()
SPI, component_dict = generate_ophyd_obj(name='ada2200_spi',
                                         scpi_obj=ada2200_scpi)
ada2200 = SPI(name='ada2200')

ada2200.serial_interface.set(0x18)  # enables SDO (bit 4,3 = 1)
ada2200.demod_control.set(0x10)  # bit 3: 0 = SDO to RCLK

time.sleep(0.1)
v = dmm.meas_volt_dc.get()