mesoscopy.instrument.smu
functions related to the Source-Measurement Units. Works with Keithley 2600 and 2400 family.
Functions
|
|
|
Classes
|
|
|
|
|
|
|
|
|
- class mesoscopy.instrument.smu.Keithley2600Channel(parent: Instrument, name: str, channel: str)
Bases:
KeithleyChannel
- 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.- Args:
- 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: type = <class 'qcodes.instrument.parameter.Parameter'>, **kwargs: ~typing.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.
- Args:
- name: How the parameter will be stored within
instrument.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
parameter.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: 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
.- Args:
- name: How the submodule will be stored within
instrument.submodules
and also how it can be addressed.
submodule: The submodule to be stored.
- Raises:
- KeyError: If this instrument already contains a submodule with this
name.
- TypeError: If the submodule that we are trying to add is
not an instance of an
Metadatable
object.
- property ancestors: List[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
- ask_raw(cmd: str) str
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Args:
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
.
- doFastSweep(start: float, stop: float, steps: int, mode: str) DataSet
Perform a fast sweep using a deployed lua script and return a QCoDeS DataSet with the sweep.
- Args:
start: starting sweep value (V or A) stop: end sweep value (V or A) steps: number of steps mode: Type of sweep, either ‘IV’ (voltage sweep),
‘VI’ (current sweep two probe setup) or ‘VIfourprobe’ (current sweep four probe setup)
- property full_name: str
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Args:
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.
- Args:
metadata: Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- property name_parts: List[str]
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: 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.
- Args:
- update: If
True
, update the state by querying the instrument. If
False
, 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.
- update: If
- reset() None
Reset instrument to factory defaults. This resets only the relevant channel.
- property root_instrument: InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Args:
param_name: The name of a parameter of this instrument. value: The new value to set.
- property short_name: str
Short name of the instrument
- snapshot(update: bool | None = 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()
.- Args:
update: Passed to snapshot_base.
- Returns:
Base snapshot.
- snapshot_base(update: bool | None = False, params_to_skip_update: Sequence[str] | None = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
qcodes.utils.helpers.NumpyJSONEncoder
supports).- Args:
- update: If
True
, update the state by querying the instrument. If None update the state if known to be invalid. If
False
, 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.
- update: If
- Returns:
dict: base snapshot
- 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.
- Arguments:
- verbose: If
True
, then information about the parameters that are being check is printed.
- verbose: If
- write(cmd: str) None
- write_raw(cmd: str) None
- parameters: Dict[str, _BaseParameter]
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, '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 instrument_modules of this instrument Usually populated via
add_submodule()
.
- class mesoscopy.instrument.smu.Keithley2600(*args: Any, **kwargs: Any)
Bases:
Keithley_2600
- 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.- Args:
- 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: type = <class 'qcodes.instrument.parameter.Parameter'>, **kwargs: ~typing.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.
- Args:
- name: How the parameter will be stored within
instrument.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
parameter.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: 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
.- Args:
- name: How the submodule will be stored within
instrument.submodules
and also how it can be addressed.
submodule: The submodule to be stored.
- Raises:
- KeyError: If this instrument already contains a submodule with this
name.
- TypeError: If the submodule that we are trying to add is
not an instance of an
Metadatable
object.
- property ancestors: List[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
Override of normal ask. This is important, since queries to the instrument must be wrapped in ‘print()’
- ask_raw(cmd: str) str
Low-level interface to
visa_handle.ask
.- Args:
cmd: The command to send to the instrument.
- Returns:
str: The instrument’s response.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Args:
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.- Args:
- 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.
- visa.VisaIOError: if
- close() None
Disconnect and irreversibly tear down the instrument.
- 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: float | None = None) None
Print a standard message on initial connection to an instrument.
- Args:
- idn_param: Name of parameter that returns ID dict.
Default
IDN
.- begin_time:
time.time()
when init started. Default is
self._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
.
- device_clear() None
Clear the buffers of the device
- display_clear() None
This function clears the display, but also leaves it in user mode
- display_normal() None
Set the display to the default mode
- static exist(name: str, instrument_class: type | None = None) bool
Check if an instrument with a given names exists (i.e. is already instantiated).
- Args:
name: Name of the instrument. instrument_class: The type of instrument you are looking for.
- exit_key() None
Get back the normal screen after an error: send an EXIT key press event
- classmethod find_instrument(name: str, instrument_class: Type[T] | None = None) T
Find an existing instrument by name.
- Args:
name: Name of the instrument. instrument_class: The type of instrument you are looking for.
- Returns:
The instrument found.
- Raises:
- KeyError: If no instrument of that name was found, or if its
reference is invalid (dead).
- TypeError: If a specific class was requested but a different
type was found.
- property full_name: str
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Args:
param_name: The name of a parameter of this instrument.
- Returns:
The current value of the parameter.
- get_idn() Dict[str, str | None]
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.
- Args:
instr_instance: Instance of an Instrument class or its subclass.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Args:
metadata: Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- property name_parts: List[str]
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: InstrumentBase | None
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.
- Args:
- update: If
True
, update the state by querying the instrument. If
False
, 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.
- update: If
- 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.
- Args:
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.
- Args:
instance: The instance to remove
- reset() None
Reset instrument to factory defaults. This resets both channels.
- property root_instrument: InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Args:
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.
- Args:
- 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: str | None) None
Change the read terminator to use.
- Args:
- 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.
- property short_name: str
Short name of the instrument
- snapshot(update: bool | None = 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()
.- Args:
update: Passed to snapshot_base.
- Returns:
Base snapshot.
- snapshot_base(update: bool | None = True, params_to_skip_update: Sequence[str] | None = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
qcodes.utils.helpers.NumpyJSONEncoder
supports).- Args:
- 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:
dict: base snapshot
- 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.
- Arguments:
- verbose: If
True
, then information about the parameters that are being check is printed.
- verbose: If
- write(cmd: str) None
Write a command string with NO response to the hardware.
Subclasses that transform
cmd
should override this method, and in it callsuper().write(new_cmd)
. Subclasses that define a new hardware communication should instead overridewrite_raw
.- Args:
cmd: The string to send to the instrument.
- Raises:
- Exception: Wraps any underlying exception with extra context,
including the command and the instrument.
- write_raw(cmd: str) None
Low-level interface to
visa_handle.write
.- Args:
cmd: The command to send to the instrument.
- parameters: Dict[str, _BaseParameter]
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, '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 instrument_modules of this instrument Usually populated via
add_submodule()
.
- class mesoscopy.instrument.smu.Keithley2400Source(parent: Keithley2450, name: str, proper_function: str, **kwargs: Any)
Bases:
Source2450
- 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.- Args:
- 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: type = <class 'qcodes.instrument.parameter.Parameter'>, **kwargs: ~typing.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.
- Args:
- name: How the parameter will be stored within
instrument.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
parameter.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: 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
.- Args:
- name: How the submodule will be stored within
instrument.submodules
and also how it can be addressed.
submodule: The submodule to be stored.
- Raises:
- KeyError: If this instrument already contains a submodule with this
name.
- TypeError: If the submodule that we are trying to add is
not an instance of an
Metadatable
object.
- property ancestors: List[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
- ask_raw(cmd: str) str
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Args:
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
.
- property full_name: str
- function_modes = {'current': {'name': 'CURR', 'range_vals': <Numbers -1<=v<=1>, 'unit': 'A'}, 'voltage': {'name': 'VOLT', 'range_vals': <Numbers -200<=v<=200>, 'unit': 'V'}}
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Args:
param_name: The name of a parameter of this instrument.
- Returns:
The current value of the parameter.
- get_sweep_axis() ndarray
- 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.
- Args:
metadata: Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- property name_parts: List[str]
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: 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.
- Args:
- update: If
True
, update the state by querying the instrument. If
False
, 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.
- update: If
- property root_instrument: InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Args:
param_name: The name of a parameter of this instrument. value: The new value to set.
- property short_name: str
Short name of the instrument
- snapshot(update: bool | None = 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()
.- Args:
update: Passed to snapshot_base.
- Returns:
Base snapshot.
- snapshot_base(update: bool | None = False, params_to_skip_update: Sequence[str] | None = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
qcodes.utils.helpers.NumpyJSONEncoder
supports).- Args:
- update: If
True
, update the state by querying the instrument. If None update the state if known to be invalid. If
False
, 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.
- update: If
- Returns:
dict: base snapshot
- sweep_reset() None
- sweep_setup(start: float, stop: float, step_count: int, delay: float = 0, sweep_count: int = 1, range_mode: str = 'AUTO', fail_abort: str = 'ON', dual: str = 'OFF', buffer_name: str = 'defbuffer1') None
- sweep_start() None
Start a sweep and return when the sweep has finished. Note: This call is blocking
- 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.
- Arguments:
- verbose: If
True
, then information about the parameters that are being check is printed.
- verbose: If
- write(cmd: str) None
- write_raw(cmd: str) None
- parameters: Dict[str, _BaseParameter]
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, '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 instrument_modules of this instrument Usually populated via
add_submodule()
.
- class mesoscopy.instrument.smu.Keithley2400(*args: Any, **kwargs: Any)
Bases:
Keithley2450
- abort() None
This command stops all trigger model commands on the instrument.
- 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.- Args:
- 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: type = <class 'qcodes.instrument.parameter.Parameter'>, **kwargs: ~typing.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.
- Args:
- name: How the parameter will be stored within
instrument.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
parameter.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: 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
.- Args:
- name: How the submodule will be stored within
instrument.submodules
and also how it can be addressed.
submodule: The submodule to be stored.
- Raises:
- KeyError: If this instrument already contains a submodule with this
name.
- TypeError: If the submodule that we are trying to add is
not an instance of an
Metadatable
object.
- property ancestors: List[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
.- Args:
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
.- Args:
cmd: The command to send to the instrument.
- Returns:
str: The instrument’s response.
- buffer(name: str, size: int | None = None, style: str = '') Buffer2450
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Args:
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.- Args:
- 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.
- visa.VisaIOError: if
- clear_event_log() None
This command clears the event log.
- clear_event_register() None
This function clears event registers.
- close() None
Disconnect and irreversibly tear down the instrument.
- 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: float | None = None) None
Print a standard message on initial connection to an instrument.
- Args:
- idn_param: Name of parameter that returns ID dict.
Default
IDN
.- begin_time:
time.time()
when init started. Default is
self._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
.
- device_clear() None
Clear the buffers of the device
- static exist(name: str, instrument_class: type | None = None) bool
Check if an instrument with a given names exists (i.e. is already instantiated).
- Args:
name: Name of the instrument. instrument_class: The type of instrument you are looking for.
- classmethod find_instrument(name: str, instrument_class: Type[T] | None = None) T
Find an existing instrument by name.
- Args:
name: Name of the instrument. instrument_class: The type of instrument you are looking for.
- Returns:
The instrument found.
- Raises:
- KeyError: If no instrument of that name was found, or if its
reference is invalid (dead).
- TypeError: If a specific class was requested but a different
type was found.
- property full_name: str
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Args:
param_name: The name of a parameter of this instrument.
- Returns:
The current value of the parameter.
- get_idn() Dict[str, str | None]
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.
- initiate() None
This command starts the trigger model.
- 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.
- Args:
instr_instance: Instance of an Instrument class or its subclass.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Args:
metadata: Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- property name_parts: List[str]
- npts() int
Get the number of points in the sweep axis
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: InstrumentBase | None
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.
- Args:
- update: If
True
, update the state by querying the instrument. If
False
, 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.
- update: If
- 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.
- Args:
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.
- Args:
instance: The instance to remove
- reset() None
Returns instrument to default settings, cancels all pending commands.
- property root_instrument: InstrumentBase
- property sense: Sense2450
We have different sense modules depending on the sense function, which can be ‘current’, ‘voltage’ or ‘resistance’
Return the correct source module based on the sense function
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Args:
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.
- Args:
- 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_correct_language() None
The correct communication protocol is SCPI, make sure this is set
- set_terminator(terminator: str | None) None
Change the read terminator to use.
- Args:
- 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.
- property short_name: str
Short name of the instrument
- snapshot(update: bool | None = 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()
.- Args:
update: Passed to snapshot_base.
- Returns:
Base snapshot.
- snapshot_base(update: bool | None = True, params_to_skip_update: Sequence[str] | None = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
qcodes.utils.helpers.NumpyJSONEncoder
supports).- Args:
- 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:
dict: base snapshot
- property source: Source2450
We have different source modules depending on the source function, which can be ‘current’ or ‘voltage’
Return the correct source module based on the source function
- 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.
- Arguments:
- verbose: If
True
, then information about the parameters that are being check is printed.
- verbose: If
- wait() None
This command postpones the execution of subsequent commands until all previous overlapped commands are finished.
- write(cmd: str) None
Write a command string with NO response to the hardware.
Subclasses that transform
cmd
should override this method, and in it callsuper().write(new_cmd)
. Subclasses that define a new hardware communication should instead overridewrite_raw
.- Args:
cmd: The string to send to the instrument.
- Raises:
- Exception: Wraps any underlying exception with extra context,
including the command and the instrument.
- write_raw(cmd: str) None
Low-level interface to
visa_handle.write
.- Args:
cmd: The command to send to the instrument.
- parameters: Dict[str, _BaseParameter]
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, '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 instrument_modules of this instrument Usually populated via
add_submodule()
.
- class mesoscopy.instrument.smu.SRS_SIM928(*args: Any, **kwargs: Any)
Bases:
SIM928
- 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.- Args:
- 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: type = <class 'qcodes.instrument.parameter.Parameter'>, **kwargs: ~typing.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.
- Args:
- name: How the parameter will be stored within
instrument.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
parameter.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: 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
.- Args:
- name: How the submodule will be stored within
instrument.submodules
and also how it can be addressed.
submodule: The submodule to be stored.
- Raises:
- KeyError: If this instrument already contains a submodule with this
name.
- TypeError: If the submodule that we are trying to add is
not an instance of an
Metadatable
object.
- property ancestors: List[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
.- Args:
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_module(i, cmd)
Write a command string to a module and return a response.
- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module to ask from.
cmd (str): The VISA query string.
- i (int, str): Slot number or module name (as in
- Returns:
The response string from the module.
- ask_raw(cmd: str) str
Low-level interface to
visa_handle.ask
.- Args:
cmd: The command to send to the instrument.
- Returns:
str: The instrument’s response.
- static byte_to_bits(x)
Convert an integer to a list of bits
- Args:
x (int): The number to convert.
- Returns:
list[bool]: A list of the lowest 8 bits of
x
whereTrue
represents 1 andFalse
0.
- call(func_name: str, *args: Any) Any
Shortcut for calling a function from its name.
- Args:
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.- Args:
- 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.
- visa.VisaIOError: if
- check_module_errors(i, raiseexc=True)
Check if any errors have occurred on module
i
and clear the status registers.- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module to check the error of.
- raiseexc (bool): If true, raises an exception if any errors have
occurred. Default
True
.
- i (int, str): Slot number or module name (as in
- Returns:
list[str]: A list of strings with the error messages that have occurred.
- close() None
Disconnect and irreversibly tear down the instrument.
- 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: float | None = None) None
Print a standard message on initial connection to an instrument.
- Args:
- idn_param: Name of parameter that returns ID dict.
Default
IDN
.- begin_time:
time.time()
when init started. Default is
self._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
.
- device_clear() None
Clear the buffers of the device
- static exist(name: str, instrument_class: type | None = None) bool
Check if an instrument with a given names exists (i.e. is already instantiated).
- Args:
name: Name of the instrument. instrument_class: The type of instrument you are looking for.
- classmethod find_instrument(name: str, instrument_class: Type[T] | None = None) T
Find an existing instrument by name.
- Args:
name: Name of the instrument. instrument_class: The type of instrument you are looking for.
- Returns:
The instrument found.
- Raises:
- KeyError: If no instrument of that name was found, or if its
reference is invalid (dead).
- TypeError: If a specific class was requested but a different
type was found.
- find_modules()
Query the SIM900 mainframe for which slots have a SIM928 module present.
- Returns:
- A list of slot numbers where a SIM928 module is present (starting
from 1)
- property full_name: str
- get(param_name: str) Any
Shortcut for getting a parameter from its name.
- Args:
param_name: The name of a parameter of this instrument.
- Returns:
The current value of the parameter.
- get_idn() Dict[str, str | None]
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.
- get_module_idn(i)
Get the vendor, model, serial number and firmware version of a module.
- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module whose id is returned.
- i (int, str): Slot number or module name (as in
- Returns:
A dict containing vendor, model, serial, and firmware.
- get_module_status(i)
Gets and clears the status bytes corresponding to the registers ESR, CESR and OVSR of module
i
.- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module to get the status of.
- i (int, str): Slot number or module name (as in
- Returns:
int, int, int: The bytes corresponding to standard event, communication error and overload statuses of module
i
- get_voltage(i)
Get the output voltage of a module.
- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module to get the voltage of.
- i (int, str): Slot number or module name (as in
- Returns:
The current voltage of module
i
as afloat
.
- 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.
- Args:
instr_instance: Instance of an Instrument class or its subclass.
- load_metadata(metadata: Mapping[str, Any]) None
Load metadata into this classes metadata dictionary.
- Args:
metadata: Metadata to load.
- property name: str
Name of the instrument This is equivalent to full_name for backwards compatibility.
- property name_parts: List[str]
- omit_delegate_attrs: List[str] = []
A list of attribute names (strings) to not delegate to any other dictionary or object.
- property parent: InstrumentBase | None
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.
- Args:
- update: If
True
, update the state by querying the instrument. If
False
, 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.
- update: If
- 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.
- Args:
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.
- Args:
instance: The instance to remove
- reset_module(i)
Sends the SIM Reset signal to module i.
Causes a break signal (MARK level) to be asserted for 100 milliseconds to module i. Upon receiving the break signal the modul will flush its internal input buffer, reset its command parser, and default to 9600 baud communications.
- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module to reset.
- i (int, str): Slot number or module name (as in
- property root_instrument: InstrumentBase
- set(param_name: str, value: Any) None
Shortcut for setting a parameter from its name and new value.
- Args:
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.
- Args:
- 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_smooth(voltagedict, equitime=False)
Set the voltages as specified in
voltagedict` smoothly, by changing the output on each module at a rate ``volt_#_step/smooth_timestep
.- Args:
- voltagedict (Dict[float]): A dictionary where keys are module slot
numbers or names and values are the desired output voltages.
- equitime (bool): If
True
, uses smaller step sizes for some of the modules so that all modules reach the desired value at the same time.
- set_terminator(terminator: str | None) None
Change the read terminator to use.
- Args:
- 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.
- set_voltage(i, voltage)
Set the output voltage of a module.
- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module to set the voltage of.
voltage (float): The value to set the voltage to.
- i (int, str): Slot number or module name (as in
- property short_name: str
Short name of the instrument
- snapshot(update: bool | None = 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()
.- Args:
update: Passed to snapshot_base.
- Returns:
Base snapshot.
- snapshot_base(update: bool | None = True, params_to_skip_update: Sequence[str] | None = None) Dict[Any, Any]
State of the instrument as a JSON-compatible dict (everything that the custom JSON encoder class
qcodes.utils.helpers.NumpyJSONEncoder
supports).- Args:
- 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:
dict: base snapshot
- 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.
- Arguments:
- verbose: If
True
, then information about the parameters that are being check is printed.
- verbose: If
- write(cmd: str) None
Write a command string with NO response to the hardware.
Subclasses that transform
cmd
should override this method, and in it callsuper().write(new_cmd)
. Subclasses that define a new hardware communication should instead overridewrite_raw
.- Args:
cmd: The string to send to the instrument.
- Raises:
- Exception: Wraps any underlying exception with extra context,
including the command and the instrument.
- write_module(i, cmd)
Write a command string to a module with NO response expected.
- Args:
- i (int, str): Slot number or module name (as in
slot_names
) of the module to write to.
cmd (str): The VISA command string.
- i (int, str): Slot number or module name (as in
- write_raw(cmd: str) None
Low-level interface to
visa_handle.write
.- Args:
cmd: The command to send to the instrument.
- parameters: Dict[str, _BaseParameter]
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, '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 instrument_modules of this instrument Usually populated via
add_submodule()
.
- mesoscopy.instrument.smu.init_smu(station: Station, mode: Sequence[str] | None = ['voltage', 'voltage'], limits_v: Sequence[float] | None = [20, 70], max_rate: Sequence[float] | None = [0.05, 0.1], limits_i: Sequence[float] | None = [1e-08, 5e-08])
- mesoscopy.instrument.smu.init_sim928(station: Station, max_rate: float | None = 0.15)