python
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| python [2023/08/15 14:06] – make scripts downloadable brandon | python [2026/06/16 15:15] (current) – add section for pymmcore-plus brandon | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| --> Here is an example script:# | --> Here is an example script:# | ||
| - | **Last tested on Windows | + | **Last tested on Windows |
| This class manages the serial connection. | This class manages the serial connection. | ||
| Line 155: | Line 155: | ||
| def moverel(self, | def moverel(self, | ||
| """ | """ | ||
| - | self.send_command(f" | + | self.send_command(f" |
| self.read_response() | self.read_response() | ||
| def moverel_axis(self, | def moverel_axis(self, | ||
| """ | """ | ||
| - | self.send_command(f" | + | self.send_command(f" |
| self.read_response() | self.read_response() | ||
| def move(self, x: int=0, y: int=0, z: int=0) -> None: | def move(self, x: int=0, y: int=0, z: int=0) -> None: | ||
| """ | """ | ||
| - | self.send_command(f" | + | self.send_command(f" |
| self.read_response() | self.read_response() | ||
| def move_axis(self, | def move_axis(self, | ||
| """ | """ | ||
| - | self.send_command(f" | + | self.send_command(f" |
| self.read_response() | self.read_response() | ||
| def set_max_speed(self, | def set_max_speed(self, | ||
| """ | """ | ||
| - | self.send_command(f" | + | self.send_command(f" |
| self.read_response() | self.read_response() | ||
| def get_position(self, | def get_position(self, | ||
| """ | """ | ||
| - | self.send_command(f" | + | self.send_command(f" |
| response = self.read_response() | response = self.read_response() | ||
| return int(response.split(" | return int(response.split(" | ||
| Line 186: | Line 186: | ||
| def get_position_um(self, | def get_position_um(self, | ||
| """ | """ | ||
| - | self.send_command(f" | + | self.send_command(f" |
| response = self.read_response() | response = self.read_response() | ||
| return float(response.split(" | return float(response.split(" | ||
| Line 252: | Line 252: | ||
| - | Note: Make sure you enter the correct COM port and baud rate in the constructor for the MS2000 class. | + | **Note:** Make sure you enter the correct COM port and baud rate in the constructor for the MS2000 class. |
| Line 304: | Line 304: | ||
| <-- | <-- | ||
| - | \\ | + | ==== Via pymmcore-plus ==== |
| - | ==== Via Pycro-Manager | + | |
| - | See [[https://pycro-manager.readthedocs.io/en/latest/|Pycro-Manager]] documentation. | + | See the [[https://github.com/pymmcore-plus/pymmcore-plus|pymmcore-plus GitHub page]] for information. |
| - | Micro-Manager which has excellent support for ASI devices built in. Using Pycro-Manager is especially valuable if you also have non-ASI devices | + | This library wraps pymmcore and adds additional features like an acquisition engine. This gives you access |
| + | ==== Via pycro-manager ==== | ||
| + | |||
| + | See the [[https:// | ||
| + | |||
| + | Micro-Manager which has excellent support for ASI devices built in. Using pycro-manager is especially valuable if you also have non-ASI devices to control that are supported in Micro-Manager. | ||
| + | |||
| + | This requires you to run a Micro-Manager instance in the background and connect to it through a socket. There is also a headless mode where you don't have to open the ui. | ||
| {{tag> python serial}} | {{tag> python serial}} | ||
Address: 29391 W Enid Rd. Eugene, OR 97402, USA | Phone: +1 (541) 461-8181
python.1692122765.txt.gz · Last modified: by brandon
