### Controlling Elliptec Linear Stage - Python Source: https://github.com/roesel/elliptec/blob/main/README.md This example shows how to control an Elliptec linear stage, potentially for tasks like finding optimal focus. It initializes the controller and linear stage, homes the device, and then iterates through a range of distances, setting the stage position for each measurement. ```python import elliptec controller = elliptec.Controller('COM3') ls = elliptec.Linear(controller) # Home the linear stage before usage ls.home() # Loop over a list of positions and measure gain for each for distance in range(0, 61, 10): ls.set_distance(distance) # ... measure gain ``` -------------------------------- ### Controlling Elliptec Slider - Python Source: https://github.com/roesel/elliptec/blob/main/README.md This example shows how to control a four-positional Elliptec slider. It initializes the controller and slider, homes the device, moves to a specific slot position, and then moves the slider forward. ```python import elliptec controller = elliptec.Controller('COM3') sl = elliptec.Slider(controller) # Home the slider before usage sl.home() # Move slider to position 3 sl.set_slot(3) # Move slider forward (to position 4) sl.move('forward') ``` -------------------------------- ### Controlling Multiple Elliptec Devices on Bus - Python Source: https://github.com/roesel/elliptec/blob/main/README.md This advanced example demonstrates controlling multiple Elliptec devices connected to a single ELB bus. It initializes the controller and separate device instances (shutter and rotator) using their specific addresses, homes both devices, and then iterates through angles, setting the rotator and opening/closing the shutter for each. ```python import elliptec controller = elliptec.Controller('COM4') sh = elliptec.Shutter(controller, address='1') ro = elliptec.Rotator(controller, address='2') # Home the shutter and the rotator sh.home() ro.home() # Loop over a list of angles and opne/acquire/close for each for angle in [0, 90]: ro.set_angle(angle) # Open shutter, acquire, and close again sh.open() # ... acquire or perform other tasks sh.close() ``` -------------------------------- ### Control Multiple Elliptec Devices (Shutter, Rotator) - Python Source: https://github.com/roesel/elliptec/blob/main/docs/source/index.rst An advanced example showing simultaneous control of multiple Thorlabs Elliptec devices connected to a single bus controller. It initializes the controller, creates device objects (Shutter, Rotator) specifying their addresses, homes both devices, and loops through angles, setting the rotator position and opening/closing the shutter for each angle. Requires a serial connection (e.g., 'COM4') and devices configured with specific addresses. ```python import elliptec controller = elliptec.Controller('COM4') sh = elliptec.Shutter(controller, address='1') ro = elliptec.Rotator(controller, address='2') # Home the shutter and the rotator sh.home() ro.home() # Loop over a list of angles and opne/acquire/close for each for angle in [0, 90]: ro.set_angle(angle) # Open shutter, acquire, and close again sh.open() # ... acquire or perform other tasks sh.close() ``` -------------------------------- ### Building Python Package - Shell Source: https://github.com/roesel/elliptec/blob/main/scripts/pypi.txt This command uses the standard 'build' module to create source and wheel distribution archives for the Python package. The output files are typically placed in a 'dist/' directory. ```shell python -m build ``` -------------------------------- ### Controlling Elliptec Shutter - Python Source: https://github.com/roesel/elliptec/blob/main/README.md This snippet demonstrates basic control of an Elliptec shutter. It initializes the controller and shutter, homes the device, retrieves information, opens the shutter for acquisition, and then closes it. ```python import elliptec controller = elliptec.Controller('COM3') sh = elliptec.Shutter(controller) # Get information about the device info = sh.get('info') # Home the shutter before usage sh.home() # Open shutter, acquire, and close again sh.open() # ... acquire or perform other tasks sh.close() ``` -------------------------------- ### Uploading Python Package to PyPI - Shell Source: https://github.com/roesel/elliptec/blob/main/scripts/pypi.txt This command uses the 'twine' utility to upload the distribution files (found in the 'dist/' directory) to the specified package repository, commonly PyPI. Authentication credentials are typically required. ```shell python -m twine upload --repository pypi dist/* ``` -------------------------------- ### Control Thorlabs Elliptec Shutter - Python Source: https://github.com/roesel/elliptec/blob/main/docs/source/index.rst Demonstrates basic control of a Thorlabs Elliptec shutter device using the `elliptec` library. It initializes the controller, creates a Shutter object, retrieves device information, homes the device, and shows how to open and close the shutter. Requires a serial connection (e.g., 'COM3'). ```python import elliptec controller = elliptec.Controller('COM3') sh = elliptec.Shutter(controller) # Get information about the device info = sh.get('info') # Home the shutter before usage sh.home() # Open shutter, acquire, and close again sh.open() # ... acquire or perform other tasks sh.close() ``` -------------------------------- ### Controlling Elliptec Rotator - Python Source: https://github.com/roesel/elliptec/blob/main/README.md This snippet demonstrates controlling an Elliptec rotator (mount or stage) to collect data at multiple angles. It initializes the controller and rotator, homes the device, and then iterates through a list of angles, setting the rotator position for each. ```python import elliptec controller = elliptec.Controller('COM3') ro = elliptec.Rotator(controller) # Home the rotator before usage ro.home() # Loop over a list of angles and acquire for each for angle in [0, 45, 90, 135]: ro.set_angle(angle) # ... acquire or perform other tasks ``` -------------------------------- ### Control Thorlabs Elliptec Linear Stage - Python Source: https://github.com/roesel/elliptec/blob/main/docs/source/index.rst Demonstrates controlling a Thorlabs Elliptec linear stage, often used for tasks like finding optimal focus. It initializes the controller, creates a Linear object, homes the device, and iterates through a range of distances, setting the stage position for each step. Requires a serial connection (e.g., 'COM3'). ```python import elliptec controller = elliptec.Controller('COM3') ls = elliptec.Linear(controller) # Home the linear stage before usage ls.home() # Loop over a list of positions and measure gain for each for distance in range(0, 61, 10): ls.set_distance(distance) # ... measure gain ``` -------------------------------- ### Control Thorlabs Elliptec Slider - Python Source: https://github.com/roesel/elliptec/blob/main/docs/source/index.rst Illustrates basic control of a Thorlabs Elliptec slider device. It initializes the controller, creates a Slider object, homes the device, sets the slider to a specific slot position (e.g., 3), and demonstrates moving the slider forward. Requires a serial connection (e.g., 'COM3'). ```python import elliptec controller = elliptec.Controller('COM3') sl = elliptec.Slider(controller) # Home the slider before usage sl.home() # Move slider to position 3 sl.set_slot(3) # Move slider forward (to position 4) sl.move('forward') ``` -------------------------------- ### Control Thorlabs Elliptec Rotator - Python Source: https://github.com/roesel/elliptec/blob/main/docs/source/index.rst Shows how to control a Thorlabs Elliptec rotator (mount or stage) to acquire data at multiple angles. It initializes the controller, creates a Rotator object, homes the device, and loops through a list of angles, setting the rotator to each angle. Requires a serial connection (e.g., 'COM3'). ```python import elliptec controller = elliptec.Controller('COM3') ro = elliptec.Rotator(controller) # Home the rotator before usage ro.home() # Loop over a list of angles and acquire for each for angle in [0, 45, 90, 135]: ro.set_angle(angle) # ... acquire or perform other tasks ``` -------------------------------- ### Changing Elliptec Device Addresses on Bus - Python Source: https://github.com/roesel/elliptec/blob/main/README.md This snippet shows how to change the addresses of Elliptec devices connected to a bus. It initializes the controller and then connects devices one by one, using the `change_address()` function to assign a new address to each motor instance. ```python import elliptec controller = elliptec.Controller('COM4') # connect your first device to the bus device_1 = elliptec.Motor(controller) device_1.change_address('1') # connect your second device device_2 = elliptec.Motor(controller) device_2.change_address('2') ``` -------------------------------- ### Change Elliptec Device Address - Python Source: https://github.com/roesel/elliptec/blob/main/docs/source/index.rst Demonstrates how to change the address of Thorlabs Elliptec devices when they are connected one by one to the bus controller. It initializes the controller, creates a generic Motor object for the connected device, and uses the `change_address()` function to set a new address. This is useful if device addresses need to be reconfigured. Requires a serial connection (e.g., 'COM4') and connecting devices sequentially. ```python import elliptec controller = elliptec.Controller('COM4') # connect your first device to the bus device_1 = elliptec.Motor(controller) device_1.change_address('1') # connect your second device device_2 = elliptec.Motor(controller) device_2.change_address('2') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.