Python reference API¶
-
class
pypdm.PDM(address, link)¶ Class to command one Alphanov’s PDM laser sources.
-
MAX_DELAY= 15000¶
-
MAX_PULSE_WIDTH= 1275000¶
-
__del__()¶ For safety, disable laser when the object is deleted.
-
__init__(address, link)¶ Parameters:
-
activation¶ True when laser is enabled, False when laser is off. Call
apply()to make any change effective.
-
apply()¶ Apply all the instructions which are in volatile memory. This makes all settings changes effectives.
-
current¶ Current, in mA. Please note this property is in milli-amperes and is not a percentage of the maximum current, as the official PDM documentation may state. For the percentage, see current_percentage property. Call
apply()to make any change effective.Getter: Return diode current configuration. Setter: Set the new current. Raise a ValueError if current is out of bounds.
-
current_percentage¶ Current, in percentage of maximum. This is an alternative way of changing the
currentproperty. Callapply()to make any change effective.
-
current_source¶ Current source. Set to
CurrentSource.NUMERICto control the laser diode pulse current from software through thecurrentorcurrent_percentageattributes.Type: CurrentSource
-
delay¶ Delay, in ps. int. Maximum value is defined in MAX_DELAY.
-
delay_line_type¶ Delay line type,
DelayLineTypeinstance.
-
frequency¶ Frequency, in Hz. int. Read-only.
-
interlock_status¶ True if interlock is detected, False otherwise.
-
maximum_current¶ Maximum current, in mA. The getter of this property queries the PDM device once then cache the value for next accesses.
-
offset_current¶ Offset current, in mA. float.
-
pulse_width¶ Pulse width, in ps. int. Maximum value is defined in MAX_PULSE_WIDTH.
-
read_address()¶ Query laser source address.
-
read_protocol_version()¶ Returns: Protocol version string, for instance ‘3.4’.
-
sync_source¶ Synchronization source,
SyncSourceinstance.
-
temperature¶ Temperature, in degrees.
-
-
class
pypdm.Link(dev)¶ Base PDM communication implementation. An instance of
Linkuses a serial port and can be shared by multiplePDMinstances if the devices are daisy-chained.-
__init__(dev)¶ Open serial device.
Parameters: dev – Serial device path. For instance ‘/dev/ttyUSB0’ on linux, ‘COM0’ on Windows.
-
-
class
pypdm.SyncSource¶ Possible PDM synchronization source.
-
EXTERNAL_LVDS= 1¶
-
EXTERNAL_TTL_LVTTL= 0¶
-
INTERNAL= 2¶
-
-
class
pypdm.ChecksumError¶ Thrown if a communication checksum error is detected.
-
class
pypdm.ProtocolError¶ Thrown if an unexpected response from the device is received.
-
class
pypdm.ProtocolVersionNotSupported(version)¶ Thrown when a PDM protocol version is not (yet) supported by the library.
-
class
pypdm.ConnectionFailure¶
-
class
pypdm.StatusError(status)¶ Thrown when a PDM device did not respond with ‘OK’ status to the last command.