qcodes_contrib_drivers.drivers.Thorlabs.private package

Submodules

qcodes_contrib_drivers.drivers.Thorlabs.private.APT module

exception qcodes_contrib_drivers.drivers.Thorlabs.private.APT.ThorlabsException[source]

Bases: Exception

class qcodes_contrib_drivers.drivers.Thorlabs.private.APT.ThorlabsHWType(value)[source]

Bases: Enum

An enumeration.

BBD10x = 44
BDC101 = 14
BSC001 = 11
BSC002 = 13
BSC101 = 12
DCC001 = 22
K10CR1 = 50
KDC101 = 63
L490MZ = 43
LTSxxx = 42
MFF10x = 48
MST601 = 26
ODC001 = 24
OST001 = 25
PRM1Z8 = 31
SCC001 = 21
TDC001 = 31
TST001 = 29
class qcodes_contrib_drivers.drivers.Thorlabs.private.APT.Thorlabs_APT(dll_path: str | None = None, verbose: bool = False, event_dialog: bool = False)[source]

Bases: object

Wrapper class for the APT.dll Thorlabs APT Server library. The class has been tested for a Thorlabs MFF10x mirror flipper, a Thorlabs PRM1Z8 Polarizer Wheel and a Thorlabs K10CR1 rotator.

Parameters:
  • dll_path – Path to the APT.dll file. If not set, a default path is used.

  • verbose – Flag for the verbose behaviour. If true, successful events are printed.

  • event_dialog – Flag for the event dialog. If true, event dialog pops up for information.

verbose

Flag for the verbose behaviour.

dll

WinDLL object for APT.dll.

apt_clean_up() None[source]

Cleans up the resources of APT.dll

apt_init() None[source]

Initialization of APT.dll

disable_hw_channel(serial_number: int) None[source]

Disables the hardware channel (often the motor)

Parameters:

serial_number – The device’s serial number for which this function is called.

enable_event_dlg(enable: bool) None[source]

Activates/deactivates the event dialog, which appears when an error occurs.

Parameters:

enable – True, to enable the event dialog. False, to disable it.

enable_hw_channel(serial_number: int) None[source]

Enables the hardware channel (often the motor)

Parameters:

serial_number – The device’s serial number for which this function is called.

error_check(code: int, function_name: str = '') None[source]

Analyzes a functions return code to check, if the function call to APT.dll was successful. If an error occurred, this function throws an ThorlabsException.

Parameters:
  • code – The called function’s return code

  • function_name – Name of the called function

Throws:

ThorlabsException: Thrown, if the return code indicates that an error has occurred.

get_hw_info(serial_number: int) Tuple[str, str, str][source]

Returns the device’s information.

Parameters:

serial_number – The device’s serial number for which this function is called.

Returns:

device model name, firmware version, hardware notes.

get_hw_serial_num_ex(hw_type: int | ThorlabsHWType, index: int) int[source]

Returns the a device’s serial number by passing the model’s hardware type and the device id.

Parameters:
  • hw_type – Hardware type (model code) to search for.

  • index – Device id

Returns:

The device’s serial number

init_hw_device(serial_number: int) None[source]

Initializes the device

Parameters:

serial_number – The device’s serial number for which this function is called.

list_available_devices(hw_type: int | ThorlabsHWType | None = None) List[Tuple[int, int, int]][source]

Lists all available Thorlabs devices, that can connect to the APT server.

Parameters:

hw_type – If this parameter is passed, the function only searches for a certain device model. Otherwise (if the parameter is None), it searches for all Thorlabs devices.

Returns:

A list of tuples. Each list-element is a tuple of 3 ints, containing the device’s hardware type, device id and serial number: [(hw type id, device id, serial), …]

mot_get_home_parameters(serial_number: int) Tuple[int, int, float, float][source]

Returns the motor’s parameters for moving home

Parameters:

serial_number – The device’s serial number for which this function is called.

Returns:

direction, home limit switch, velocity (deg/s), zero offset (deg)

mot_get_position(serial_number: int) float[source]

Returns the current motor position

Parameters:

serial_number – The device’s serial number for which this function is called.

Returns:

Motor position in degrees (0 to 360)

mot_get_status_bits(serial_number: int) int[source]

Returns the motor’s status bits

Parameters:

serial_number – The device’s serial number for which this function is called.

Returns:

Status bits of the motor

mot_get_velocity_parameters(serial_number: int) Tuple[float, float, float][source]

Returns the motor’s velocity parameters

Parameters:

serial_number – The device’s serial number for which this function is called.

Returns:

minimum velocity (deg/s), acceleration (deg/s/s), maximum velocity (deg/s)

mot_move_absolute_ex(serial_number: int, absolute_position: float, wait: bool) None[source]

Moves the motor to an absolute position

Parameters:
  • serial_number – The device’s serial number for which this function is called.

  • position – The position to move the motor to in degrees (0 to 360)

  • wait – True, to block until the motor reaches the target position. False, to do this asynchronously.

mot_move_home(serial_number: int, wait: bool) None[source]

Moves the motor to zero and recalibrates it

Parameters:
  • serial_number – The device’s serial number for which this function is called.

  • wait – True, to block until the motor reaches the target position. False, to do this asynchronously.

mot_move_jog(serial_number: int, direction: int, wait: bool) None[source]

Returns the motor’s status bits

Parameters:
  • serial_number – The device’s serial number for which this function is called.

  • direction – Forward (1) or reverse (2)

  • wait – True, to block until the motor reaches the target position. False, to do this asynchronously.

mot_move_velocity(serial_number: int, direction: int) None[source]

Lets the motor rotate continuously in the specified direction.

Parameters:
  • serial_number – The device’s serial number for which this function is called.

  • direction – Forward (1) or reverse (2)

mot_set_home_parameters(serial_number: int, direction: int, lim_switch: int, velocity: float, zero_offset: float) None[source]

Sets the motor’s parameters for moving home

Parameters:
  • serial_number – The device’s serial number for which this function is called.

  • direction – Moving direction (1 for forward, 2 for reverse)

  • lim_switch – Home limit switch (1 for reverse, 4 for forward)

  • velocity – Moving velocity in degrees/s

  • zero_offset – Offset of zero position in degrees

Returns:

minimum velocity (deg/s), acceleration (deg/s/s), maximum velocity (deg/s)

mot_set_velocity_parameters(serial_number: int, min_vel: float, accn: float, max_vel: float) None[source]

Sets the motor’s velocity parameters

Parameters:
  • serial_number – The device’s serial number for which this function is called.

  • min_vel – Minimum veloctiy (starting velocity) in deg/s

  • accn – Acceleration in deg/s/s

  • max_vel – Maximum velocity (target velocity) in deg/s

mot_stop_profiled(serial_number: int) None[source]

Stops the motor.

Parameters:

serial_number – The device’s serial number for which this function is called.

qcodes_contrib_drivers.drivers.Thorlabs.private.CC module

QCoDes- Base driver for Thorlab instruments using the CC commands

Authors:

Julien Barrier, <julien@julienbarrier.eu>

qcodes_contrib_drivers.drivers.Thorlabs.private.LS module

QCoDes- Base driver for Thorlab instruments using the LS commands

Authors:

iago-rst https://github.com/iago-rst, 2023 Julien Barrier <julien@julienbarrier.eu>, 2023

qcodes_contrib_drivers.drivers.Thorlabs.private.kinesis module

QCoDeS base drivers for Thorlabs Kinesis instruments

Authors:

Julien Barrier, <julien@julienbarrier.eu>

Module contents