1. Quick Start

PyMoDAQ installation on Windows is done in a few steps. We just need an internet connexion.

1.1. Python installation

We first need to download the Miniconda installer by clicking on the link highlighted in red in the following figure.

_images/miniconda_installer_link.png

Fig. 1.1 Click on this link to start the download of Miniconda’s installer.

Let’s execute the installer and keep the default choices.

Note

It will actually install in particular:

  • a Python interpreter (a python.exe file)

  • conda

  • pip

1.2. Set up a new Python environment

From the Windows Start menu, execute the Anaconda Prompt.

_images/miniconda_prompt.png

Fig. 1.2 The Anaconda Prompt. The name in brackets at the beginning of the line indicates the Python environment that is currently activated. (base) indicates that we are in the default environment of conda.

In order to have a clean installation of PyMoDAQ on our machine, we isolate it in a dedicated Python environment. Let’s execute the following command to create an environment called pymodaq with a 3.11 version of Python.

conda create -n pymodaq python=3.11

Note

  • We can call the environment as we wish.

  • As a rule of thumb, choose the second last version of Python to be sure that PyMoDAQ is compatible.

And let’s activate it.

conda activate pymodaq

After this command, we should notice that the name in brackets in the terminal is now pymodaq.

1.3. Install PyMoDAQ

After this preparation, the installation of PyMoDAQ is done with a single command line. It takes a few minutes to download and install all the dependencies in our new environment.

pip install pymodaq pyqt5

Note

For more details about the installation, see Tips/Issues for installation

1.4. Check the installation

To check that the installation went well, we can execute a PyMoDAQ’s control module called DAQ_Move, using the command

daq_move

This prompts the following user interface. In the Actuator drop-down list, choose Mock and click Initialization. This will simulate numerically the behavior of a simple actuator, with the reading of its position.

_images/mock_actuator.png

Fig. 1.3 The DAQ_Move module.

The basic installation is now complete! :)

Note

For more details about the loading PyMoDAQ modules, see Loading modules

1.5. Control a real instrument

In principle, PyMoDAQ can control any instrument. However, each specific hardware needs a supplementary package to be compatible with it, which we call an instrument plugin.

1.5.1. List of supported instruments

Numerous plugins are already available for common scientific equipment suppliers, they are referenced in the list of supported instruments.

_images/supported_instruments_list.png

Fig. 1.4 List of supported instruments.

We can access it from the Supported instruments link on the left menu of this website.

1.5.2. Install the software of the supplier

To illustrate concretely the procedure, we suppose that we want to control a Thorlabs Zelux camera.

_images/zelux_camera.png

Fig. 1.5 A Thorlabs Zelux camera.

This camera is controlled with the ThorCam software that is provided by Thorlabs. Let’s download and install it.

image/quick_start/thorcam.png

Fig. 1.6 The webpage to download Thorcam.

Once it is installed, connect the camera and check that it is working.

Warning

It is crucial to first check that your instrument can be controlled with the supplier’s software before trying with PyMoDAQ.

1.5.3. The Plugin Manager

Once we have checked that our camera is working, we know that the supplier’s drivers, if any, are installed, and that the communication between our camera and our computer is working. It is now time to control it with PyMoDAQ.

We have seen that the Thorlabs plugin manages this type of camera.

image/quick_start/supported_instruments_list_thorlabs.png

Fig. 1.7 The Zelux camera is supported by the Thorlabs plugin.

In this case, we just have to install the Thorlabs plugin in our environment. To do so, we will use the Plugin Manager by executing the following command in our terminal

plugin_manager

A window is displayed to easily install the plugin.

image/quick_start/plugin_manager.png

Fig. 1.8 The Plugin Manager interface.

Note

We can skip the use of the Plugin Manager interface by using directly in the terminal pip install pymodaq_plugins_thorlabs.

After the plugin installation, we launch a DAQ Viewer with the following command

daq_viewer

Warning

Let’s not forget to disconnect the camera from ThorCam or any other program before trying to communicate with it.

We then have to select the correct DAQ type (here 2D because the detector outputs a matrix of pixels) (1), the corresponding plugin (2), the specific camera through its serial number (3), initialize the communication with the camera (4), and get a snapshot (5).

_images/quick_start_image_thorlabs.png

Fig. 1.9 Snapshot from a Thorlabs camera equipped with an objective, in a DAQ Viewer.

1.5.4. What if our instrument is not already supported?

If the instrument we want to interface is not in the list, we should firstly ask for advices from the PyMoDAQ community. The most efficient way to do so is to raise an issue on GitHub. Let’s describe our project, the instrument we want to interface… We will probably get some help there!

Secondly, we can consider to develop a plugin by our own. It is not that difficult, and a lot of documentation is available to help us step by step:

We should also have a look at external Python driver libraries, the communication with our instrument may already be implemented there:

1.6. Synchronize our instruments

Once all the instruments of our experimental setup are controlled with a dedicated control module, the most difficult task is behind us.

We can now group them in a Dashboard, and enjoy all the features available through the Dashboard Extensions. The DAQ Scan extension is the first one to consider, as it meets the needs of any experiment that consists in scanning automatically one or several parameters and save the detector’s output.

1.7. Organization of the documentation

The basic use of PyMoDAQ, that do not need any coding, is documentated in the User’s Guide.

The Tutorials address specific questions about PyMoDAQ, but also about the Python ecosystem and useful tools for open-source development. As PyMoDAQ is not a library for developers but for experimental physicists and teachers, we find relevant to introduce those tools from scratch. The tutorials are of various difficulties that are indicated at the beginning of the page.

We wish you a good experience :)