qmi.instruments.newport.tlb670x

Instrument driver for the NewPort/NewFocus TLB-670x tunable laser controller.

This driver depends on the usbdll.dll library from New Focus. The permission for linking to the DLL library file, with a proprietary license, has been explicitly granted by Newport Corporation to QuTech.

Classes

NewFocus_TLB670X(context, name, serial_number)

Instrument driver for the New Focus TLB-670x USB tunable laser controller (Windows platforms only.)

class qmi.instruments.newport.tlb670x.NewFocus_TLB670X(context: QMI_Context, name: str, serial_number: int | str)

Instrument driver for the New Focus TLB-670x USB tunable laser controller (Windows platforms only.)

This driver requires that the DLL provided by NewFocus (“usbdll.dll”) is on the DLL search path.

This class contains a number of functions. Most importantly, the _send and _receive functions allow for sending strings and receiving the TLC response data via a buffer, respectively. The various command strings are invoked through functions defined in this class. The most important functions are the get_- and set_wavelength that can be used to change the TLC setpoint.

open() None

Open connection to the device controller.

close() None

Close connection to the device controller.

get_available_devices_info() List[Tuple[int, str]]

Get a list of all available devices that match the product ID for the TLB670-X.

get_ident() QMI_InstrumentIdentification

Get device identification.

get_device_id() int

Get the device ID of the device.

reset() None

Reset the device.

check_error_status() str

Check the error status of the device and return the error string if any.

Returns:

The error query response.

get_wavelength() float

Get the current wavelength setpoint.

Returns:

The wavelength setpoint in nanometers.

set_wavelength(wavelength: float) None

Set wavelength.

Parameters:

wavelength – wavelength in nanometers.

get_powermode() int

Get power state.

Returns:

laser off; 1: laser on.

Return type:

Power output state as 0

set_powermode(powermode: int) None

Set power state.

Parameters:

powermode – 0 turns the laser off, 1 turns the laser on.

get_trackingmode() int

Get tracking state.

Returns:

disabled; 1: enabled.

Return type:

Tracking state as 0

set_trackingmode(trackingmode: int) None

Set tracking state.

Parameters:

trackingmode – 0: disable, 1: enable.

get_diode_current() float

Get the laser diode current.

Returns:

Laser diode current in mA.

set_diode_current(current: int | float | str) None

Set the laser diode current in mA.

Parameters:

current – either a float representing the desired current in mA, or the string literal ‘MAX’ to set the current to the maximum allowable value.

get_piezo_voltage() float

Retrieve the current piezo voltage.

Returns:

Piezo voltage as percentage of its range.

set_piezo_voltage(percentage: float) None

Set the piezo voltage as percentage of its range.

Parameters:

percentage – piezo voltage percentage.

force_unlock() None

Forcefully unlock the remote object.

This unlocks the object, regardless of who owns the lock. This allows you to unlock an object if the locking proxy has been destroyed without unlocking.

Use this with care.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

classmethod get_category() str | None

Return the optional name of the category this object belongs to.

A category name is a free-form string that has no special significance. Its purpose is to distinguish between groups of RPC objects that fulfill similar roles.

get_name() str

Return the name of this object.

Returns:

name attribute.

get_signals() list[SignalDescription]

Return a list of signals that can be published by this object.

Returns:

List consisting of qmi_signals attributes.

is_locked() bool

Query if the remote object is locked.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

is_open() bool

Return True if the instrument is open (ready for interaction).

lock(timeout: float = 0.0, lock_token: str | None = None) bool

Lock the remote object. If timeout is given, try every 0.1s within the given timeout value. The remote object can be locked with an optional custom lock token by giving a string into lock_token keyword argument.

If successful, this proxy is the only proxy that can invoke RPC methods on the remote object; other proxies will receive an “object is locked” response. The return value indicates if the lock was granted; a denied lock means the object was already locked by another proxy.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

release_rpc_object() None

Give a warning if the instrument is removed while still open.

unlock(lock_token: str | None = None) bool

Unlock the remote object.

Without optional parameters, this is only allowed by the proxy that initially locked the object. By giving the lock token as an input parameter, the specific object locked by this token can be unlocked. The return value indicates if the unlocking was successful.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.