> For the complete documentation index, see [llms.txt](https://zapit.gitbook.io/user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zapit.gitbook.io/user-guide/installation-and-setup/software-setup.md).

# Software setup

These instructions assume you have already assembled the hardware, wired the DAQ, aligned the laser, etc. &#x20;

#### MATLAB

Zapit has been tested on MATLAB R2022a and R2022b and it should work on more recent versions also. It may work on earlier versions but this has not been tested. The latest version of MATLAB is recommended. You will need a PC with at least 16 GB of RAM.&#x20;

#### MATLAB Toolboxes

You will need the following MATLAB ToolBoxes.&#x20;

* [Image Processing Toolbox](https://www.mathworks.com/help/images/index.html)
* [Image Acquisition Toolbox](https://www.mathworks.com/products/image-acquisition.html)
* [Curve Fitting Toolbox](https://www.mathworks.com/help/curvefit/) (used for calibrating power on non-linear lasers. Not needed for Obis)
* [Instrument Control Toolbox](https://uk.mathworks.com/products/instrument.html) (optional: use for TCP/IP comms)

#### DAQ Drivers

* Install NI [DAQmx](https://www.ni.com/en-gb/support/downloads/drivers/download.ni-daqmx.html) and ensure you have checked to install **with .NET support enabled**. Ideally install one of our tested versions: 19.0 to 21.8.

#### Camera Drivers

Zapit currently supports only Basler cameras (although in principle this can be extended to other cameras). You will need to:

* If not done already, install [Basler's Pylon](https://www.baslerweb.com/en/downloads/software-downloads/#os=windows;version=all;type=pylonsoftware;language=all) [Camera Software Suite Windows](https://www.baslerweb.com/en/downloads/software-downloads/software-pylon-7-2-1-windows/). Choose the Developer option during installation and your connection type (probably USB). Plug in your camera into a USB3 port and confirm it is detected and runs using the software.&#x20;
* Install the [Image Acquisition Toolbox Support Package for GenICam Interface](https://uk.mathworks.com/matlabcentral/fileexchange/45180-image-acquisition-toolbox-support-package-for-genicam-interface). Either from that link or, better yet, via the[ Add-On Manager](https://uk.mathworks.com/help/matlab/matlab_env/get-add-ons.html) accessible via **Home** > **Add-Ons** on the MATLAB ribbon.&#x20;

You will need to restart MATLAB after the camera driver has been installed. If you later encounter problems connecting to the camera in MATLAB, see [Basler's instructions for the GenICam interface](https://www.baslerweb.com/en/downloads/document-downloads/using-pylon-gentl-producers-for-basler-cameras-with-matlab/).<br>

#### Installing Zapit

Gather and install the above requirements then install Zapit in one of the following ways:

* *Via MATLAB*: Go to the **Apps** ribbon in MATLAB and click on **Get More Apps**. Search for Zapit and add it to MATLAB. This is recommended.
* *Via your browser*: Navigate to the [Zapit File Exchange page](https://uk.mathworks.com/matlabcentral/fileexchange/122142-zapit). Download. Unpack in a reasonable place. Add the  `zapit` directory (i.e. that which contains `start_zapit.m`) to your path. You need add only this directory, not it and all sub-directories.
* *Via Git*: Clone [the repo](https://github.com/Zapit-Optostim/zapit) in your favourite Git client. Add the  `zapit` directory (i.e. that which contains `start_zapit.m`) to your path. You need add only this directory, not it and all sub-directories.

You will need to configure Zapit before it can be started.&#x20;
