Cryomagnetics Drivers¶
Exceptions:
Classes:
|
Driver for the Cryomagnetics Model 4G superconducting magnet power supply. |
|
- exception qcodes.instrument_drivers.cryomagnetics.Cryomagnetics4GException[source]¶
Bases:
Exception
- class qcodes.instrument_drivers.cryomagnetics.CryomagneticsModel4G(name: str, address: str, max_current_limits: dict[int, tuple[float, float]], coil_constant: float, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
VisaInstrument
Driver for the Cryomagnetics Model 4G superconducting magnet power supply.
This driver provides an interface to control and communicate with the Cryomagnetics Model 4G superconducting magnet power supply using the VISA protocol. It allows setting and reading the magnetic field, ramp rate, and various other parameters of the instrument.
- Parameters:
name – The name of the instrument instance.
address – The VISA resource name of the instrument.
max_current_limits – A dictionary specifying the maximum current limits and rates for each range. The keys are the range indices, and the values are tuples containing the upper current limit and maximum rate for that range.
coil_constant – The coil constant of the magnet in Tesla per Amp.
**kwargs – Forwarded to base class.
Attributes:
The default terminator to use if the terminator is not specified when creating the instrument.
Field Units
Parameter ramping_state_check_interval
Magnetic Field in Tesla
Rate for magnetic field T/min
Magnet sense voltage
Magnet output voltage
Magnet output field/current
Methods:
Resets the device's quenched state.
operating_mode
([remote])Sets the device's operating mode to either remote or local.
Sets the device current to zero.
reset
()Resets the device to its default settings.
Retrieves the current operating state of the magnet.
set_field
(field_setpoint[, block])Sets the magnetic field strength in Tesla using ULIM, LLIM, and SWEEP commands.
wait_while_ramping
(value[, threshold])Waits while the magnet is ramping, checking the status byte instead of field value.
write_raw
(cmd)Low-level interface to
visa_handle.write
.ask_raw
(cmd)Low-level interface to
visa_handle.ask
.- default_terminator: str | None = '\n'¶
The default terminator to use if the terminator is not specified when creating the instrument. None means use the default terminator from PyVisa.
- units: Parameter = self.add_parameter( name="units", set_cmd="UNITS {}", get_cmd="UNITS?", get_parser=str, vals=Enum("A", "kG", "T"), docstring="Field Units", )¶
Field Units
- ramping_state_check_interval: Parameter = self.add_parameter( "ramping_state_check_interval", initial_value=0.05, unit="s", vals=Numbers(0, 10), set_cmd=None, )¶
Parameter ramping_state_check_interval
- field: Parameter = self.add_parameter( name="field", unit="T", set_cmd=self.set_field, get_cmd=self._get_field, get_parser=float, vals=Numbers(-9.001, 9.001), docstring="Magnetic Field in Tesla", )¶
Magnetic Field in Tesla
- rate: Parameter = self.add_parameter( name="rate", unit="T/min", get_cmd=self._get_rate, set_cmd=self._set_rate, get_parser=float, docstring="Rate for magnetic field T/min", )¶
Rate for magnetic field T/min
- Vmag: Parameter = self.add_parameter( name="Vmag", unit="V", get_cmd="VMAG?", get_parser=float, vals=Numbers(-10, 10), docstring="Magnet sense voltage", )¶
Magnet sense voltage
- Vout: Parameter = self.add_parameter( name="Vout", unit="V", get_cmd="VOUT?", get_parser=float, vals=Numbers(-12.8, 12.8), docstring="Magnet output voltage", )¶
Magnet output voltage
- Iout: Parameter = self.add_parameter( name="Iout", unit="A", get_cmd="IOUT?", get_parser=float, docstring="Magnet output field/current", )¶
Magnet output field/current
- operating_mode(remote: bool = True) None [source]¶
Sets the device’s operating mode to either remote or local.
- Parameters:
remote – If True, sets to remote mode, otherwise sets to local mode.
- magnet_operating_state() CryomagneticsOperatingState [source]¶
Retrieves the current operating state of the magnet.
- Returns:
An object representing the current operating state of the magnet.
- Return type:
- Raises:
Cryomagnetics4GException – If the magnet is in a state that prevents ramping, such as quench condition, power module failure, or already ramping.
The operating state is determined by querying the status byte (*STB?) of the instrument. The status byte is interpreted as follows: - Bit 0: Holding (not ramping) - Bit 1: Ramping - Bit 2: Standby - Bit 4: Quench condition present - Bit 8: Power module failure
If the magnet is in a state that prevents ramping (quench condition, power module failure, or already ramping), an exception is raised with an appropriate error message. The error message is also logged using the instrument’s logger.
If the magnet is in a valid state for ramping, a CryomagneticsOperatingState object is returned, representing the current operating state of the magnet.
- set_field(field_setpoint: float, block: bool = True) None [source]¶
Sets the magnetic field strength in Tesla using ULIM, LLIM, and SWEEP commands.
- Parameters:
field_setpoint – The desired magnetic field strength in Tesla.
block – If True, the method will block until the field reaches the setpoint.
- Raises:
Cryo4GException – If the power supply is not in a state where it can start ramping.
- wait_while_ramping(value: float, threshold: float = 1e-05) CryomagneticsOperatingState [source]¶
Waits while the magnet is ramping, checking the status byte instead of field value.
- visa_handle: pyvisa.resources.MessageBasedResource = visa_handle¶
The VISA resource used by this 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, 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()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶