devices.oxford:MercurySingleAxisIPS
Driver for Mercury-IPS.
Usage
devices.oxford:MercurySingleAxisIPS(
interface,
maxfield=5,
maxrate=0.5,
)Query the dictionaries for the values you want to read; the results are written to the dictionaries and can then be read with the given functions.
Dicts for functions: confDictX/Y/Z for magnetic field status (to Setpoint etc.) dataDictX/Y/Z for magnetic field functions confDictLevel for Helium Fast/Slow dataDictLevel for Helium/Nitrogen Levels
Usually all relevant parameters for operation can be found in the workingDict.
Methods
| Name | Description |
|---|---|
| __init__() | Initialize the Mercury single axis IPS device. |
| getDictValue() | Get a value from the working dictionary. |
| getFastRate() | Get the helium level meter mode. |
| getLevels() | Get the liquid nitrogen and helium levels. |
| getMagnetStatus() | Get the status of the magnet. |
| getMagneticFieldRate() | Get the rate of change for the magnetic field. |
| getMagneticFields() | Get the current magnetic field values. |
| getVoltage() | Get the current output voltage. |
| logAllDicts() | Log the contents of all dictionaries for debugging. |
| query() | Query a value from the device. |
| queryAllDicts() | Query all dictionaries to update their values. |
| queryDict() | Query all entries in a dictionary. |
| queryID() | Query the device ID. |
| queryLevelMeter() | Query the level meter configuration. |
| queryLevelMeterStatus() | Query the level meter status. |
| queryMagnetConf() | Query the magnet configuration. |
| queryMagnetStatus() | Query the magnet status. |
| querySysConf() | Query the system configuration. |
| queryWorkingDict() | Query all entries in the working dictionary. |
| setFastRate() | Set the helium level meter to fast or slow mode. |
| setMagnetStatus() | Set the status of the magnet. |
| setMagneticField() | Set the magnetic field on the x axis. |
| setMagneticFieldRate() | Set the rate of change for the magnetic field. |
| setVal() | Set a value on the device. |
__init__()
Initialize the Mercury single axis IPS device.
Usage
__init__(
interface,
maxfield=5,
maxrate=0.5,
)Parameters
interface: str-
VISA resource name
maxfield: float = 5-
Maximum allowed field, by default 5
maxrate: float = 0.5- Maximum allowed rate, by default 0.5
getDictValue()
Get a value from the working dictionary.
Usage
getDictValue(key)Parameters
key: str- Key in the working dictionary
Returns
float or bool- Value from the working dictionary
getFastRate()
Get the helium level meter mode.
Usage
getFastRate()Returns
bool- True if in slow mode, False if in fast mode
getLevels()
Get the liquid nitrogen and helium levels.
Usage
getLevels()Returns
tuple- (LN2 level, LHe level)
getMagnetStatus()
Get the status of the magnet.
Usage
getMagnetStatus(axis=0)Parameters
axis: int = 0- Axis to query (-1=all, 0=x), by default 0
Returns
int or list- Status of the magnet: 0 - HOLD 1 - RTOS (Ramp to setpoint) 2 - RTOZ (Ramp to zero) 3 - CLMP (Clamped, when current is 0)
getMagneticFieldRate()
Get the rate of change for the magnetic field.
Usage
getMagneticFieldRate(
axis=0,
setp=False,
)Parameters
axis: int = 0-
Axis to query (0=x, -1=all), by default 0
setp: bool = False- If True, also return the setpoint, by default False
Returns
float or tuple or list- Current rate value(s), and setpoint(s) if requested
getMagneticFields()
Get the current magnetic field values.
Usage
getMagneticFields(setp=False)Parameters
setp: bool = False- If True, also return the setpoints, by default False
Returns
tuple- Current field value(s), and setpoint(s) if requested
getVoltage()
Get the current output voltage.
Usage
getVoltage()Returns
float- Current output voltage
logAllDicts()
Log the contents of all dictionaries for debugging.
Usage
logAllDicts()query()
Query a value from the device.
Usage
query(
command,
address="",
signal=False,
)Parameters
command: str-
Command to send
address: str = ""-
Device address, by default “”
signal: bool = False- Whether to use the signal variant of the command, by default False
Returns
str- Response from the device
queryAllDicts()
Query all dictionaries to update their values.
Usage
queryAllDicts()queryDict()
Query all entries in a dictionary.
Usage
queryDict(
queryDict,
address="",
signal=False,
)Parameters
queryDict: dict-
Dictionary containing commands as keys
address: str = ""-
Device address, by default “”
signal: bool = False- Whether to use the signal variant of the command, by default False
queryID()
Query the device ID.
Usage
queryID()queryLevelMeter()
Query the level meter configuration.
Usage
queryLevelMeter()queryLevelMeterStatus()
Query the level meter status.
Usage
queryLevelMeterStatus()queryMagnetConf()
Query the magnet configuration.
Usage
queryMagnetConf()queryMagnetStatus()
Query the magnet status.
Usage
queryMagnetStatus()querySysConf()
Query the system configuration.
Usage
querySysConf()queryWorkingDict()
Query all entries in the working dictionary.
Usage
queryWorkingDict()Updates the values in the working dictionary with current device values.
setFastRate()
Set the helium level meter to fast or slow mode.
Usage
setFastRate(slow=True)Parameters
slow: bool = True- True for slow mode, False for fast mode, by default True
setMagnetStatus()
Set the status of the magnet.
Usage
setMagnetStatus(
state,
axis=0,
)Parameters
state: int or list-
Status to set: 0 - HOLD 1 - RTOS (Ramp to setpoint) 2 - RTOZ (Ramp to zero) 3 - CLMP (Clamped, when current is 0) - disallowed
axis: int = 0- Axis to set (-1=take state as list, 0=x), by default 0
Notes
Status 3 (CLMP) is disallowed as it could damage the magnet.
setMagneticField()
Set the magnetic field on the x axis.
Usage
setMagneticField(xval)Parameters
xval: float- Target magnetic field value
Notes
Values exceeding the maximum field limits will be clamped.
setMagneticFieldRate()
Set the rate of change for the magnetic field.
Usage
setMagneticFieldRate(
rate,
axis=0,
)Parameters
rate: float-
Rate of change in T/min, must be between 0 and maxrate
axis: int = 0- Axis to set (0=x), by default 0
Notes
Values outside the allowed range will be clamped.
setVal()
Set a value on the device.
Usage
setVal(
setpoint,
command,
address="",
signal=False,
)Parameters
setpoint: float or str-
Value to set
command: str-
Command to use
address: str = ""-
Device address, by default “”
signal: bool = False- Whether to use the signal variant of the command, by default False
Returns
str- Response from the device