Cryomagnetics Drivers

Exceptions:

Classes:

CryomagneticsModel4G(name, address, ...)

Driver for the Cryomagnetics Model 4G superconducting magnet power supply.

CryomagneticsOperatingState([ramping, ...])

exception qcodes.instrument_drivers.cryomagnetics.Cryomagnetics4GException[source]

Bases: Exception

exception qcodes.instrument_drivers.cryomagnetics.Cryomagnetics4GWarning[source]

Bases: Warning

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:

KG_TO_TESLA

default_terminator

The default terminator to use if the terminator is not specified when creating the instrument.

units

Field Units

ramping_state_check_interval

Parameter ramping_state_check_interval

field

Magnetic Field in Tesla

rate

Rate for magnetic field T/min

Vmag

Magnet sense voltage

Vout

Magnet output voltage

Iout

Magnet output field/current

Methods:

quenched_state_reset()

Resets the device's quenched state.

operating_mode([remote])

Sets the device's operating mode to either remote or local.

zero_current()

Sets the device current to zero.

reset()

Resets the device to its default settings.

magnet_operating_state()

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.

KG_TO_TESLA: float = 0.1
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

quenched_state_reset() None[source]

Resets the device’s quenched state.

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.

zero_current() None[source]

Sets the device current to zero.

reset() None[source]

Resets the device to its default settings.

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:

CryomagneticsOperatingState

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.

visabackend: str = visabackend
visa_handle: pyvisa.resources.MessageBasedResource = visa_handle

The VISA resource used by this instrument.

visalib: str | None = visalib
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 via add_submodule().

log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)
metadata: dict[str, Any] = {}
write_raw(cmd: str) None[source]

Low-level interface to visa_handle.write.

Parameters:

cmd – The command to send to the instrument.

ask_raw(cmd: str) str[source]

Low-level interface to visa_handle.ask.

Parameters:

cmd – The command to send to the instrument.

Returns:

The instrument’s response.

Return type:

str

class qcodes.instrument_drivers.cryomagnetics.CryomagneticsOperatingState(ramping: 'bool' = False, holding: 'bool' = False, standby: 'bool' = False, quench_condition_present: 'bool' = False, power_module_failure: 'bool' = False)[source]

Bases: object

Attributes:

Methods:

ramping: bool = False
holding: bool = False
standby: bool = False
quench_condition_present: bool = False
power_module_failure: bool = False
can_start_ramping() bool[source]