# ThorLabs¶

## PM100USB USB Power Meter¶

class instruments.thorlabs.PM100USB(filelike)

Instrument class for the ThorLabs PM100USB power meter. Note that as this is an SCPI-compliant instrument, the properties and methods of SCPIInstrument may be used as well.

class MeasurementConfiguration

Enum containing valid measurement modes for the PM100USB

current = <MeasurementConfiguration.current: 'CURR'>
energy = <MeasurementConfiguration.energy: 'ENER'>
energy_density = <MeasurementConfiguration.energy_density: 'EDEN'>
frequency = <MeasurementConfiguration.frequency: 'FREQ'>
power = <MeasurementConfiguration.power: 'POW'>
power_density = <MeasurementConfiguration.power_density: 'PDEN'>
resistance = <MeasurementConfiguration.resistance: 'RES'>
temperature = <MeasurementConfiguration.temperature: 'TEMP'>
voltage = <MeasurementConfiguration.voltage: 'VOLT'>
class PM100USB.Sensor(parent)

Class representing a sensor on the ThorLabs PM100USB

Warning

This class should NOT be manually created by the user. It is designed to be initialized by the PM100USB class.

calibration_message

Gets the calibration message of the sensor channel

Type: str
flags

Gets any sensor flags set on the sensor channel

name

Gets the name associated with the sensor channel

Type: str
serial_number

Gets the serial number of the sensor channel

Type: str
type

Gets the sensor type of the sensor channel

Type: str
class PM100USB.SensorFlags

Enum containing valid sensor flags for the PM100USB

has_temperature_sensor = <SensorFlags.has_temperature_sensor: 256>
is_energy_sensor = <SensorFlags.is_energy_sensor: 2>
is_power_sensor = <SensorFlags.is_power_sensor: 1>
response_settable = <SensorFlags.response_settable: 16>
tau_settable = <SensorFlags.tau_settable: 64>
wavelength_settable = <SensorFlags.wavelength_settable: 32>
PM100USB.read(size=-1)

Reads a measurement from this instrument, according to its current configuration mode.

Parameters: size (int) – Number of bytes to read from the instrument. Default of -1 reads until a termination character is found. As specified by measurement_configuration. Quantity
PM100USB.averaging_count

Integer specifying how many samples to collect and average over for each measurement, with each sample taking approximately 3 ms.

PM100USB.cache_units

If enabled, then units are not checked every time a measurement is made, reducing by half the number of round-trips to the device.

Warning

Setting this to True may cause incorrect values to be returned, if any commands are sent to the device either by its local panel, or by software other than InstrumentKit.

Type: bool
PM100USB.flag = <SensorFlags.has_temperature_sensor: 256>
PM100USB.measurement_configuration

Returns the current measurement configuration.

Return type: PM100USB.MeasurementConfiguration
PM100USB.sensor

Returns information about the currently connected sensor.

## ThorLabsAPT ThorLabs APT Controller¶

class instruments.thorlabs.ThorLabsAPT(filelike)

Generic ThorLabs APT hardware device controller. Communicates using the ThorLabs APT communications protocol, whose documentation is found in the thorlabs source folder.

class APTChannel(apt, idx_chan)

Represents a channel within the hardware device. One device can have many channels, each labeled by an index.

enabled

Gets/sets the enabled status for the specified APT channel

Type: bool
ThorLabsAPT.identify()

Causes a light on the APT instrument to blink, so that it can be identified.

ThorLabsAPT.channel

Gets the list of channel objects attached to the APT controller.

A specific channel object can then be accessed like one would access a list.

Type: tuple of APTChannel
ThorLabsAPT.destination

Gets the destination for the APT controller

Type: int
ThorLabsAPT.model_number

Gets the model number for the APT controller

Type: str
ThorLabsAPT.n_channels

Gets/sets the number of channels attached to the APT controller

Type: int
ThorLabsAPT.name

Gets the name of the APT controller. This is a human readable string containing the model, serial number, hardware version, and firmware version.

Type: str
ThorLabsAPT.serial_number

Gets the serial number for the APT controller

Type: str
class instruments.thorlabs.APTPiezoStage(filelike)

Class representing a Thorlabs APT piezo stage

class PiezoChannel(apt, idx_chan)

Class representing a single piezo channel within a piezo stage on the Thorlabs APT controller.

change_position_control_mode(closed, smooth=True)

Changes the position control mode of the piezo channel

Parameters: closed (bool) – True for closed, False for open smooth (bool) – True for smooth, False for otherwise. Default is True.
output_position

Gets/sets the output position for the piezo channel.

Type: str
position_control_closed

Gets the status if the position control is closed or not.

True means that the position control is closed, False otherwise

Tyep: bool
class instruments.thorlabs.APTStrainGaugeReader(filelike)

Class representing a Thorlabs APT strain gauge reader.

Warning

This is not currently implemented

class StrainGaugeChannel(apt, idx_chan)

Class representing a single strain gauge channel attached to a APTStrainGaugeReader on the Thorlabs APT controller.

Warning

This is not currently implemented

class instruments.thorlabs.APTMotorController(filelike)

Class representing a Thorlabs APT motor controller

class MotorChannel(apt, idx_chan)

Class representing a single motor attached to a Thorlabs APT motor controller (APTMotorController).

go_home()

move(pos, absolute=True)

Instructs the specified motor channel to move to a specific location. The provided position can be either an absolute or relative position.

Parameters: pos (Quantity) – The position to move to. Provided value will be converted to encoder counts. absolute (bool) – Specify if the position is a relative or absolute position. True means absolute, while False is for a relative move. As specified, or assumed to of units encoder counts
set_scale(motor_model)

Sets the scale factors for this motor channel, based on the model of the attached motor and the specifications of the driver of which this is a channel.

Parameters: motor_model (str) – Name of the model of the attached motor, as indicated in the APT protocol documentation (page 14, v9).
position

Gets the current position of the specified motor channel

Type: Quantity
position_encoder

Gets the position of the encoder of the specified motor channel

Type: Quantity Encoder counts
scale_factors = (array(1) * dimensionless, array(1) * dimensionless, array(1) * dimensionless)
status_bits

Gets the status bits for the specified motor channel.

Type: dict

## SC10 Optical Beam Shutter Controller¶

class instruments.thorlabs.SC10(filelike)

The SC10 is a shutter controller, to be used with the Thorlabs SH05 and SH1. The user manual can be found here: http://www.thorlabs.com/thorcat/8600/SC10-Manual.pdf

class Mode

Enum containing valid output modes of the SC10

auto = <Mode.auto: 2>
external = <Mode.external: 5>
manual = <Mode.manual: 1>
repeat = <Mode.repeat: 4>
single = <Mode.single: 3>
SC10.default()

Restores instrument to factory settings.

Returns 1 if successful, zero otherwise.

Return type: int
SC10.restore()

Returns 1 if successful, zero otherwise.

Return type: int
SC10.save()

Stores the parameters in static memory

Returns 1 if successful, zero otherwise.

Return type: int
SC10.save_mode()

Stores output trigger mode and baud rate settings in memory.

Returns 1 if successful, zero otherwise.

Return type: int
SC10.baud_rate

Gets/sets the instrument baud rate.

Valid baud rates are 9600 and 115200.

Type: int
SC10.closed

Gets the shutter closed status.

True represents the shutter is closed, and False for the shutter is open.

Return type: bool
SC10.enable

Gets/sets the shutter enable status, False for disabled, True if enabled

If output enable is on (True), there is a voltage on the output.

Return type: bool
SC10.interlock

Gets the interlock tripped status.

Returns True if the interlock is tripped, and False otherwise.

Return type: bool
SC10.mode

Gets/sets the output mode of the SC10

Return type: SC10.Mode
SC10.name

Gets the name and version number of the device.

Returns: Name and verison number of the device str
SC10.open_time

Gets/sets the amount of time that the shutter is open, in ms

Units: As specified (if a Quantity) or assumed to be of units milliseconds. Quantity
SC10.out_trigger

Gets/sets the out trigger source.

0 trigger out follows shutter output, 1 trigger out follows controller output

Type: int
SC10.repeat

Gets/sets the repeat count for repeat mode. Valid range is [1,99] inclusive.

Type: int
SC10.shut_time

Gets/sets the amount of time that the shutter is closed, in ms

Units: As specified (if a Quantity) or assumed to be of units milliseconds. Quantity
SC10.trigger

Gets/sets the trigger source.

0 for internal trigger, 1 for external trigger

Type: int

## LCC25 Liquid Crystal Controller¶

class instruments.thorlabs.LCC25(filelike)

The LCC25 is a controller for the thorlabs liquid crystal modules. it can set two voltages and then oscillate between them at a specific repetition rate.

The user manual can be found here: http://www.thorlabs.com/thorcat/18800/LCC25-Manual.pdf

class Mode

Enum containing valid output modes of the LCC25

normal = <Mode.normal: 0>
voltage1 = <Mode.voltage1: 1>
voltage2 = <Mode.voltage2: 2>
LCC25.default()

Restores instrument to factory settings.

Returns 1 if successful, 0 otherwise

Return type: int
LCC25.get_settings(slot)

Gets the current settings to memory.

Returns 1 if successful, zero otherwise.

Parameters: slot (int) – Memory slot to use, valid range [1,4] int
LCC25.save()

Stores the parameters in static memory

Returns 1 if successful, zero otherwise.

Return type: int
LCC25.set_settings(slot)

Saves the current settings to memory.

Returns 1 if successful, zero otherwise.

Parameters: slot (int) – Memory slot to use, valid range [1,4] int
LCC25.test_mode()

Puts the LCC in test mode - meaning it will increment the output voltage from the minimum value to the maximum value, in increments, waiting for the dwell time

Returns 1 if successful, zero otherwise.

Return type: int
LCC25.dwell

Gets/sets the dwell time for voltages for the test mode.

Units: As specified (if a Quantity) or assumed to be of units milliseconds. Quantity
LCC25.enable

Gets/sets the output enable status.

If output enable is on (True), there is a voltage on the output.

Return type: bool
LCC25.extern

Gets/sets the use of the external TTL modulation.

Value is True for external TTL modulation and False for internal modulation.

Return type: bool
LCC25.frequency

Gets/sets the frequency at which the LCC oscillates between the two voltages.

Units: As specified (if a Quantity) or assumed to be of units Hertz. Quantity
LCC25.increment

Gets/sets the voltage increment for voltages for the test mode.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
LCC25.max_voltage

Gets/sets the maximum voltage value for the test mode. If the maximum voltage is less than the minimum voltage, nothing happens.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
LCC25.min_voltage

Gets/sets the minimum voltage value for the test mode.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
LCC25.mode

Gets/sets the output mode of the LCC25

Return type: LCC25.Mode
LCC25.name

Gets the name and version number of the device

Return type: str
LCC25.remote

Gets/sets front panel lockout status for remote instrument operation.

Value is False for normal operation and True to lock out the front panel buttons.

Return type: bool
LCC25.voltage1

Gets/sets the voltage value for output 1.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity
LCC25.voltage2

Gets/sets the voltage value for output 2.

Units: As specified (if a Quantity) or assumed to be of units Volts. Quantity

## TC200 Temperature Controller¶

class instruments.thorlabs.TC200(filelike)

The TC200 is is a controller for the voltage across a heating element. It can also read in the temperature off of a thermistor and implements a PID control to keep the temperature at a set value.

The user manual can be found here: http://www.thorlabs.com/thorcat/12500/TC200-Manual.pdf

class Mode

Enum containing valid output modes of the TC200.

cycle = <Mode.cycle: 1>
normal = <Mode.normal: 0>
class TC200.Sensor

Enum containing valid temperature sensor types for the TC200.

ntc10k = <Sensor.ntc10k: 'ntc10k'>
ptc100 = <Sensor.ptc100: 'ptc100'>
ptc1000 = <Sensor.ptc1000: 'ptc1000'>
th10k = <Sensor.th10k: 'th10k'>
TC200.name()

Gets the name and version number of the device

Returns: the name string of the device str
TC200.beta

Gets/sets the beta value of the thermistor curve.

Value within [2000, 6000]

Returns: the gain (in nnn) int
TC200.d

Gets/sets the d-gain. Valid numbers are [0, 250]

Returns: the d-gain (in nnn) int
TC200.degrees

Gets/sets the units of the temperature measurement.

Returns: The temperature units (degC/F/K) the TC200 is measuring in UnitTemperature
TC200.enable

Gets/sets the heater enable status.

If output enable is on (True), there is a voltage on the output.

Type: bool
TC200.i

Gets/sets the i-gain. Valid numbers are [1,250]

Returns: the i-gain (in nnn) int
TC200.max_power

Gets/sets the maximum power

Returns: The maximum power Watts (linear units) Quantity
TC200.max_temperature

Gets/sets the maximum temperature

Returns: the maximum temperature (in deg C) As specified or assumed to be degree Celsius. Returns with units degC. Quantity
TC200.mode

Gets/sets the output mode of the TC200

Type: TC200.Mode
TC200.p

Gets/sets the p-gain. Valid numbers are [1,250].

Returns: the p-gain (in nnn) int
TC200.pid

Gets/sets all three PID values at the same time. See TC200.p, TC200.i, and TC200.d for individual restrictions.

If None is specified then the corresponding PID value is not changed.

Returns: List of integers of PID values. In order [P, I, D]. list or tuple list
TC200.sensor

Gets/sets the current thermistor type. Used for converting resistances to temperatures.

Returns: The thermistor type TC200.Sensor
TC200.status

Gets the the status code of the TC200

Return type: int
TC200.temperature

Gets the actual temperature of the sensor

Units: As specified (if a Quantity) or assumed to be of units degrees C. Quantity or int the temperature (in degrees C) Quantity
TC200.temperature_set

Gets/sets the actual temperature of the sensor

Units: As specified (if a Quantity) or assumed to be of units degrees C. Quantity or int the temperature (in degrees C) Quantity