stoner_measurement.instruments.oxford.ips120.OxfordIPS120

class stoner_measurement.instruments.oxford.ips120.OxfordIPS120(transport: BaseTransport, protocol: BaseProtocol | None = None)[source]

Bases: MagnetController, MagnetSupply

Driver for an Oxford Instruments IPS120 magnet power supply.

Variables:
  • transport (BaseTransport) – Transport used for instrument I/O.

  • protocol (BaseProtocol) – Protocol used to format and parse instrument messages.

Examples

>>> from stoner_measurement.instruments.oxford import OxfordIPS120
>>> from stoner_measurement.instruments.transport import NullTransport
>>> t = NullTransport(
...     responses=[b"VIPS120-10 3.07\r", b"C\r", b"VIPS120-10 3.07\r", b"C\r"],
... )
>>> mps = OxfordIPS120(transport=t)
>>> mps.connect()
>>> mps.identify()
'IPS120-10 3.07'
>>> mps.disconnect()
abort_ramp() → None[source]

Abort ramping immediately by clamping the output.

connect() → None[source]

Open the connection, verify identity, and select a safe remote mode.

The IPS120 supports remote-locked operation, which should be avoided. After connecting, this driver explicitly selects the non-locked remote/local mode so the front panel remains usable.

property current: float

Return demand current in amps.

Returns:

Demand current reported by IPS120 register R0. This is used instead of the less reliable R2 measured-current readback.

Return type:

(float)

disconnect() → None[source]

Return the IPS120 to local/manual control before disconnecting.

property field: float

Return output field in tesla.

Returns:

Measured magnetic field in tesla.

Return type:

(float)

get_firmware_version() → str[source]

Return the firmware version from the identity string.

Returns:

Firmware token when available, otherwise an empty string.

Return type:

(str)

get_model() → str[source]

Return the model name from the identity string.

Returns:

Instrument model token when available, otherwise an empty string.

Return type:

(str)

go_to_zero() → None[source]

Ramp the supply output to zero.

property heater: bool

Return persistent switch heater state.

Returns:

True when the heater is enabled.

Return type:

(bool)

heater_off() → None[source]

Disable the persistent switch heater.

heater_on() → None[source]

Enable the persistent switch heater.

hold() → None[source]

Hold the present output without changing field.

identify() → str[source]

Return the instrument identity string.

Returns:

Identity payload from the instrument with the leading Oxford command-echo prefix removed by the protocol parser.

Return type:

(str)

property limits: MagnetLimits

Read the controller safe-current limits and return operating limits.

Returns:

Maximum absolute safe-current limit read from IPS120 registers R21/R22, the corresponding field limit, and the cached software ramp-rate limit.

Return type:

(MagnetLimits)

property magnet_constant: float

Return the magnet constant in tesla per amp.

Returns:

Magnet constant in tesla per amp.

Return type:

(float)

pause_ramp() → None[source]

Pause an active ramp.

property ramp_rate_current: float | None

Return the programmed current ramp rate in amps per minute.

property ramp_rate_field: float | None

Return the programmed field ramp rate in tesla per minute.

ramp_to_current(current: float, *, wait: bool = False) → None[source]

Program current target and ramp.

Parameters:

current (float) – Target current in amps.

Keyword Parameters:

wait (bool) – When True, block until ramp completes.

ramp_to_field(field: float, *, wait: bool = False) → None[source]

Program field target and ramp.

Parameters:

field (float) – Target field in tesla.

Keyword Parameters:

wait (bool) – When True, block until ramp completes.

ramp_to_target() → None[source]

Start ramping to the current programmed target.

return_to_local() → None[source]

Return the IPS120 to front-panel local mode.

set_limits(limits: MagnetLimits) → None[source]

Set software limits used by higher-level sequence logic.

Parameters:

limits (MagnetLimits) – Limit configuration to cache for runtime checks.

set_magnet_constant(tesla_per_amp: float) → None[source]

Set the software magnet constant used for conversion.

Parameters:

tesla_per_amp (float) – Magnet constant in tesla per amp.

set_ramp_rate_current(rate: float) → None[source]

Set the current ramp rate in amps per minute.

Parameters:

rate (float) – Ramp rate in amps per minute.

set_ramp_rate_field(rate: float) → None[source]

Set the field ramp rate in tesla per minute.

Parameters:

rate (float) – Ramp rate in tesla per minute.

set_target_current(current: float) → None[source]

Set the target current in amps.

Parameters:

current (float) – Target current in amps.

set_target_field(field: float) → None[source]

Set the target field in tesla.

Parameters:

field (float) – Target magnetic field in tesla.

property status: MagnetStatus

Return consolidated magnet status.

Returns:

Snapshot of controller state and key readings.

Return type:

(MagnetStatus)

property target_current: float | None

Return the demand current in amps.

property target_field: float | None

Return the programmed field target in tesla.

property voltage: float

Return output voltage in volts.

Returns:

Measured output voltage in volts.

Return type:

(float)