ThorLabs APT stage
Pieces for interacting with ThorLabs moving stages through the APT interface using the puzzlepiece framework.
Example usage (see Getting started for more details on using Pieces in general):
import puzzlepiece as pzp
from pzp_hardware.thorlabs import apt_stage
app = pzp.QApp()
puzzle = pzp.Puzzle(debug=False)
puzzle.add_piece("stage", apt_stage.Piece, row=0, column=0)
puzzle.show()
app.exec()
Installation
Install the APT Software from https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=9019
Locate the
APT Serverfolder in the APT installation directory (usuallyC:\Program Files\Thorlabs\APT\APT Server) and copy its path.When running the Piece for the first time, you will be asked for the DLL directory - provide the one you copied above.
Requirements
This Piece has additional requirements. You will be asked to install them at runtime, or you may choose to install them ahead of time.
thorlabs_apt –
pip install thorlabs-apt
Troubleshooting
If APT or your application crashes while connected to a stage, subsequent attempts to load APT will likely crash. To fix this, you can:
Restart the affected stages
Restart the affected computer
Use the Kinesis software to perform a quick fix (the fastest method, but requires additional software):
Install Kinesis from https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=10285
Close any instance of APT
Launch Kinesis and wait for it to fully load and detect the stages
Close Kinesis
APT should work normally now!
Note that there can only be one isntance of the APT server running at any time. If you are connected to a stage in this Piece and would like to use APT in another application, disconnect from the stage in the Piece. If you are not connected to a stage, you can still release APT from the puzzlepiece process by using this Piece’s Cleanup action (available from the Tree view, button at the bottom of the Puzzle or F1).