Example with ERASynth¶
For instrument details see https://erainstruments.com.
[1]:
from qcodes import Instrument
from qcodes_contrib_drivers.drivers.ERAInstruments import (
ERASynth, ERASynthPlus, ERASynthPlusPlus
)
[2]:
pip install pyusb pyvisa pyvisa-py
Requirement already satisfied: pyusb in c:\users\qblox\.conda\envs\q38\lib\site-packages (1.2.1)
Requirement already satisfied: pyvisa in c:\users\qblox\.conda\envs\q38\lib\site-packages (1.11.3)
Requirement already satisfied: pyvisa-py in c:\users\qblox\.conda\envs\q38\lib\site-packages (0.5.2)
Requirement already satisfied: typing-extensions in c:\users\qblox\.conda\envs\q38\lib\site-packages (from pyvisa) (3.10.0.2)
Note: you may need to restart the kernel to use updated packages.
[3]:
# list communication ports
ERASynth.print_pyvisa_resources()
('ASRL3::INSTR',)
[4]:
# Choose the right driver for you model
ERASynth, ERASynthPlus, ERASynthPlusPlus
[4]:
(qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynth,
qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynthPlus,
qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynthPlusPlus)
[5]:
Instrument.close_all()
# Instantiate the instrument
lo = ERASynthPlus("erasynth", 'ASRL3::INSTR')
Connected to: ERA Instruments ERASynth+ (serial:0165, firmware:v1.0.16) in 1.82s
Set a frequency and turn on¶
[7]:
lo.off() # Turn off the output
# Configure the local oscillator
lo.ref_osc_source("int") # Use internal reference
lo.frequency(4.7e9)
lo.power(10) # Set the amplitude to 10 dBm
lo.on() # Turn on the output
# print updated snapshot once to make sure the snapshot will be up-to-date
# takes a few seconds
lo.print_readable_snapshot(update=True)
erasynth:
parameter value
--------------------------------------------------------------------------------
IDN : {'vendor': 'ERA Instruments', 'model': 'ERASynth...
current : 1.47 (V)
debug_messages_en : False
embedded_version : v1.0.16
frequency : 4700000000 (Hz)
modulation_am_depth : 30 (%)
modulation_en : True
modulation_fm_deviation : 1000 (Hz)
modulation_freq : 2000 (Hz)
modulation_pulse_period : 0.003 (s)
modulation_pulse_width : 0.002 (s)
modulation_signal_waveform : sine
modulation_source : microphone
modulation_type : wideband_fm
pll_lmx1_status : locked
pll_lmx2_status : locked
pll_xtal_status : locked
power : 10 (dBm)
ref_osc_source : int
reference_tcxo_ocxo : ocxo
status : True
sweep_dwell : 0.001 (s)
sweep_en : False
sweep_start_frequency : 2000000000 (Hz)
sweep_step_frequency : 500000000 (Hz)
sweep_stop_frequency : 6000000000 (Hz)
sweep_trigger : external
synthesizer_mode : low_spurious
temperature : 26.1 (°C)
timeout : 10 (s)
voltage : 4.59 (V)
wifi_gateway_address : 222.222.222.222
wifi_hotspot_password :
wifi_hotspot_ssid :
wifi_ip_address : 222.222.222.222
wifi_mode :
wifi_rssi :
wifi_station_password :
wifi_station_ssid :
wifi_subnet_address : 222.222.222.222
Run a self test¶
[11]:
lo.run_self_test()
[53/53] Running...
Done!
Sweep mode¶
[12]:
lo.sweep_trigger("external") # external/freerun
# lo.sweep_dwell(100e-3) # used for freerun
[13]:
lo.sweep_start_frequency(1.2e9)
lo.sweep_stop_frequency(1.7e9)
lo.sweep_step_frequency(10e6)
[14]:
lo.sweep_en(True)
Communication performance¶
The driver confirms that certain parameters have been set correctly blocking the python kernel untill succeding. Some commands are going to take longer than a usual serial command.
[15]:
%%timeit
lo.status(True)
20 ms ± 147 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
[16]:
%%timeit
lo.frequency(3e9)
8.09 ms ± 178 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
[17]:
%%timeit
lo.power(0.1)
6.27 ms ± 210 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
[19]:
%%timeit
lo.sweep_start_frequency(1.2e9)
143 ms ± 277 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)