qcodes_contrib_drivers.drivers.ERAInstruments package

Submodules

qcodes_contrib_drivers.drivers.ERAInstruments.erasynth module

Driver for the ERASynth/ERASynth+/ERASynth++ signal generators.

Author: Victor Negîrneac, vnegirneac@qblox.com

For official instrument support visit:

This module provides the following drivers:

class qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynth(*args: Any, **kwargs: Any)[source]

Bases: ERASynthBase

Driver for the ERASynth model instrument.

For ERASynth+/ERASynth++ see EraSynthPlus/EraSynthPlusPlus classes.

reference_tcxo_ocxo = Parameter( name="reference_tcxo_ocxo", instrument=self, val_mapping={"tcxo": "0", "ocxo": "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['P5']}", )

NB not tested if this parameter is available for the ERASynth model (<6GHz)!

class qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynthBase(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

A Base class for the ERASynth/ERASynth+/ERASynth++ instruments.

Example:

from qcodes import Instrument
from qcodes_contrib_drivers.drivers.ERAInstruments import ERASynthPlus

# list communication ports
ERASynthPlus.print_pyvisa_resources()

# Instantiate the instrument
lo = ERASynthPlus("ERASynthPlus", 'ASRL/dev/cu.usbmodem14101::INSTR')

lo.off()  # Turn off 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)

# 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

See also

The raw serial commands can be found here: https://github.com/erainstruments/erasynth-docs/blob/master/erasynth-command-list.pdf

self.visa_handle can be used to interact directly with the serial pyvisa communication.

__init__(name: str, address: str, **kwargs)[source]

Create an instance of the instrument.

Parameters:
ask(cmd: str) str[source]

Writes a command to the communication channel of the instrument and return the response.

Commands are prefixed with “>” as required by the ERASynth.

NB the read buffer is discarded before and after reading one line.

ask_raw(cmd: str) str[source]

Detects special commands for which the get_configuration will be used.

This makes it convenient to not implement individual getters for most commands.

clear_read_buffer() None[source]

Clears the read buffer. The instrument often sends information we do not care about in this driver. This function discards the entire read buffer by reading it.

esp8266_upload_mode() None[source]

Sets the ESP8266 module in upload mode.

factory_reset() None[source]

Does factory reset on the device.

get_configuration(par_name: str | None = None) Dict[str, str] | str[source]

Returns the configuration JSON that contains all parameters.

get_diagnostic_status(par_name: str | None = None) Dict[str, str] | str[source]

Returns the diagnostic JSON.

get_idn() Dict[str, str | None][source]

Parse a standard VISA *IDN? response into an ID dict.

Even though this is the VISA standard, it applies to various other types as well, such as IPInstruments, so it is included here in the Instrument base class.

Override this if your instrument does not support *IDN? or returns a nonstandard IDN string. This string is supposed to be a comma-separated list of vendor, model, serial, and firmware, but semicolon and colon are also common separators so we accept them here as well.

Returns:

A dict containing vendor, model, serial, and firmware.

off() None[source]

Turns OFF the RF output.

on() None[source]

Turns ON the RF output.

preset() None[source]

Presets the device to known values.

Warning

After the reset the output is set to power 0.0 dBm @ 1GHz!

static print_pyvisa_resources() None[source]

Utility to list all.

run_self_test() None[source]

Sets all settable parameters to different values.

NB serves as self test of the instrument because setting readable parameters is done by setting and confirming the value.

wifi_off() None[source]

Turn ESP8266 WiFi module off.

wifi_on() None[source]

Turn ESP8266 WiFi module on.

write(cmd: str) None[source]

Writes a command to the communication channel of the instrument.

Commands are prefixed with “>” as required by the ERASynth.

NB the read buffer is discarded before and after reading one line.

write_raw(cmd: str) None[source]

For some commands we confirm that the value has been set correctly.

This is only possible for configurations that can be retrieved from the instrument.

current = Parameter( name="current", instrument=self, label="Current", unit="V", get_cmd="RD:current", )

The current value drawn by the ERASynth.

debug_messages_en = Parameter( name="debug_messages_en", instrument=self, vals=validators.Strings(), initial_cache_value=None, val_mapping={True: "1", False: "0"}, set_cmd="PD{}", )

Enables/disables debug printing on the serial port.

embedded_version = Parameter( name="embedded_version", instrument=self, label="Embedded version", get_cmd="RD:em", )

The firmware version of the ERASynth.

modulation_am_depth = Parameter( name="modulation_am_depth", instrument=self, label="AM depth", unit="%", vals=validators.Numbers(min_value=0, max_value=100), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M5']}", get_parser=int, set_cmd="M5{}", set_parser=lambda depth: str(int(depth)), )

AM modulation depth.

modulation_en = Parameter( name="modulation_en", instrument=self, val_mapping={False: "0", True: "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['MS']}", set_cmd="MS{}", )

Modulation on/off.

modulation_fm_deviation = Parameter( name="modulation_fm_deviation", instrument=self, label="FM deviation", unit="Hz", vals=validators.Numbers(min_value=0, max_value=20e9), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M4']}", get_parser=int, set_cmd="M4{}", set_parser=lambda freq: str(int(freq)), )

FM modulation deviation.

modulation_freq = Parameter( name="modulation_freq", instrument=self, label="Modulation frequency", unit="Hz", vals=validators.Numbers(min_value=0, max_value=20e9), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M3']}", get_parser=int, set_cmd="M3{}", set_parser=lambda freq: str(int(freq)), )

Internal modulation frequency in Hz.

modulation_pulse_period = Parameter( name="modulation_pulse_period", instrument=self, label="Pulse period", unit="s", vals=validators.Numbers(min_value=1e-6, max_value=10), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M6']}", get_parser=lambda val: int(val) * 1e-6, set_cmd="M6{}", set_parser=lambda period: str(int(period * 1e6)), )

Pulse period in seconds.

modulation_pulse_width = Parameter( name="modulation_pulse_width", instrument=self, label="Pulse width", unit="s", vals=validators.Numbers(min_value=1e-6, max_value=10), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M7']}", get_parser=lambda val: int(val) * 1e-6, set_cmd="M7{}", set_parser=lambda period: str(int(period * 1e6)), )

Pulse width in s.

modulation_signal_waveform = Parameter( name="modulation_signal_waveform", instrument=self, val_mapping={"sine": "0", "triangle": "1", "ramp": "2", "square": "3"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M2']}", set_cmd="M2{}", )

Internal modulation waveform.

modulation_source = Parameter( name="modulation_source", instrument=self, val_mapping={"internal": "0", "external": "1", "microphone": "2"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M1']}", set_cmd="M1{}", )

Modulation source.

modulation_type = Parameter( name="modulation_type", instrument=self, val_mapping={ "narrowband_fm": "0", "wideband_fm": "1", "am": "2", "pulse": "3", }, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['M0']}", set_cmd="M0{}", )

Modulation type.

pll_lmx1_status = Parameter( name="pll_lmx1_status", instrument=self, label="PLL LMX1 status", val_mapping={"locked": "1", "unlocked": "0"}, get_cmd="RD:lock_lmx1", )

PLL lock status of LMX1.

pll_lmx2_status = Parameter( name="pll_lmx2_status", instrument=self, label="PLL LMX2 status", val_mapping={"locked": "1", "unlocked": "0"}, get_cmd="RD:lock_lmx2", )

PLL lock status of LMX2.

pll_xtal_status = Parameter( name="pll_xtal_status", instrument=self, label="PLL XTAL status", val_mapping={"locked": "1", "unlocked": "0"}, get_cmd="RD:lock_xtal", )

PLL lock status of XTAL.

power = Parameter( name="power", instrument=self, label="Power", unit="dBm", vals=validators.Numbers(min_value=-60.0, max_value=20.0), get_cmd="RA:amplitude", get_parser=float, set_parser=lambda power: f"{power:.2f}", set_cmd=self._set_power, )

Signal power in dBm of the ERASynth signal, ‘amplitude’ in EraSynth docs.

ref_osc_source = Parameter( name="ref_osc_source", instrument=self, val_mapping={"int": "0", "ext": "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['P1']}", set_cmd="P1{}", )

Set to external if a 10 MHz reference is connected to the REF input connector.

status = Parameter( name="status", instrument=self, val_mapping={False: "0", True: "1"}, get_cmd="RA:rfoutput", set_cmd=self._set_status, )

Sets the output state (True/False).

sweep_dwell = Parameter( name="sweep_dwell", instrument=self, label="Sweep dwell", unit="s", vals=validators.Numbers(min_value=1e-3, max_value=10), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['S4']}", get_parser=lambda val: int(val) * 1e-3, set_cmd="S4{}", set_parser=lambda period: str(int(period * 1e3)), )

Sweep dwell time in s. Requires sweep_trigger(‘freerun’).

sweep_en = Parameter( name="sweep_en", instrument=self, val_mapping={False: "0", True: "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['SS']}", set_cmd="SS{}", )

Sweep on/off.

sweep_trigger = Parameter( name="sweep_trigger", instrument=self, val_mapping={"freerun": "0", "external": "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['S0']}", set_cmd="S0{}", )

Sweep trigger freerun/external.

synthesizer_mode = Parameter( name="synthesizer_mode", instrument=self, val_mapping={"low_spurious": "0", "low_phase_noise": "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['P9']}", set_cmd="P9{}", )

Synthesizer mode, low spurious/low phase noise.

temperature = Parameter( name="temperature", instrument=self, label="Temperature", unit="\u00B0C", get_cmd="RD:temperature", )

Temperature of the device.

voltage = Parameter( name="voltage", instrument=self, label="Voltage", unit="V", get_cmd="RD:voltage", )

The input voltage value from power input of the ERASynth.

wifi_gateway_address = Parameter( name="wifi_gateway_address", instrument=self, vals=validators.Strings(), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PEG']}", set_cmd="PEG{}", )

Sets default gateway for WiFi module.

wifi_hotspot_password = Parameter( name="wifi_hotspot_password", instrument=self, vals=validators.Strings(), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PEP1']}", set_cmd="PEP1{}", )

Sets hotspot password for WiFi module.

wifi_hotspot_ssid = Parameter( name="wifi_hotspot_ssid", instrument=self, vals=validators.Strings(), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PES1']}", set_cmd="PES1{}", )

Sets hotspot SSID for WiFi module.

wifi_ip_address = Parameter( name="wifi_ip_address", instrument=self, vals=validators.Strings(), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PEI']}", set_cmd="PEI{}", )

Sets IP address for WiFi module.

wifi_mode = Parameter( name="wifi_mode", instrument=self, val_mapping={"station": "0", "hotspot": "1", "": ""}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PEW']}", set_cmd="PEW{}", )

WiFi Mode, station/hotspot.

wifi_rssi = Parameter( name="wifi_rssi", instrument=self, label="WiFi RSSI", get_cmd="RD:rssi", )

The Wifi received signal power.

wifi_station_password = Parameter( name="wifi_station_password", instrument=self, vals=validators.Strings(), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PEP0']}", set_cmd="PEP0{}", )

Sets network password for WiFi module.

wifi_station_ssid = Parameter( name="wifi_station_ssid", instrument=self, vals=validators.Strings(), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PES0']}", set_cmd="PES0{}", )

Sets network SSID for WiFi module.

wifi_subnet_address = Parameter( name="wifi_subnet_address", instrument=self, vals=validators.Strings(), get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['PEN']}", set_cmd="PEN{}", )

Sets Subnet mask for WiFi module.

class qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynthPlus(*args: Any, **kwargs: Any)[source]

Bases: ERASynthBase

Driver for the ERASynth+ model instrument.

For ERASynth/ERASynth++ see EraSynth/EraSynthPlusPlus classes.

reference_tcxo_ocxo = Parameter( name="reference_tcxo_ocxo", instrument=self, val_mapping={"tcxo": "0", "ocxo": "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['P5']}", set_cmd="P5{}", )

Chooses reference type.

class qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynthPlusPlus(*args: Any, **kwargs: Any)[source]

Bases: ERASynthBase

Driver for the ERASynth++ model instrument.

For ERASynth/ERASynth+ see EraSynth/EraSynthPlus classes.

reference_tcxo_ocxo = Parameter( name="reference_tcxo_ocxo", instrument=self, val_mapping={"tcxo": "0", "ocxo": "1"}, get_cmd=f"RA:{_CMD_TO_JSON_MAPPING['P5']}", set_cmd="P5{}", )

Chooses reference type.

Module contents