msl.equipment.resources.thorlabs.fwxx2c module

Wrapper around Thorlabs FilterWheel102.dll, v4.0.0.

Thorlabs FW102C Series and FW212C Series Motorized Filter Wheels.

class msl.equipment.resources.thorlabs.fwxx2c.FilterCount(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

The number of filter positions that the filter wheel has.

SIX = 6
TWELVE = 12
class msl.equipment.resources.thorlabs.fwxx2c.SensorMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Sensor modes of the filter wheel.

ON = 0
OFF = 1
class msl.equipment.resources.thorlabs.fwxx2c.SpeedMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Speed modes of the filter wheel.

SLOW = 0
FAST = 1
class msl.equipment.resources.thorlabs.fwxx2c.TriggerMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

Trigger modes of the filter wheel.

INPUT = 0

Respond to an active-low pulse by advancing the position by 1

OUTPUT = 1

Generate an active-high pulse when the position changes

class msl.equipment.resources.thorlabs.fwxx2c.FilterWheelXX2C(record)[source]

Bases: ConnectionSDK

Wrapper around Thorlabs FilterWheel102.dll, v4.0.0.

Connects to the Thorlabs FW102C Series and FW212C Series Motorized Filter Wheels.

A 64-bit version of the library can be download from here and it is located in AppNotes_FW102C/LabVIEW/Thorlabs_FW102C/Library/FilterWheel102_win64.dll.

The properties for a FilterWheelXX2C connection supports the following key-value pairs in the Connections Database:

'port': str, the serial port number, e.g., 'COM3'
'baud_rate': int, the baud rate for the serial connection [default: 115200]
'timeout': int, the timeout in seconds [default: 10]

Do not instantiate this class directly. Use the connect() method to connect to the equipment.

Parameters:

record (EquipmentRecord) – A record from an Equipment-Register Database.

Raises:

ThorlabsError – If a connection to the filter wheel cannot be established.

close()[source]

Close the opened COM port.

disconnect()[source]

Close the opened COM port.

errcheck_code(result, func, arguments)[source]

The SDK function returns OK if the function call was successful.

errcheck_negative(result, func, arguments)[source]

The SDK function returns a positive number if the call was successful.

errcheck_non_zero(result, func, arguments)[source]

The SDK function returns 0 if the call was successful.

get_acceleration()[source]
Returns:

int – The current acceleration value of the filter wheel.

get_id()[source]
Returns:

str – The id of the filter wheel.

get_max_velocity()[source]
Returns:

int – The current maximum velocity value of the filter wheel.

get_min_velocity()[source]
Returns:

int – The current minimum velocity value of the filter wheel.

get_ports()[source]

List all the COM ports on the computer.

Returns:

dict – A dictionary where the keys are the port numbers, e.g. COM1, COM3, and the values are a description about each device connected to the port.

get_position()[source]
Returns:

int – The current position of the filter wheel.

get_position_count()[source]
Returns:

FilterCount – The number of filter positions that the filter wheel has.

get_sensor_mode()[source]
Returns:

SensorMode – The current sensor mode of the filter wheel.

get_speed_mode()[source]
Returns:

SpeedMode – The current speed mode of the filter wheel.

get_time_to_current_pos()[source]
Returns:

int – The time from last position to current position.

get_trigger_mode()[source]
Returns:

TriggerMode – The current trigger mode of the filter wheel.

is_open(port)[source]

Check if the COM port is open.

Parameters:

port (str) – The port to be checked, e.g. COM3.

Returns:

boolTrue if the port is opened; False if the port is closed.

open(port, baud_rate, timeout)[source]

Open a COM port for communication.

Parameters:
  • port (str) – The port to be opened, use the get_ports() function to get a list of available ports.

  • baud_rate (int) – The number of bits per second to use for the communication protocol.

  • timeout (int) – Set the timeout value, in seconds.

save()[source]

Save the current settings as the default settings on power up.

set_acceleration(acceleration)[source]

Set the filter wheel’s acceleration.

Parameters:

acceleration (int) – The filter wheel’s acceleration value.

set_max_velocity(maximum)[source]

Set the filter wheel’s maximum velocity.

Parameters:

maximum (int) – The filter wheel’s maximum velocity value.

set_min_velocity(minimum)[source]

Set the filter wheel’s minimum velocity.

Parameters:

minimum (int) – The filter wheel’s minimum velocity value.

set_position(position)[source]

Set the filter wheel’s position.

Parameters:

position (int) – The position number to set the filter wheel to.

Raises:

ValueError – If the value of position is invalid.

set_position_count(count)[source]

Set the filter wheel’s position count.

This is the number of filter positions that the filter wheel has.

Parameters:

count (FilterCount) – The number of filters in the filter wheel as a FilterCount enum value or member name.

Raises:

ValueError – If the value of count is invalid.

set_sensor_mode(mode)[source]

Set the filter wheel’s sensor mode.

Parameters:

mode (SensorMode) – The filter wheel’s sensor mode as a SensorMode enum value or member name.

Raises:

ValueError – If the value of mode is invalid.

set_speed_mode(mode)[source]

Set the filter wheel’s speed mode.

Parameters:

mode (SpeedMode) – The speed mode of the filter wheel as a SpeedMode enum value or member name.

Raises:

ValueError – If the value of mode is invalid.

set_trigger_mode(mode)[source]

Set the filter wheel’s trigger mode.

Parameters:

mode (TriggerMode) – The filter wheel’s trigger mode as a TriggerMode enum value or member name.

Raises:

ValueError – If the value of mode is invalid.