qcodes.instrument_drivers.Keysight.keysightb1500 package
Submodules
qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_base module
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_base.KeysightB1500(*args: Any, **kwargs: Any)[source]
Bases:
VisaInstrument
Driver for Keysight B1500 Semiconductor Parameter Analyzer.
For the list of supported modules, refer to
from_model_name()
.- calibration_time_out = 60
- write(cmd: str) None [source]
Extend write method from the super to ask for error message each time a write command is called.
- add_module(name: str, module: B1500Module) None [source]
- static from_model_name(model: str, slot_nr: int, parent: KeysightB1500, name: Optional[str] = None) B1500Module [source]
Creates the correct instance of instrument module by model name.
- Parameters
model – Model name such as ‘B1517A’
slot_nr – Slot number of this module (not channel number)
parent – Reference to B1500 mainframe instance
name – Name of the instrument instance to create. If None (Default), then the name is autogenerated from the instrument class.
- Returns
A specific instance of
B1500Module
- enable_channels(channels: Optional[Sequence[Union[ChNr, int]]] = None) None [source]
Enable specified channels.
If channels is omitted or None, then all channels are enabled.
- disable_channels(channels: Optional[Sequence[Union[ChNr, int]]] = None) None [source]
Disable specified channels.
If channels is omitted or None, then all channels are disabled.
- parse_spot_measurement_response() SpotResponse
Extract measured value and accompanying metadata from the string and return them as a dictionary.
- Parameters
response – Response str to spot measurement query.
- Returns
Dictionary with measured value and associated metadata (e.g. timestamp, channel number, etc.)
- parse_module_query_response() Dict[SlotNr, str]
Extract installed module information from the given string and return the information as a dictionary.
- Parameters
response – Response str to UNT? 0 query.
- Returns
Dictionary from slot numbers to model name strings.
- use_nplc_for_high_speed_adc(n: Optional[int] = None) None [source]
Set the high-speed ADC to NPLC mode, with optionally defining number of averaging samples via argument n.
- Parameters
n –
Value that defines the number of averaging samples given by the following formula:
Number of averaging samples = n / 128
.n=1 to 100. Default setting is 1 (if None is passed).
The Keysight B1500 gets 128 samples in a power line cycle, repeats this for the times you specify, and performs averaging to get the measurement data. (For more info see Table 4-21.). Note that the integration time will not be updated if a non-integer value is written to the B1500.
- use_nplc_for_high_resolution_adc(n: Optional[int] = None) None [source]
Set the high-resolution ADC to NPLC mode, with optionally defining the number of PLCs per sample via argument n.
- Parameters
n –
Value that defines the integration time given by the following formula:
Integration time = n / power line frequency
.n=1 to 100. Default setting is 1 (if None is passed). (For more info see Table 4-21.). Note that the integration time will not be updated if a non-integer value is written to the B1500.
- use_manual_mode_for_high_speed_adc(n: Optional[int] = None) None [source]
Set the high-speed ADC to manual mode, with optionally defining number of averaging samples via argument n.
Use
n=1
to disable averaging (n=None
uses the default setting from the instrument which is alson=1
).- Parameters
n – Number of averaging samples, between 1 and 1023. Default setting is 1. (For more info see Table 4-21.) Note that the integration time will not be updated if a non-integer value is written to the B1500.
- self_calibration(slot: Optional[Union[SlotNr, int]] = None) CALResponse [source]
Performs the self calibration of the specified module (SMU) and returns the result. Failed modules are disabled, and can only be enabled by the
RCV
command.Calibration takes about 30 seconds (the visa timeout for it is controlled by
calibration_time_out
attribute).Execution Conditions: No SMU may be in the high voltage state (forcing more than ±42 V, or voltage compliance set to more than ±42 V). Before starting the calibration, open the measurement terminals.
- Parameters
slot – Slot number of the slot that installs the module to perform the self-calibration. For Ex: constants.SlotNr.ALL, MAINFRAME, SLOT01, SLOT02 …SLOT10 If not specified, the calibration is performed for all the modules and the mainframe.
- error_message(mode: Optional[Union[Mode, int]] = None) str [source]
This method reads one error code from the head of the error queue and removes that code from the queue. The read error is returned as the response of this method.
- Parameters
mode – If no valued passed returns both the error value and the error message. See
constants.ERRX.Mode
for possible arguments.- Returns
In the default case response message contains an error message and a custom message containing additional information such as the slot number. They are separated by a semicolon (;). For example, if the error 305 occurs on the slot 1, this method returns the following response. 305,”Excess current in HPSMU.; SLOT1” If no error occurred, this command returns 0,”No Error.”
- clear_buffer_of_error_message() None [source]
This method clears the error message stored in buffer when the error_message command is executed.
- clear_timer_count(chnum: Optional[int] = None) None [source]
This command clears the timer count. This command is effective for all measurement modes, regardless of the TSC setting. This command is not effective for the 4 byte binary data output format (FMT3 and FMT4).
- Parameters
chnum – SMU or MFCMU channel number. Integer expression. 1 to 10. See Table 4-1 on page 16 of 2016 manual. If chnum is specified, this command clears the timer count once at the source output start by the DV, DI, or DCV command for the specified channel. The channel output switch of the specified channel must be ON when the timer count is cleared.
If chnum is not specified, this command clears the timer count immediately,
- set_measurement_mode(mode: Union[Mode, int], channels: Optional[Sequence[Union[ChNr, int]]] = None) None [source]
This method specifies the measurement mode and the channels used for measurements. This method must be entered to specify the measurement mode. For the high speed spot measurements, do not use this method. NOTE Order of the channels are important. The SMU which is setup to run the sweep goes first.
- Parameters
mode – Measurement mode. See constants.MM.Mode for all possible modes
channels – Measurement channel number. See constants.ChannelList for all possible channels.
- get_measurement_mode() Dict[str, Union[Mode, List[int]]] [source]
This method gets the measurement mode(MM) and the channels used for measurements. It outputs a dictionary with ‘mode’ and ‘channels’ as keys.
- get_response_format_and_mode() Dict[str, Union[Format, Mode]] [source]
This method queries the the data output format and mode.
- enable_smu_filters(enable_filter: bool, channels: Optional[Sequence[Union[ChNr, int]]] = None) None [source]
This methods sets the connection mode of a SMU filter for each channel. A filter is mounted on the SMU. It assures clean source output with no spikes or overshooting. A maximum of ten channels can be set.
- Parameters
enable_filter – Status of the filter. False: Disconnect (initial setting). True: Connect.
channels – SMU channel number. Specify channel from constants.ChNr If you do not specify chnum, the FL command sets the same mode for all channels.
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- ask(cmd: str) str
Write a command string to the hardware and return a response.
Subclasses that transform
cmd
should override this method, and in it callsuper().ask(new_cmd)
. Subclasses that define a new hardware communication should instead overrideask_raw
.- Parameters
cmd – The string to send to the instrument.
- Returns
response
- Raises
Exception – Wraps any underlying exception with extra context, including the command and the instrument.
- ask_raw(cmd: str) str
Low-level interface to
visa_handle.ask
.- Parameters
cmd – The command to send to the instrument.
- Returns
The instrument’s response.
- Return type
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- check_error(ret_code: int) None
Default error checking, raises an error if return code
!=0
. Does not differentiate between warnings or specific error messages. Override this function in your driver if you want to add specific error messages.- Parameters
ret_code – A Visa error code. See eg: https://github.com/hgrecco/pyvisa/blob/master/pyvisa/errors.py
- Raises
visa.VisaIOError – if
ret_code
indicates a communication problem.
- classmethod close_all() None
Try to close all instruments registered in
_all_instruments
This is handy for use with atexit to ensure that all instruments are closed when a python session is closed.Examples
>>> atexit.register(qc.Instrument.close_all())
- connect_message(idn_param: str = 'IDN', begin_time: Optional[float] = None) None
Print a standard message on initial connection to an instrument.
- Parameters
idn_param – Name of parameter that returns ID dict. Default
IDN
.begin_time –
time.time()
when init started. Default isself._t0
, set at start ofInstrument.__init__
.
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- static exist(name: str, instrument_class: Optional[type] = None) bool
Check if an instrument with a given names exists (i.e. is already instantiated).
- Parameters
name – Name of the instrument.
instrument_class – The type of instrument you are looking for.
- classmethod find_instrument(name: str, instrument_class: Optional[Type[T]] = None) T
Find an existing instrument by name.
- Parameters
name – Name of the instrument.
instrument_class – The type of instrument you are looking for.
- Returns
The instrument found.
- Raises
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- get_idn() Dict[str, Optional[str]]
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.
- classmethod instances() List[Instrument]
Get all currently defined instances of this instrument class.
You can use this to get the objects back if you lose track of them, and it’s also used by the test system to find objects to test against.
- Returns
A list of instances.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- static is_valid(instr_instance: Instrument) bool
Check if a given instance of an instrument is valid: if an instrument has been closed, its instance is not longer a “valid” instrument.
- Parameters
instr_instance – Instance of an Instrument class or its subclass.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: Optional[qcodes.instrument.instrument_base.InstrumentBase]
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- classmethod record_instance(instance: Instrument) None
Record (a weak ref to) an instance in a class’s instance list.
Also records the instance in list of all instruments, and verifies that there are no other instruments with the same name.
This method is called after initialization of the instrument is completed.
- Parameters
instance – Instance to record.
- Raises
KeyError – If another instance with the same name is already present.
- classmethod remove_instance(instance: Instrument) None
Remove a particular instance from the record.
- Parameters
instance – The instance to remove
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- set_address(address: str) None
Set the address for this instrument.
- Parameters
address – The visa resource name to use to connect. The address should be the actual address and just that. If you wish to change the backend for VISA, use the self.visalib attribute (and then call this function).
- set_terminator(terminator: Optional[str]) None
Change the read terminator to use.
- Parameters
terminator – Character(s) to look for at the end of a read and to end each write command with. eg.
\r\n
. If None the terminator will not be set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = True, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If True, update the state by querying the instrument. If None only update if the state is known to be invalid. If False, just use the latest values in memory and never update.
params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- write_raw(cmd: str) None
Low-level interface to
visa_handle.write
.- Parameters
cmd – The command to send to the instrument.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_base.IVSweepMeasurement(name: str, instrument: B1517A, **kwargs: Any)[source]
Bases:
MultiParameter
,StatusMixin
IV sweep measurement outputs a list of measured current parameters as a result of voltage sweep.
- Parameters
name – Name of the Parameter.
instrument – Instrument to which this parameter communicates to.
- property instrument: Optional[InstrumentBase]
Return the first instrument that this parameter is bound to. E.g if this is bound to a channel it will return the channel and not the instrument that the channel is bound too. Use
root_instrument()
to get the real instrument.
- property root_instrument: Optional[InstrumentBase]
Return the fundamental instrument that this parameter belongs too. E.g if the parameter is bound to a channel this will return the fundamental instrument that that channel belongs to. Use
instrument()
to get the channel.
- set_names_labels_and_units(names: Optional[Sequence[str]] = None, labels: Optional[Sequence[str]] = None, units: Optional[Sequence[str]] = None) None [source]
Set names, labels, and units of the measured parts of the MultiParameter.
If units are not provided, “A” will be used because this parameter measures currents.
If labels are not provided, names will be used.
If names are not provided,
param#
will be used as names; the number of those names will be the same as the number of measured channels thatB1500.get_measurement_mode
method returns. Note that it is possible to not provide names and provide labels at the same time. In case, neither names nor labels are provided, the labels will be generated asParam# Current
.The number of provided names, labels, and units must be the same. Moreover, that number has to be equal to the number of channels that
B1500.get_measurement_mode
method returns. It is recommended to set measurement mode and number of channels first, and only then call this method to provide names/labels/units.The name/label/unit of the setpoint of this parameter will also be updated to defaults dictated by the
set_setpoint_name_label_and_unit
method.Note that
.shapes
of this parameter will also be updated to be in sync with the number of names.
- set_setpoint_name_label_and_unit(name: Optional[str] = None, label: Optional[str] = None, unit: Optional[str] = None) None [source]
Set name, label, and unit of the setpoint of the MultiParameter.
If unit is not provided, “V” will be used because this parameter sweeps voltage.
If label is not provided, “Voltage” will be used.
If name are not provided,
voltage
will be used.The attributes describing the setpoints of this MultiParameter will be updated to match the number of measured parameters of this MultiParameter, as dictated by
.names
.
- get_raw() Tuple[Tuple[float, ...], ...] [source]
get_raw
is called to perform the actual data acquisition from the instrument. This method should either be overwritten to perform the desired operation or alternatively forParameter
a suitable method is automatically generated ifget_cmd
is supplied to the parameter constructor. The method is automatically wrapped to provide aget
method on the parameter instance.
- property full_name: str
Name of the parameter including the name of the instrument and submodule that the parameter may be bound to. The names are separated by underscores, like this:
instrument_submodule_parameter
.
- property full_names: Tuple[str, ...]
Names of the parameter components including the name of the instrument and submodule that the parameter may be bound to. The name parts are separated by underscores, like this:
instrument_submodule_parameter
- get_ramp_values(value: Union[float, Sized], step: Optional[float] = None) Sequence[Union[float, Sized]]
Return values to sweep from current value to target value. This method can be overridden to have a custom sweep behaviour. It can even be overridden by a generator.
- Parameters
value – target value
step – maximum step size
- Returns
List of stepped values, including target value.
- property inter_delay: float
Delay time between consecutive set operations. The actual time will not be shorter than this, but may be longer if the underlying set call takes longer.
Typically used in conjunction with step to create an effective ramp rate, but can also be used without a step to enforce a delay between sets.
- Getter
Returns the current inter_delay.
- Setter
Sets the value of the inter_delay.
- Raises
TypeError – If delay is not int nor float
ValueError – If delay is negative
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the parameter. This is identical to
short_name()
.
- property post_delay: float
Delay time after start of set operation, for each set. The actual time will not be shorter than this, but may be longer if the underlying set call takes longer.
Typically used in conjunction with step to create an effective ramp rate, but can also be used without a step to enforce a delay after every set. One might think of post_delay as how long a set operation is supposed to take. For example, there might be an instrument that needs extra time after setting a parameter although the command for setting the parameter returns quickly.
- Getter
Returns the current post_delay.
- Setter
Sets the value of the post_delay.
- Raises
TypeError – If delay is not int nor float
ValueError – If delay is negative
- property raw_value: Any
Note that this property will be deprecated soon. Use
cache.raw_value
instead.Represents the cached raw value of the parameter.
- Getter
Returns the cached raw value of the parameter.
- restore_at_exit(allow_changes: bool = True) _SetParamContext
Use a context manager to restore the value of a parameter after a
with
block.By default, the parameter value may be changed inside the block, but this can be prevented with
allow_changes=False
. This can be useful, for example, for debugging a complex measurement that unintentionally modifies a parameter.Example
>>> p = Parameter("p", set_cmd=None, get_cmd=None) >>> p.set(2) >>> with p.restore_at_exit(): ... p.set(3) ... print(f"value inside with block: {p.get()}") # prints 3 >>> print(f"value after with block: {p.get()}") # prints 2 >>> with p.restore_at_exit(allow_changes=False): ... p.set(5) # raises an exception
- set_raw(value: Any) None
set_raw
is called to perform the actual setting of a parameter on the instrument. This method should either be overwritten to perform the desired operation or alternatively forParameter
a suitable method is automatically generated ifset_cmd
is supplied to the parameter constructor. The method is automatically wrapped to provide aset
method on the parameter instance.
- set_to(value: Any, allow_changes: bool = False) _SetParamContext
Use a context manager to temporarily set a parameter to a value. By default, the parameter value cannot be changed inside the context. This may be overridden with
allow_changes=True
.Examples
>>> from qcodes.parameters import Parameter >>> p = Parameter("p", set_cmd=None, get_cmd=None) >>> p.set(2) >>> with p.set_to(3): ... print(f"p value in with block {p.get()}") # prints 3 ... p.set(5) # raises an exception >>> print(f"p value outside with block {p.get()}") # prints 2 >>> with p.set_to(3, allow_changes=True): ... p.set(5) # now this works >>> print(f"value after second block: {p.get()}") # still prints 2
- property setpoint_full_names: Optional[Sequence[Sequence[str]]]
Full names of setpoints including instrument names, if available
- property short_name: str
Short name of the parameter. This is without the name of the instrument or submodule that the parameter may be bound to. For full name refer to
full_name()
.
- property short_names: Tuple[str, ...]
short_names is identical to names i.e. the names of the parameter parts but does not add the instrument name.
It exists for consistency with instruments and other parameters.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = True, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the parameter as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).If the parameter has been initiated with
snapshot_value=False
, the snapshot will NOT include thevalue
andraw_value
of the parameter.- Parameters
update – If True, update the state by calling
parameter.get()
unlesssnapshot_get
of the parameter isFalse
. Ifupdate
isNone
, use the current value from thecache
unless the cache is invalid. IfFalse
, never callparameter.get()
.params_to_skip_update – No effect but may be passed from superclass
- Returns
base snapshot
- property step: Optional[float]
Stepsize that this Parameter uses during set operation. Stepsize must be a positive number or None. If step is a positive number, this is the maximum value change allowed in one hardware call, so a single set can result in many calls to the hardware if the starting value is far from the target. All but the final change will attempt to change by +/- step exactly. If step is None stepping will not be used.
- Getter
Returns the current stepsize.
- Setter
Sets the value of the step.
- Raises
TypeError – if step is set to not numeric or None
ValueError – if step is set to negative
TypeError – if step is set to not integer or None for an integer parameter
TypeError – if step is set to not a number on None
- property underlying_instrument: Optional[InstrumentBase]
Returns an instance of the underlying hardware instrument that this parameter communicates with, per this parameter’s implementation.
This is useful in the case where a parameter does not belongs to an instrument instance that represents a real hardware instrument but actually uses a real hardware instrument in its implementation (e.g. via calls to one or more parameters of that real hardware instrument). This is also useful when a parameter does belong to an instrument instance but that instance does not represent the real hardware instrument that the parameter interacts with: hence
root_instrument
of the parameter cannot be thehardware_instrument
, howeverunderlying_instrument
can be implemented to return thehardware_instrument
.By default it returns the
root_instrument
of the parameter.
- validate(value: Any) None
Validate the value supplied.
- Parameters
value – value to validate
- Raises
TypeError – If the value is of the wrong type.
ValueError – If the value is outside the bounds specified by the validator.
qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module module
- exception qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.MeasurementNotTaken[source]
Bases:
Exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.fmt_response_base_parser(raw_data_val: str) _FMTResponse [source]
Parse the response from SPA for FMT 1,0 format into a named tuple with names, value (value of the data), status (Normal or with compliance error such as C, T, V), channel (channel number of the output data such as CH1,CH2), type (current ‘I’ or voltage ‘V’). This parser is tested for FMT1,0 and FMT1,1 response.
- Parameters
raw_data_val – Unparsed (raw) data for the instrument.
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.parse_module_query_response(response: str) Dict[SlotNr, str] [source]
Extract installed module information from the given string and return the information as a dictionary.
- Parameters
response – Response str to UNT? 0 query.
- Returns
Dictionary from slot numbers to model name strings.
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.parse_dcv_measurement_response(response: str) Dict[str, Union[str, float]] [source]
Extract status, channel number, value and accompanying metadata from the string and return them as a dictionary.
- Parameters
response – Response str to lrn_query For the MFCMU.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.SpotResponse(_typename, _fields=None, /, **kwargs)[source]
Bases:
dict
- clear() None. Remove all items from D.
- copy() a shallow copy of D
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- pop(k[, d]) v, remove specified key and return the corresponding value.
If key is not found, default is returned if given, otherwise KeyError is raised
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F.
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.parse_spot_measurement_response(response: str) SpotResponse [source]
Extract measured value and accompanying metadata from the string and return them as a dictionary.
- Parameters
response – Response str to spot measurement query.
- Returns
Dictionary with measured value and associated metadata (e.g. timestamp, channel number, etc.)
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.parse_dcorr_query_response(response: str) _DCORRResponse [source]
Parse string response of
DCORR?
command into a named tuple of :class:`constants.DCORR.Mode and primary and secondary reference or calibration values.
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.fixed_negative_float(response: str) float [source]
Keysight sometimes responds for ex. ‘-0.-1’ as an output when you input ‘-0.1’. This function can convert such strings also to float.
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.format_dcorr_response(r: _DCORRResponse) str [source]
Format a given response tuple
_DCORRResponse
fromDCORR?
command as a human-readable string.
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.get_name_label_unit_of_impedance_model(mode: MeasurementMode) Tuple[Tuple[str, str], Tuple[str, str], Tuple[str, str]] [source]
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.get_measurement_summary(status_array: ndarray) str [source]
- qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.convert_dummy_val_to_nan(param: _FMTResponse) None [source]
Converts dummy value to NaN. Instrument may output dummy value ( 199.999E+99) if measurement data is over the measurement range. Or the sweep measurement was aborted by the automatic stop function or power compliance. Or if any abort condition is detected. Dummy data 199.999E+99 will be returned for the data after abort.”
- Parameters
param – This must be of type named tuple _FMTResponse.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_module.B1500Module(parent: qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500, name: Optional[str], slot_nr: int, **kwargs: Any)[source]
Bases:
InstrumentChannel
Base class for all modules of B1500 Parameter Analyzer
When subclassing,
set
MODULE_KIND
attribute to the correct module kindModuleKind
that the module is.populate
channels
attribute according to the number of channels that the module has.
- Parameters
parent – Mainframe B1500 instance that this module belongs to
name – Name of the instrument instance to create. If None (Default), then the name is autogenerated from the instrument class.
slot_nr – Slot number of this module (not channel number)
- parse_spot_measurement_response() SpotResponse
Extract measured value and accompanying metadata from the string and return them as a dictionary.
- Parameters
response – Response str to spot measurement query.
- Returns
Dictionary with measured value and associated metadata (e.g. timestamp, channel number, etc.)
- parse_module_query_response() Dict[SlotNr, str]
Extract installed module information from the given string and return the information as a dictionary.
- Parameters
response – Response str to UNT? 0 query.
- Returns
Dictionary from slot numbers to model name strings.
- enable_outputs() None [source]
Enables all outputs of this module by closing the output relays of its channels.
- disable_outputs() None [source]
Disables all outputs of this module by opening the output relays of its channels.
- is_enabled() bool [source]
Check if channels of this module are enabled.
- Returns
True if all channels of this module are enabled. False, otherwise.
- clear_timer_count() None [source]
This command clears the timer count. This command is effective for all measurement modes, regardless of the TSC setting. This command is not effective for the 4 byte binary data output format (FMT3 and FMT4).
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_sampling_measurement module
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_sampling_measurement.SamplingMeasurement(name: str, **kwargs: Any)[source]
Bases:
ParameterWithSetpoints
Performs sampling measurement using semiconductor parameter analyzer B1500A.
- property instrument: Optional[InstrumentBase]
Return the first instrument that this parameter is bound to. E.g if this is bound to a channel it will return the channel and not the instrument that the channel is bound too. Use
root_instrument()
to get the real instrument.
- property root_instrument: Optional[InstrumentBase]
Return the fundamental instrument that this parameter belongs too. E.g if the parameter is bound to a channel this will return the fundamental instrument that that channel belongs to. Use
instrument()
to get the channel.
- get_raw() ndarray [source]
This performs sampling measurements. However since the measurement time can vary from few seconds to hundreds of minutes we first set the visa time out. The visa time-out should be longer than the time it takes to finish the sampling measurement. The reason is that while measurement is running the data keeps on appending in the buffer of SPA. Only when the measurement is finished the data is returned to the VISA handle. Hence during this time the VISA is idle and waiting for the response. If the timeout is lower than the total run time of the measurement, VISA will give error. We set the Visa timeout to be the measurement_time times the _timeout_response_factor. Strictly speaking the timeout should be just longer than the measurement time.
- compliance() List[int] [source]
check for the status other than “N” (normal) and output the number of data values which were not measured under “N” (normal) status.
For the list of all the status values and their meaning refer to
constants.MeasurementStatus
.
- __getitem__(keys: Any) SweepFixedValues
Slice a Parameter to get a SweepValues object to iterate over during a sweep
- property full_name: str
Name of the parameter including the name of the instrument and submodule that the parameter may be bound to. The names are separated by underscores, like this:
instrument_submodule_parameter
.
- get_ramp_values(value: Union[float, Sized], step: Optional[float] = None) Sequence[Union[float, Sized]]
Return values to sweep from current value to target value. This method can be overridden to have a custom sweep behaviour. It can even be overridden by a generator.
- Parameters
value – target value
step – maximum step size
- Returns
List of stepped values, including target value.
- increment(value: Any) None
Increment the parameter with a value
- Parameters
value – Value to be added to the parameter.
- property inter_delay: float
Delay time between consecutive set operations. The actual time will not be shorter than this, but may be longer if the underlying set call takes longer.
Typically used in conjunction with step to create an effective ramp rate, but can also be used without a step to enforce a delay between sets.
- Getter
Returns the current inter_delay.
- Setter
Sets the value of the inter_delay.
- Raises
TypeError – If delay is not int nor float
ValueError – If delay is negative
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the parameter. This is identical to
short_name()
.
- property post_delay: float
Delay time after start of set operation, for each set. The actual time will not be shorter than this, but may be longer if the underlying set call takes longer.
Typically used in conjunction with step to create an effective ramp rate, but can also be used without a step to enforce a delay after every set. One might think of post_delay as how long a set operation is supposed to take. For example, there might be an instrument that needs extra time after setting a parameter although the command for setting the parameter returns quickly.
- Getter
Returns the current post_delay.
- Setter
Sets the value of the post_delay.
- Raises
TypeError – If delay is not int nor float
ValueError – If delay is negative
- property raw_value: Any
Note that this property will be deprecated soon. Use
cache.raw_value
instead.Represents the cached raw value of the parameter.
- Getter
Returns the cached raw value of the parameter.
- restore_at_exit(allow_changes: bool = True) _SetParamContext
Use a context manager to restore the value of a parameter after a
with
block.By default, the parameter value may be changed inside the block, but this can be prevented with
allow_changes=False
. This can be useful, for example, for debugging a complex measurement that unintentionally modifies a parameter.Example
>>> p = Parameter("p", set_cmd=None, get_cmd=None) >>> p.set(2) >>> with p.restore_at_exit(): ... p.set(3) ... print(f"value inside with block: {p.get()}") # prints 3 >>> print(f"value after with block: {p.get()}") # prints 2 >>> with p.restore_at_exit(allow_changes=False): ... p.set(5) # raises an exception
- set_raw(value: Any) None
set_raw
is called to perform the actual setting of a parameter on the instrument. This method should either be overwritten to perform the desired operation or alternatively forParameter
a suitable method is automatically generated ifset_cmd
is supplied to the parameter constructor. The method is automatically wrapped to provide aset
method on the parameter instance.
- set_to(value: Any, allow_changes: bool = False) _SetParamContext
Use a context manager to temporarily set a parameter to a value. By default, the parameter value cannot be changed inside the context. This may be overridden with
allow_changes=True
.Examples
>>> from qcodes.parameters import Parameter >>> p = Parameter("p", set_cmd=None, get_cmd=None) >>> p.set(2) >>> with p.set_to(3): ... print(f"p value in with block {p.get()}") # prints 3 ... p.set(5) # raises an exception >>> print(f"p value outside with block {p.get()}") # prints 2 >>> with p.set_to(3, allow_changes=True): ... p.set(5) # now this works >>> print(f"value after second block: {p.get()}") # still prints 2
- property setpoints: Sequence[qcodes.parameters.parameter_base.ParameterBase]
Sequence of parameters to use as setpoints for this parameter.
- Getter
Returns a list of parameters currently used for setpoints.
- Setter
Sets the parameters to be used as setpoints from a sequence. The combined shape of the parameters supplied must be consistent with the data shape of the data returned from get on the parameter.
- property short_name: str
Short name of the parameter. This is without the name of the instrument or submodule that the parameter may be bound to. For full name refer to
full_name()
.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = True, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the parameter as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).If the parameter has been initiated with
snapshot_value=False
, the snapshot will NOT include thevalue
andraw_value
of the parameter.- Parameters
update – If True, update the state by calling
parameter.get()
unlesssnapshot_get
of the parameter isFalse
. Ifupdate
isNone
, use the current value from thecache
unless the cache is invalid. IfFalse
, never callparameter.get()
.params_to_skip_update – No effect but may be passed from superclass
- Returns
base snapshot
- property step: Optional[float]
Stepsize that this Parameter uses during set operation. Stepsize must be a positive number or None. If step is a positive number, this is the maximum value change allowed in one hardware call, so a single set can result in many calls to the hardware if the starting value is far from the target. All but the final change will attempt to change by +/- step exactly. If step is None stepping will not be used.
- Getter
Returns the current stepsize.
- Setter
Sets the value of the step.
- Raises
TypeError – if step is set to not numeric or None
ValueError – if step is set to negative
TypeError – if step is set to not integer or None for an integer parameter
TypeError – if step is set to not a number on None
- sweep(start: float, stop: float, step: Optional[float] = None, num: Optional[int] = None) SweepFixedValues
Create a collection of parameter values to be iterated over. Requires start and stop and (step or num) The sign of step is not relevant.
- Parameters
start – The starting value of the sequence.
stop – The end value of the sequence.
step – Spacing between values.
num – Number of values to generate.
- Returns
Collection of parameter values to be iterated over.
- Return type
Examples
>>> sweep(0, 10, num=5) [0.0, 2.5, 5.0, 7.5, 10.0] >>> sweep(5, 10, step=1) [5.0, 6.0, 7.0, 8.0, 9.0, 10.0] >>> sweep(15, 10.5, step=1.5) >[15.0, 13.5, 12.0, 10.5]
- property underlying_instrument: Optional[InstrumentBase]
Returns an instance of the underlying hardware instrument that this parameter communicates with, per this parameter’s implementation.
This is useful in the case where a parameter does not belongs to an instrument instance that represents a real hardware instrument but actually uses a real hardware instrument in its implementation (e.g. via calls to one or more parameters of that real hardware instrument). This is also useful when a parameter does belong to an instrument instance but that instance does not represent the real hardware instrument that the parameter interacts with: hence
root_instrument
of the parameter cannot be thehardware_instrument
, howeverunderlying_instrument
can be implemented to return thehardware_instrument
.By default it returns the
root_instrument
of the parameter.
qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1511B module
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1511B.B1511B(parent: qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500, name: Optional[str], slot_nr: int, **kwargs: Any)[source]
Bases:
B1517A
Driver for Keysight B1511B Source/Monitor Unit module for B1500 Semiconductor Parameter Analyzer.
- Parameters
parent – mainframe B1500 instance that this module belongs to
name – Name of the instrument instance to create. If None (Default), then the name is autogenerated from the instrument class.
slot_nr – Slot number of this module (not channel number)
asu_present – Flag to acknowledge ASU presence
- MODULE_KIND: qcodes.instrument_drivers.Keysight.keysightb1500.constants.ModuleKind = 'SMU'
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- clear_timer_count() None
This command clears the timer count. This command is effective for all measurement modes, regardless of the TSC setting. This command is not effective for the 4 byte binary data output format (FMT3 and FMT4).
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- disable_outputs() None
Disables all outputs of this module by opening the output relays of its channels.
- enable_outputs() None
Enables all outputs of this module by closing the output relays of its channels.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- i_measure_range_config(i_measure_range: IMeasRange) None
Configure measuring current
- Parameters
i_measure_range – current measurement range
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- is_enabled() bool
Check if channels of this module are enabled.
- Returns
True if all channels of this module are enabled. False, otherwise.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- measure_config(measure_range: Union[VMeasRange, IMeasRange]) None
Configure measuring voltage/current
- Parameters
measure_range – voltage/current measurement range
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- parse_module_query_response() Dict[SlotNr, str]
Extract installed module information from the given string and return the information as a dictionary.
- Parameters
response – Response str to UNT? 0 query.
- Returns
Dictionary from slot numbers to model name strings.
- parse_spot_measurement_response() SpotResponse
Extract measured value and accompanying metadata from the string and return them as a dictionary.
- Parameters
response – Response str to spot measurement query.
- Returns
Dictionary with measured value and associated metadata (e.g. timestamp, channel number, etc.)
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- set_average_samples_for_high_speed_adc(number: int = 1, mode: Mode = Mode.AUTO) None
This command sets the number of averaging samples of the high-speed ADC (A/D converter). This command is not effective for the high-resolution ADC. Also, this command is not effective for the measurements using pulse.
- Parameters
number – 1 to 1023, or -1 to -100. Initial setting is 1. For positive number input, this value specifies the number of samples depended on the mode value. For negative number input, this parameter specifies the number of power line cycles (PLC) for one point measurement. The Keysight B1500 gets 128 samples in 1 PLC. If number is negative it ignores the mode argument.
mode – Averaging mode. Integer expression. This parameter is meaningless for negative number. constants.AV.Mode.AUTO: Auto mode (default setting). Number of samples = number x initial number. constants.AV.Mode.MANUAL: Manual mode. Number of samples = number
- setup_staircase_sweep(v_start: float, v_end: float, n_steps: int, post_sweep_voltage_val: Union[Post, int] = Post.STOP, av_coef: int = - 1, enable_filter: bool = True, v_src_range: Union[VOutputRange, IOutputRange] = VOutputRange.AUTO, i_comp: float = 1e-05, i_meas_range: Optional[Union[VMeasRange, IMeasRange]] = IMeasRange.FIX_10uA, hold_time: float = 0, delay: float = 0, step_delay: float = 0, measure_delay: float = 0, abort_enabled: Union[Abort, int] = Abort.ENABLED, sweep_mode: Union[SweepMode, int] = SweepMode.LINEAR) None
Setup the staircase sweep measurement using the same set of commands (in the same order) as given in the programming manual - see pages 3-19 and 3-20.
- Parameters
v_start – starting voltage of staircase sweep
v_end – ending voltage of staircase sweep
n_steps – number of measurement points (uniformly distributed between v_start and v_end)
post_sweep_voltage_val – voltage to hold at end of sweep (i.e. start or end val). Sweep chan will also output this voltage if an abort condition is encountered during the sweep
av_coef – coefficient to use for av command to set ADC averaging. Negative value implies NPLC mode with absolute value of av_coeff the NPLC setting to use. Positive value implies auto mode and must be set to >= 4
enable_filter – turn SMU filter on or off
v_src_range – range setting to use for voltage source
i_comp – current compliance level
i_meas_range – current measurement range
hold_time – time (in s) to wait before starting very first measurement in sweep
delay – time (in s) after starting to force a step output and before starting a step measurement
step_delay – time (in s) after starting a step measurement before next step in staircase. If step_delay is < measurement time, B1500 waits until measurement complete and then forces the next step value.
measure_delay – time (in s) after receiving a start step measurement trigger and before starting a step measurement
abort_enabled – Enbale abort
sweep_mode – Linear, log, linear-2-way or log-2-way
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- source_config(output_range: Union[VOutputRange, IOutputRange], compliance: Optional[Union[float, int]] = None, compl_polarity: Optional[CompliancePolarityMode] = None, min_compliance_range: Optional[Union[VMeasRange, IMeasRange]] = None) None
Configure sourcing voltage/current
- Parameters
output_range – voltage/current output range
compliance – voltage/current compliance value
compl_polarity – compliance polarity mode
min_compliance_range – minimum voltage/current compliance output range
- timing_parameters(h_bias: float, interval: float, number: int, h_base: Optional[float] = None) None
This command sets the timing parameters of the sampling measurement mode (
MM.Mode.SAMPLING
,10
).Refer to the programming guide for more information about the
MT
command, especially for notes on sampling operation and about setting interval < 0.002 s.- Parameters
h_bias – Time since the bias value output until the first sampling point. Numeric expression. in seconds. 0 (initial setting) to 655.35 s, resolution 0.01 s. The following values are also available for interval < 0.002 s.
|h_bias|
will be the time since the sampling start until the bias value output. -0.09 to -0.0001 s, resolution 0.0001 s.interval – Interval of the sampling. Numeric expression, 0.0001 to 65.535, in seconds. Initial value is 0.002. Resolution is 0.001 at interval < 0.002. Linear sampling of interval < 0.002 in 0.00001 resolution is available only when the following formula is satisfied.
interval >= 0.0001 + 0.00002 * (number of measurement channels-1)
number – Number of samples. Integer expression. 1 to the following value. Initial value is 1000. For the linear sampling:
100001 / (number of measurement channels)
. For the log sampling:1 + (number of data for 11 decades)
h_base – Hold time of the base value output until the bias value output. Numeric expression. in seconds. 0 (initial setting) to 655.35 s, resolution 0.01 s.
- v_measure_range_config(v_measure_range: VMeasRange) None
Configure measuring voltage
- Parameters
v_measure_range – voltage measurement range
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1517A module
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1517A.SweepSteps(_typename, _fields=None, /, **kwargs)[source]
Bases:
dict
A dictionary holding all the parameters that specifies the staircase sweep (WV).
- sweep_mode: Union[qcodes.instrument_drivers.Keysight.keysightb1500.constants.SweepMode, int]
- sweep_range: Union[qcodes.instrument_drivers.Keysight.keysightb1500.constants.VOutputRange, int]
- clear() None. Remove all items from D.
- copy() a shallow copy of D
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- pop(k[, d]) v, remove specified key and return the corresponding value.
If key is not found, default is returned if given, otherwise KeyError is raised
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F.
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1517A.IVSweeper(parent: B1517A, name: str, **kwargs: Any)[source]
Bases:
InstrumentChannel
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1517A.B1517A(parent: qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500, name: Optional[str], slot_nr: int, **kwargs: Any)[source]
Bases:
B1500Module
Driver for Keysight B1517A Source/Monitor Unit module for B1500 Semiconductor Parameter Analyzer.
- Parameters
parent – mainframe B1500 instance that this module belongs to
name – Name of the instrument instance to create. If None (Default), then the name is autogenerated from the instrument class.
slot_nr – Slot number of this module (not channel number)
- MODULE_KIND: qcodes.instrument_drivers.Keysight.keysightb1500.constants.ModuleKind = 'SMU'
- source_config(output_range: Union[VOutputRange, IOutputRange], compliance: Optional[Union[float, int]] = None, compl_polarity: Optional[CompliancePolarityMode] = None, min_compliance_range: Optional[Union[VMeasRange, IMeasRange]] = None) None [source]
Configure sourcing voltage/current
- Parameters
output_range – voltage/current output range
compliance – voltage/current compliance value
compl_polarity – compliance polarity mode
min_compliance_range – minimum voltage/current compliance output range
- measure_config(measure_range: Union[VMeasRange, IMeasRange]) None [source]
Configure measuring voltage/current
- Parameters
measure_range – voltage/current measurement range
- v_measure_range_config(v_measure_range: VMeasRange) None [source]
Configure measuring voltage
- Parameters
v_measure_range – voltage measurement range
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- clear_timer_count() None
This command clears the timer count. This command is effective for all measurement modes, regardless of the TSC setting. This command is not effective for the 4 byte binary data output format (FMT3 and FMT4).
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- disable_outputs() None
Disables all outputs of this module by opening the output relays of its channels.
- enable_outputs() None
Enables all outputs of this module by closing the output relays of its channels.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- i_measure_range_config(i_measure_range: IMeasRange) None [source]
Configure measuring current
- Parameters
i_measure_range – current measurement range
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- is_enabled() bool
Check if channels of this module are enabled.
- Returns
True if all channels of this module are enabled. False, otherwise.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- parse_module_query_response() Dict[SlotNr, str]
Extract installed module information from the given string and return the information as a dictionary.
- Parameters
response – Response str to UNT? 0 query.
- Returns
Dictionary from slot numbers to model name strings.
- parse_spot_measurement_response() SpotResponse
Extract measured value and accompanying metadata from the string and return them as a dictionary.
- Parameters
response – Response str to spot measurement query.
- Returns
Dictionary with measured value and associated metadata (e.g. timestamp, channel number, etc.)
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- timing_parameters(h_bias: float, interval: float, number: int, h_base: Optional[float] = None) None [source]
This command sets the timing parameters of the sampling measurement mode (
MM.Mode.SAMPLING
,10
).Refer to the programming guide for more information about the
MT
command, especially for notes on sampling operation and about setting interval < 0.002 s.- Parameters
h_bias – Time since the bias value output until the first sampling point. Numeric expression. in seconds. 0 (initial setting) to 655.35 s, resolution 0.01 s. The following values are also available for interval < 0.002 s.
|h_bias|
will be the time since the sampling start until the bias value output. -0.09 to -0.0001 s, resolution 0.0001 s.interval – Interval of the sampling. Numeric expression, 0.0001 to 65.535, in seconds. Initial value is 0.002. Resolution is 0.001 at interval < 0.002. Linear sampling of interval < 0.002 in 0.00001 resolution is available only when the following formula is satisfied.
interval >= 0.0001 + 0.00002 * (number of measurement channels-1)
number – Number of samples. Integer expression. 1 to the following value. Initial value is 1000. For the linear sampling:
100001 / (number of measurement channels)
. For the log sampling:1 + (number of data for 11 decades)
h_base – Hold time of the base value output until the bias value output. Numeric expression. in seconds. 0 (initial setting) to 655.35 s, resolution 0.01 s.
- set_average_samples_for_high_speed_adc(number: int = 1, mode: Mode = Mode.AUTO) None [source]
This command sets the number of averaging samples of the high-speed ADC (A/D converter). This command is not effective for the high-resolution ADC. Also, this command is not effective for the measurements using pulse.
- Parameters
number – 1 to 1023, or -1 to -100. Initial setting is 1. For positive number input, this value specifies the number of samples depended on the mode value. For negative number input, this parameter specifies the number of power line cycles (PLC) for one point measurement. The Keysight B1500 gets 128 samples in 1 PLC. If number is negative it ignores the mode argument.
mode – Averaging mode. Integer expression. This parameter is meaningless for negative number. constants.AV.Mode.AUTO: Auto mode (default setting). Number of samples = number x initial number. constants.AV.Mode.MANUAL: Manual mode. Number of samples = number
- setup_staircase_sweep(v_start: float, v_end: float, n_steps: int, post_sweep_voltage_val: Union[Post, int] = Post.STOP, av_coef: int = - 1, enable_filter: bool = True, v_src_range: Union[VOutputRange, IOutputRange] = VOutputRange.AUTO, i_comp: float = 1e-05, i_meas_range: Optional[Union[VMeasRange, IMeasRange]] = IMeasRange.FIX_10uA, hold_time: float = 0, delay: float = 0, step_delay: float = 0, measure_delay: float = 0, abort_enabled: Union[Abort, int] = Abort.ENABLED, sweep_mode: Union[SweepMode, int] = SweepMode.LINEAR) None [source]
Setup the staircase sweep measurement using the same set of commands (in the same order) as given in the programming manual - see pages 3-19 and 3-20.
- Parameters
v_start – starting voltage of staircase sweep
v_end – ending voltage of staircase sweep
n_steps – number of measurement points (uniformly distributed between v_start and v_end)
post_sweep_voltage_val – voltage to hold at end of sweep (i.e. start or end val). Sweep chan will also output this voltage if an abort condition is encountered during the sweep
av_coef – coefficient to use for av command to set ADC averaging. Negative value implies NPLC mode with absolute value of av_coeff the NPLC setting to use. Positive value implies auto mode and must be set to >= 4
enable_filter – turn SMU filter on or off
v_src_range – range setting to use for voltage source
i_comp – current compliance level
i_meas_range – current measurement range
hold_time – time (in s) to wait before starting very first measurement in sweep
delay – time (in s) after starting to force a step output and before starting a step measurement
step_delay – time (in s) after starting a step measurement before next step in staircase. If step_delay is < measurement time, B1500 waits until measurement complete and then forces the next step value.
measure_delay – time (in s) after receiving a start step measurement trigger and before starting a step measurement
abort_enabled – Enbale abort
sweep_mode – Linear, log, linear-2-way or log-2-way
qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1520A module
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1520A.CVSweeper(parent: B1520A, name: str, **kwargs: Any)[source]
Bases:
InstrumentChannel
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1520A.B1520A(parent: qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500, name: Optional[str], slot_nr: int, **kwargs: Any)[source]
Bases:
B1500Module
Driver for Keysight B1520A Capacitance Measurement Unit module for B1500 Semiconductor Parameter Analyzer.
- Parameters
parent – mainframe B1500 instance that this module belongs to
name – Name of the instrument instance to create. If None (Default), then the name is autogenerated from the instrument class.
slot_nr – Slot number of this module (not channel number)
- phase_compensation_timeout = 60
- MODULE_KIND: qcodes.instrument_drivers.Keysight.keysightb1500.constants.ModuleKind = 'CMU'
- phase_compensation(mode: Optional[Union[Mode, int]] = None) Response [source]
Performs the MFCMU phase compensation, sets the compensation data to the KeysightB1500, and returns the execution results.
This method resets the MFCMU. Before executing this method, set the phase compensation mode to manual by using
phase_compensation_mode
parameter, and open the measurement terminals at the end of the device side. The execution of this method will take about 30 seconds (the visa timeout for it is controlled byphase_compensation_timeout
attribute). The compensation data is cleared by turning the KeysightB1500 off.- Parameters
mode –
Command operation mode
constants.ADJQuery.Mode
.0: Use the last phase compensation data without measurement.
1: Perform the phase compensation data measurement.
If the mode parameter is not set, mode=1 is assumed by the instrument.
- Returns
Status result of performing the phase compensation as
constants.ADJQuery.Response
- abort() None [source]
Aborts currently running operation and the subsequent execution. This does not abort the timeout process. Only when the kernel is free this command is executed and the further commands are aborted.
- setup_staircase_cv(v_start: float, v_end: float, n_steps: int, freq: float, ac_rms: float, post_sweep_voltage_condition: Union[Post, int] = Post.STOP, adc_mode: Union[Mode, int] = Mode.PLC, adc_coef: int = 5, imp_model: Union[MeasurementMode, int] = MeasurementMode.Cp_D, ranging_mode: Union[RangingMode, int] = RangingMode.AUTO, fixed_range_val: Optional[int] = None, hold_delay: float = 0, delay: float = 0, step_delay: float = 0, trigger_delay: float = 0, measure_delay: float = 0, abort_enabled: Union[Abort, int] = Abort.ENABLED, sweep_mode: Union[SweepMode, int] = SweepMode.LINEAR, volt_monitor: bool = True) None [source]
Convenience function which requires all inputs to properly setup a CV sweep measurement. Function sets parameters in the order given in the programming example in the manual. Returns error status after setting all params.
- Parameters
v_start – Starting voltage for sweep
v_end – End voltage for sweep
n_steps – Number of steps in the sweep
freq – frequency
ac_rms – AC voltage
post_sweep_voltage_condition – Source output value after the measurement is normally completed.
adc_mode – Sets the number of averaging samples or the averaging time set to the A/D converter of the MFCMU.
adc_coef – the number of averaging samples or the averaging time.
imp_model – specifies the units of the parameter measured by the MFCMU.
ranging_mode – Auto range or Fixed range
fixed_range_val – Integer 0 or more. Available measurement ranges depend on the output signal frequency. See
measurement_range_for_non_auto
parameter for more info.hold_delay – Hold time (in seconds) that is the wait time after starting measurement and before starting delay time for the first step 0 to 655.35, with 10 ms resolution.
delay – Delay time (in seconds) that is the wait time after starting to force a step output and before starting a step measurement.
step_delay – Step delay time (in seconds) that is the wait time after starting a step measurement and before starting to force the next step output. 0 to 1, with 0.1 ms resolution. If step_delay is shorter than the measurement time, the B1500 waits until the measurement completes, then forces the next step output.
trigger_delay – Step source trigger delay time (in seconds) that is the wait time after completing a step output setup and before sending a step output setup completion trigger. 0 to delay, with 0.1 ms resolution.
measure_delay – Step measurement trigger delay time (in seconds) that is the wait time after receiving a start step measurement trigger and before starting a step measurement. 0 to 65.535, with 0.1 ms resolution.
abort_enabled – Boolean, enables or disables the automatic abort function for the CV sweep measurement.
sweep_mode – Linear sweep, log sweep, linear 2 way sweep or log 2 way sweep
volt_monitor – Accepts Boolean. If True, CV sweep measurement outputs 4 parameter; primary parameter(for ex Capacitance), secondary parameter(for ex Dissipation), ac source voltage and dc source voltage. If False, the measurement only outputs primary and secondary parameter.
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- clear_timer_count() None
This command clears the timer count. This command is effective for all measurement modes, regardless of the TSC setting. This command is not effective for the 4 byte binary data output format (FMT3 and FMT4).
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- disable_outputs() None
Disables all outputs of this module by opening the output relays of its channels.
- enable_outputs() None
Enables all outputs of this module by closing the output relays of its channels.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- is_enabled() bool
Check if channels of this module are enabled.
- Returns
True if all channels of this module are enabled. False, otherwise.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- parse_module_query_response() Dict[SlotNr, str]
Extract installed module information from the given string and return the information as a dictionary.
- Parameters
response – Response str to UNT? 0 query.
- Returns
Dictionary from slot numbers to model name strings.
- parse_spot_measurement_response() SpotResponse
Extract measured value and accompanying metadata from the string and return them as a dictionary.
- Parameters
response – Response str to spot measurement query.
- Returns
Dictionary with measured value and associated metadata (e.g. timestamp, channel number, etc.)
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1520A.CVSweepMeasurement(name: str, instrument: B1520A, **kwargs: Any)[source]
Bases:
MultiParameter
,StatusMixin
CV sweep measurement outputs a list of primary (capacitance) and secondary parameter (disipation).
- Parameters
name – Name of the Parameter.
instrument – Instrument to which this parameter communicates to.
- property instrument: Optional[InstrumentBase]
Return the first instrument that this parameter is bound to. E.g if this is bound to a channel it will return the channel and not the instrument that the channel is bound too. Use
root_instrument()
to get the real instrument.
- property root_instrument: Optional[InstrumentBase]
Return the fundamental instrument that this parameter belongs too. E.g if the parameter is bound to a channel this will return the fundamental instrument that that channel belongs to. Use
instrument()
to get the channel.
- param1
Data, statuses, etc. of the first measured parameter
- param2
Data, statuses, etc. of the second measured parameter
- ac_voltage
Data, statuses, etc. of the AC voltage that the measured parameters were measured for
- dc_voltage
Data, statuses, etc. of the AC voltage that the measured parameters were measured for
- get_raw() Tuple[Tuple[float, ...], Tuple[float, ...]] [source]
get_raw
is called to perform the actual data acquisition from the instrument. This method should either be overwritten to perform the desired operation or alternatively forParameter
a suitable method is automatically generated ifget_cmd
is supplied to the parameter constructor. The method is automatically wrapped to provide aget
method on the parameter instance.
- update_name_label_unit_from_impedance_model(model: Optional[MeasurementMode] = None) None [source]
- property full_name: str
Name of the parameter including the name of the instrument and submodule that the parameter may be bound to. The names are separated by underscores, like this:
instrument_submodule_parameter
.
- property full_names: Tuple[str, ...]
Names of the parameter components including the name of the instrument and submodule that the parameter may be bound to. The name parts are separated by underscores, like this:
instrument_submodule_parameter
- get_ramp_values(value: Union[float, Sized], step: Optional[float] = None) Sequence[Union[float, Sized]]
Return values to sweep from current value to target value. This method can be overridden to have a custom sweep behaviour. It can even be overridden by a generator.
- Parameters
value – target value
step – maximum step size
- Returns
List of stepped values, including target value.
- property inter_delay: float
Delay time between consecutive set operations. The actual time will not be shorter than this, but may be longer if the underlying set call takes longer.
Typically used in conjunction with step to create an effective ramp rate, but can also be used without a step to enforce a delay between sets.
- Getter
Returns the current inter_delay.
- Setter
Sets the value of the inter_delay.
- Raises
TypeError – If delay is not int nor float
ValueError – If delay is negative
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the parameter. This is identical to
short_name()
.
- property post_delay: float
Delay time after start of set operation, for each set. The actual time will not be shorter than this, but may be longer if the underlying set call takes longer.
Typically used in conjunction with step to create an effective ramp rate, but can also be used without a step to enforce a delay after every set. One might think of post_delay as how long a set operation is supposed to take. For example, there might be an instrument that needs extra time after setting a parameter although the command for setting the parameter returns quickly.
- Getter
Returns the current post_delay.
- Setter
Sets the value of the post_delay.
- Raises
TypeError – If delay is not int nor float
ValueError – If delay is negative
- property raw_value: Any
Note that this property will be deprecated soon. Use
cache.raw_value
instead.Represents the cached raw value of the parameter.
- Getter
Returns the cached raw value of the parameter.
- restore_at_exit(allow_changes: bool = True) _SetParamContext
Use a context manager to restore the value of a parameter after a
with
block.By default, the parameter value may be changed inside the block, but this can be prevented with
allow_changes=False
. This can be useful, for example, for debugging a complex measurement that unintentionally modifies a parameter.Example
>>> p = Parameter("p", set_cmd=None, get_cmd=None) >>> p.set(2) >>> with p.restore_at_exit(): ... p.set(3) ... print(f"value inside with block: {p.get()}") # prints 3 >>> print(f"value after with block: {p.get()}") # prints 2 >>> with p.restore_at_exit(allow_changes=False): ... p.set(5) # raises an exception
- set_raw(value: Any) None
set_raw
is called to perform the actual setting of a parameter on the instrument. This method should either be overwritten to perform the desired operation or alternatively forParameter
a suitable method is automatically generated ifset_cmd
is supplied to the parameter constructor. The method is automatically wrapped to provide aset
method on the parameter instance.
- set_to(value: Any, allow_changes: bool = False) _SetParamContext
Use a context manager to temporarily set a parameter to a value. By default, the parameter value cannot be changed inside the context. This may be overridden with
allow_changes=True
.Examples
>>> from qcodes.parameters import Parameter >>> p = Parameter("p", set_cmd=None, get_cmd=None) >>> p.set(2) >>> with p.set_to(3): ... print(f"p value in with block {p.get()}") # prints 3 ... p.set(5) # raises an exception >>> print(f"p value outside with block {p.get()}") # prints 2 >>> with p.set_to(3, allow_changes=True): ... p.set(5) # now this works >>> print(f"value after second block: {p.get()}") # still prints 2
- property setpoint_full_names: Optional[Sequence[Sequence[str]]]
Full names of setpoints including instrument names, if available
- property short_name: str
Short name of the parameter. This is without the name of the instrument or submodule that the parameter may be bound to. For full name refer to
full_name()
.
- property short_names: Tuple[str, ...]
short_names is identical to names i.e. the names of the parameter parts but does not add the instrument name.
It exists for consistency with instruments and other parameters.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = True, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the parameter as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).If the parameter has been initiated with
snapshot_value=False
, the snapshot will NOT include thevalue
andraw_value
of the parameter.- Parameters
update – If True, update the state by calling
parameter.get()
unlesssnapshot_get
of the parameter isFalse
. Ifupdate
isNone
, use the current value from thecache
unless the cache is invalid. IfFalse
, never callparameter.get()
.params_to_skip_update – No effect but may be passed from superclass
- Returns
base snapshot
- property step: Optional[float]
Stepsize that this Parameter uses during set operation. Stepsize must be a positive number or None. If step is a positive number, this is the maximum value change allowed in one hardware call, so a single set can result in many calls to the hardware if the starting value is far from the target. All but the final change will attempt to change by +/- step exactly. If step is None stepping will not be used.
- Getter
Returns the current stepsize.
- Setter
Sets the value of the step.
- Raises
TypeError – if step is set to not numeric or None
ValueError – if step is set to negative
TypeError – if step is set to not integer or None for an integer parameter
TypeError – if step is set to not a number on None
- property underlying_instrument: Optional[InstrumentBase]
Returns an instance of the underlying hardware instrument that this parameter communicates with, per this parameter’s implementation.
This is useful in the case where a parameter does not belongs to an instrument instance that represents a real hardware instrument but actually uses a real hardware instrument in its implementation (e.g. via calls to one or more parameters of that real hardware instrument). This is also useful when a parameter does belong to an instrument instance but that instance does not represent the real hardware instrument that the parameter interacts with: hence
root_instrument
of the parameter cannot be thehardware_instrument
, howeverunderlying_instrument
can be implemented to return thehardware_instrument
.By default it returns the
root_instrument
of the parameter.
- validate(value: Any) None
Validate the value supplied.
- Parameters
value – value to validate
- Raises
TypeError – If the value is of the wrong type.
ValueError – If the value is outside the bounds specified by the validator.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1520A.Correction(parent: B1520A, name: str, **kwargs: Any)[source]
Bases:
InstrumentChannel
A Keysight B1520A CMU submodule for performing open/short/load corrections.
- enable(corr: CalibrationType) None [source]
This command enables the open/short/load correction. Before enabling a correction, perform the corresponding correction data measurement by using the
perform()
.- Parameters
corr – Depending on the the correction you want to perform, set this to OPEN, SHORT or LOAD. For ex: In case of open correction corr = constants.CalibrationType.OPEN.
- disable(corr: CalibrationType) None [source]
This command disables an open/short/load correction.
- Parameters
corr – Correction type as in
constants.CalibrationType
- is_enabled(corr: CalibrationType) Response [source]
Query instrument to see if a correction of the given type is enabled.
- Parameters
corr – Correction type as in
constants.CalibrationType
- set_reference_values(corr: CalibrationType, mode: Mode, primary: float, secondary: float) None [source]
This command disables the open/short/load correction function and defines the calibration value or the reference value of the open/short/load standard. Any previously measured correction data will be invalid after calling this method.
- Parameters
corr – Correction mode from
constants.CalibrationType
. OPEN for Open correction SHORT for Short correction LOAD for Load correction.mode – Measurement mode from
constants.DCORR.Mode
Cp-G (for open correction) Ls-Rs (for short or load correction).primary – Primary reference value of the standard. Cp value for the open standard. in F. Ls value for the short or load standard. in H.
secondary – Secondary reference value of the standard. G value for the open standard. in S. Rs value for the short or load standard. in Ω.
- get_reference_values(corr: CalibrationType) str [source]
This command returns the calibration values or the reference values of the open/short/load standard.
- Parameters
corr – Correction mode from
constants.CalibrationType
. OPEN for Open correction SHORT for Short correction LOAD for Load correction.- Returns
A human-readable string with the correction mode
constants.DCORR.Mode
and its reference values
- perform(corr: CalibrationType) Response [source]
Perform Open/Short/Load corrections using this method. Refer to the example notebook to understand how each of the corrections are performed.
Before executing this method, set the oscillator level of the MFCMU.
If you use the correction standard, execute the
set_reference_values()
method (corresponds to theDCORR
command) before this method because the calibration value or the reference value of the standard must be defined before performing the correction.- Parameters
corr – Depending on the the correction you want to perform, set this to OPEN, SHORT or LOAD. For ex: In case of open correction corr = constants.CalibrationType.OPEN.
- Returns
Status of correction data measurement in the form of
constants.CORR.Response
- perform_and_enable(corr: CalibrationType) str [source]
Perform the correction AND enable it. It is equivalent to calling
perform()
andenable()
methods sequentially.- Returns
A human readable string with status of the operation.
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1520A.FrequencyList(parent: Correction, name: str, chnum: int, **kwargs: Any)[source]
Bases:
InstrumentChannel
A frequency list for open/short/load correction for Keysight B1520A CMU.
- clear_and_set_default() None [source]
Remove all frequencies in the list for data correction AND set the default frequency list.
For the list of default frequencies, refer to the documentation of the
CLCORR
command in the programming manual.
- add(freq: float) None [source]
Append MFCMU output frequency for data correction in the list.
The frequency value can be given with a certain resolution as per Table 4-18 in the programming manual (year 2016).
- query(index: Optional[int] = None) float [source]
Query the frequency list for CMU data correction.
If
index
isNone
, the query returns a total number of frequencies in the list. Ifindex
is given, then the query returns the frequency value from the list at that index.
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.
- add_parameter(name: str, parameter_class: Optional[Type[ParameterBase]] = None, **kwargs: Any) None
Bind one Parameter to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
for every real parameter of the instrument.In this sense, parameters are the state variables of the instrument, anything the user can set and/or get.
- Parameters
name – How the parameter will be stored within
parameters
and also how you address it using the shortcut methods:instrument.set(param_name, value)
etc.parameter_class – You can construct the parameter out of any class. Default
parameters.Parameter
.**kwargs – Constructor arguments for
parameter_class
.
- Raises
KeyError – If this instrument already has a parameter with this name and the parameter being replaced is not an abstract parameter.
ValueError – If there is an existing abstract parameter and the unit of the new parameter is inconsistent with the existing one.
- add_submodule(name: str, submodule: Union[InstrumentModule, ChannelTuple]) None
Bind one submodule to this instrument.
Instrument subclasses can call this repeatedly in their
__init__
method for every submodule of the instrument.Submodules can effectively be considered as instruments within the main instrument, and should at minimum be snapshottable. For example, they can be used to either store logical groupings of parameters, which may or may not be repeated, or channel lists. They should either be an instance of an
InstrumentModule
or aChannelTuple
.- Parameters
name – How the submodule will be stored within
instrument.submodules
and also how it can be addressed.submodule – The submodule to be stored.
- Raises
- property ancestors: List[qcodes.instrument.instrument_base.InstrumentBase]
Returns a list of instruments, starting from the current instrument and following to the parent instrument and the parents parent instrument until the root instrument is reached.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Parameters
func_name – The name of a function of this instrument.
*args – any arguments to the function.
- Returns
The return value of the function.
- delegate_attr_dicts: List[str] = ['parameters', 'functions', 'submodules']
A list of names (strings) of dictionaries which are (or will be) attributes of
self
, whose keys should be treated as attributes ofself
.
- delegate_attr_objects: List[str] = []
A list of names (strings) of objects which are (or will be) attributes of
self
, whose attributes should be passed through toself
.
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Parameters
param_name – The name of a parameter of this instrument.
- Returns
The current value of the parameter.
- invalidate_cache() None
Invalidate the cache of all parameters on the instrument. Calling this method will recursively mark the cache of all parameters on the instrument and any parameter on instrument modules as invalid.
This is useful if you have performed manual operations (e.g. using the frontpanel) which changes the state of the instrument outside QCoDeS.
This in turn means that the next snapshot of the instrument will trigger a (potentially slow) reread of all parameters of the instrument if you pass update=None to snapshot.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Parameters
metadata – Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: qcodes.instrument.instrument_base.InstrumentBase
Returns the parent instrument. By default this is
None
. Any SubInstrument should subclass this to return the parent instrument.
- print_readable_snapshot(update: bool = False, max_chars: int = 80) None
Prints a readable version of the snapshot. The readable snapshot includes the name, value and unit of each parameter. A convenience function to quickly get an overview of the status of an instrument.
- Parameters
update – If
True
, update the state by querying the instrument. IfFalse
, just use the latest values in memory. This argument gets passed to the snapshot function.max_chars – the maximum number of characters per line. The readable snapshot will be cropped if this value is exceeded. Defaults to 80 to be consistent with default terminal width.
- property root_instrument: qcodes.instrument.instrument_base.InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Parameters
param_name – The name of a parameter of this instrument.
value – The new value to set.
- snapshot(update: Optional[bool] = False) Dict[Any, Any]
Decorate a snapshot dictionary with metadata. DO NOT override this method if you want metadata in the snapshot instead, override
snapshot_base()
.- Parameters
update – Passed to snapshot_base.
- Returns
Base snapshot.
- snapshot_base(update: Optional[bool] = False, params_to_skip_update: Optional[Sequence[str]] = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
NumpyJSONEncoder
supports).- Parameters
update – If
True
, update the state by querying the instrument. If None update the state if known to be invalid. IfFalse
, just use the latest values in memory and never update state.params_to_skip_update – List of parameter names that will be skipped in update even if update is True. This is useful if you have parameters that are slow to update but can be updated in a different way (as in the qdac). If you want to skip the update of certain parameters in all snapshots, use the
snapshot_get
attribute of those parameters instead.
- Returns
base snapshot
- Return type
- validate_status(verbose: bool = False) None
Validate the values of all gettable parameters
The validation is done for all parameters that have both a get and set method.
- Parameters
verbose – If
True
, then information about the parameters that are being check is printed.
- parameters: Dict[str, ParameterBase] = {}
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: Dict[str, Function] = {}
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: Dict[str, Union['InstrumentModule', 'ChannelTuple']] = {}
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: Dict[str, 'InstrumentModule'] = {}
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1530A module
- class qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1530A.B1530A(parent: qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500, name: Optional[str], slot_nr: int, **kwargs: Any)[source]
Bases:
B1500Module
Driver for Keysight B1530A Waveform Generator/Fast Measurement Unit module for B1500 Semiconductor Parameter Analyzer.
Warning
At the moment this driver implements no functionality of the module.
- Parameters
parent – mainframe B1500 instance that this module belongs to
name – Name of the instrument instance to create. If None (Default), then the name is autogenerated from the instrument class.
slot_nr – Slot number of this module (not channel number)
- MODULE_KIND: qcodes.instrument_drivers.Keysight.keysightb1500.constants.ModuleKind = 'WGFMU'
- __getitem__(key: str) Union[Callable[[...], Any], Parameter]
Delegate instrument[‘name’] to parameter or function ‘name’.
- add_function(name: str, **kwargs: Any) None
Bind one
Function
to this instrument.Instrument subclasses can call this repeatedly in their
__init__
for every real function of the instrument.This functionality is meant for simple cases, principally things that map to simple commands like
*RST
(reset) or those with just a few arguments. It requires a fixed argument count, and positional args only. If your case is more complicated, you’re probably better off simply making a new method in yourInstrument
subclass definition.- Parameters
name – How the Function will be stored within
instrument.Functions
and also how you address it using the shortcut methods:instrument.call(func_name, *args)
etc.**kwargs – constructor kwargs for
Function
- Raises
KeyError – If this instrument already has a function with this name.