thorlabs_elliptec.multi module¶
- class thorlabs_elliptec.multi.MultiELLx(device_list: list[dict])[source]¶
Bases:
objectGeneric class to handle multiple Thorlabs Elliptec devices via multi-drop.
To connect multiple stages, create a list of dictionaries where each dictionary contains the parameters to connect one stage via the class
ellx.ELLx. Each configuration dictionary has to include the key device_id corresponding to the ID of the stage.Example:
device_list = [ { "device_id": 0, "serial_port": "/dev/ttyUSB0", "x": 20 }, { "device_id": 1, "x": 4, } ]
After instantiation, the stages can be accessed via
stages[device_id]. If no stage is connected with device_id, thenNoneis returned.- Parameters:
device_list – List of configuration dictionaries for ELLx instances.
- get_position(device_id: int = 0) float[source]¶
Return the current position of the ELLx device, in real device units. See
ellx.ELLx.get_position().- Parameters:
device_id – Device id.
- Returns:
Position in real device units.
- get_position_raw(device_id: int = 0) int[source]¶
Return the current position of the ELLx device, in raw encoder counts. See
ellx.ELLx.get_position_raw().- Parameters:
device_id – Device id.
- Returns:
Position in raw encoder counts.
- home(device_id: int = 0, direction: int = 0, blocking: bool = False) None[source]¶
Move to device to the home position. See
ellx.ELLx.home().- Parameters:
device_id – Device id.
direction – Direction to move.
blocking – Wait for operation to complete.
- home_all(direction: int = 0, blocking: bool = False) None[source]¶
Move all devices to their home position. See
ellx.ELLx.home().- Parameters:
direction – Direction to move.
blocking – Wait for operation to complete.
- is_moving(device_id: int = None, raise_errors: bool = False) bool[source]¶
Test if the device is currently performing a move operation. See
ellx.ELLx.is_moving().- Parameters:
device_id – Device id.
raise_errors – Raise an
ELLErrorif movement failed.
- Returns:
True if device is currently moving.
- move_absolute(device_id: int = 0, position: float = 0, blocking: bool = False) None[source]¶
Move the device to an absolute position, specified in real device units. See
ellx.ELLx.move_absolute().- Parameters:
device_id – Device id.
position – Position to move to, in real device units.
blocking – Wait for operation to complete.
- move_absolute_raw(device_id: int = 0, counts: int = 0, blocking: bool = False) None[source]¶
Move the device to an absolute position, specified in raw encoder counts. See
ellx.ELLx.move_absolute_raw().- Parameters:
device_id – Device id.
counts – Position to move to, in raw encoder counts.
blocking – Wait for operation to complete.
- move_relative(device_id: int = 0, amount: float = 0, blocking: bool = False) None[source]¶
Move the device by a relative amount, specified in real device units. See
ellx.ELLx.move_relative().- Parameters:
device_id – Device id.
amount – Amount to move by, in real device units.
blocking – Wait for operation to complete.
- move_relative_raw(device_id: int = 0, counts: int = 0, blocking: bool = False) None[source]¶
Move the device by a relative amount, specified in raw encoder counts. See
ellx.ELLx.move_relative_raw().- Parameters:
device_id – Device id.
counts – Amount to move by, in raw encoder counts.
blocking – Wait for operation to complete.
- wait(raise_errors: bool = False) None[source]¶
Block until any current movement is completed. See
ellx.ELLx.wait().- Parameters:
raise_errors – Raise an
ELLErrorif movement failed.
- property device_id: list[int]¶
Numeric ID of the device used during communications. See
ellx.ELLx.device_id().
- property firmware_version: list[str]¶
Firmware version installed on the device. See
ellx.ELLx.firmware_version().
- property model_number: list[str]¶
Model number of the device. See
ellx.ELLx.model_number().
- property port_name: list[str]¶
Serial port device name. See
ellx.ELLx.port_name().
- property serial_number: list[str]¶
Serial number of the device. See
ellx.ELLx.serial_number().
- stages = []¶
- property status: list¶
Current state of the ELLx devices. See
ellx.ELLx.status().
- property status_poll_interval: float¶
Time between polling for status updates, in seconds. Default is 0.1 seconds. See
ellx.ELLx.status_poll_interval().
- property thread_type: list[str]¶
Thread type of mountings on the device (
"metric"or"imperial"). Seeellx.ELLx.thread_type().
- property travel: list[int]¶
Maximum travel distance/angle of device. See
ellx.ELLx.travel().
- property units: list[str]¶
A string representation of the units for the device’s movement type. See
ellx.ELLx.units().
- property valid_stages: list¶
Return a list of all connected stages. Therefore, the list index does not necessarily equal the device id.
- Returns:
List of all connected stages.
- property year: list[int]¶
Manufacturing year of the device. See
ellx.ELLx.year().