connect#
method
- TSL550.connect(port: str = '', baudrate: int = 9600, terminator: str = '\r', timeout: int = 100, query_delay: float = 0.05) bool[source]#
Connects to and initializes the laser. All parameters are keyword arguments.
- Parameters:
- portstr
Port is the serial port the laser is connected to (default “”).
- baudrateint, optional
Baudrate can be set on the device (default 9600).
- min_wavelengthfloat
Minimum wavelength the laser will produce in nanometers (default 0).
- max_wavelengthfloat
Maximum wavelength the laser will produce in nanometers (default 10000).
- min_powerfloat
Minimum power level of the laser in dBm (default 0)
- max_powerfloat
Maximum power level of the laser in dBm (default 30)
- min_power_attfloat
Minimum internal power attenuation of the laser in dB (default 0)
- max_power_attfloat
Maximum internal power attenaution of the laser in dB (default 30)
- terminatorstr, optional
The string that marks the end of a command (default “r”).
- timeoutint, optional
The number of seconds to timeout after no response (default 100).
- query_delayfloat, optional
A delay, in seconds, between consecutive write and read operations in a query (default 0.05).
- Returns:
- bool
True if the device has been successfuly connected to. False otherwise.