stoner_measurement.instruments.oxford.ips120.OxfordIPS120¶
- class stoner_measurement.instruments.oxford.ips120.OxfordIPS120(transport: BaseTransport, protocol: BaseProtocol | None = None)[source]¶
Bases:
MagnetController,MagnetSupplyDriver 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()
- 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)
- 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)
- property heater: bool¶
Return persistent switch heater state.
- Returns:
Truewhen the heater is enabled.- Return type:
(bool)
- 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:
- property magnet_constant: float¶
Return the magnet constant in tesla per amp.
- Returns:
Magnet constant in tesla per amp.
- Return type:
(float)
- property ramp_rate_current: float | None¶
Return the programmed current ramp rate in amps 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.
- 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: