stoner_measurement.instruments.thorlabs.hdr50.ThorlabsHDR50¶
- class stoner_measurement.instruments.thorlabs.hdr50.ThorlabsHDR50(serial_number: str, *, motor_factory: Callable[[str], Any] | None = None)[source]¶
Bases:
MotorControllerControl an HDR50/BSC201 through direct Thorlabs APT.dll calls.
- disconnect() None[source]¶
Close the transport connection to the instrument.
Examples
>>> from stoner_measurement.instruments.transport import NullTransport >>> from stoner_measurement.instruments.protocol import ScpiProtocol >>> from stoner_measurement.instruments.base_instrument import BaseInstrument >>> instr = BaseInstrument(NullTransport(), ScpiProtocol()) >>> instr.connect() >>> instr.disconnect() >>> instr.is_connected False
- classmethod discover_controllers() list[AptControllerInfo][source]¶
Return attached controllers visible through APT.dll.
- has_reached_target_position(tolerance: float = 0.01) bool[source]¶
Return
Truewhen current and target positions are within tolerance.
- identify() str[source]¶
Return the instrument identification string (
*IDN?).Sends the standard IEEE 488.2
*IDN?query and returns the response. Instruments that do not support*IDN?should override this method.- Returns:
Identification string returned by the instrument.
- Return type:
(str)
- Raises:
ConnectionError – If the transport is not open.
Examples
>>> from stoner_measurement.instruments.transport import NullTransport >>> from stoner_measurement.instruments.protocol import ScpiProtocol >>> from stoner_measurement.instruments.base_instrument import BaseInstrument >>> t = NullTransport(responses=[b"ACME,Model1,SN001,v1.0\n"]) >>> instr = BaseInstrument(t, ScpiProtocol()) >>> instr.connect() >>> instr.identify() 'ACME,Model1,SN001,v1.0' >>> instr.disconnect()
- property is_connected: bool¶
Trueif the underlying transport is currently open.- Returns:
Connection state of the transport.
- Return type:
(bool)
Examples
>>> from stoner_measurement.instruments.transport import NullTransport >>> from stoner_measurement.instruments.protocol import ScpiProtocol >>> from stoner_measurement.instruments.base_instrument import BaseInstrument >>> instr = BaseInstrument(NullTransport(), ScpiProtocol()) >>> instr.is_connected False
- move_home(direction: MotorMoveDirection = MotorMoveDirection.CLOCKWISE) None[source]¶
Move to the configured home position.
- move_relative(angle: float, direction: MotorMoveDirection = MotorMoveDirection.CLOCKWISE) None[source]¶
Move by angle degrees in direction using the absolute move API.
- move_to_angle(angle: float, direction: MotorMoveDirection = MotorMoveDirection.CLOCKWISE) None[source]¶
Move to an absolute angle in degrees.
- preferred_connection_transport = 'Kinesis USB'¶
- set_acceleration(acceleration: float) None[source]¶
Set travel acceleration in degrees per second squared.
- property status: MotorStatus¶
Return a consolidated motor status snapshot.