Skip to content

2. Getting Started

biodaq edited this page Jul 5, 2024 · 24 revisions

Installation

It is recommended to use the latest release. You find it here: Latest telease on github

You will find the *tar.gz for linux and the *.zip version for Windows.

linux

Unzip the downloaded archive into a folder of your choice and open a command prompt in this directory. You will need the administrator password to install the drivers.

bash install.sh

install.sh installs part of the SDL2 lib and give you access rights to the hardware from user space.

Windows

No installation is necessary. The DLL must only be accessible from the respective application. In the simplest case, the DLL contained in the archive is copied to the directory where the application is stored.

You may also consider to register the DLL in the system. The DLL is then accessible system-wide and a copy of the DLL in the respective start folder of the application is not necessary.

C und C++

The /share/C folder of the archive contains sample files for the C programming language.

You will find further information in the readme.md file.

Python

the easy way

If you only want to use python with biovision digitizers, no installation of drivers is neccessary. You only need a package of python (Pypi.org) Install in terminal:

pip install multidaq

This package needs numpy. pip will automaticly install numpy, if you did not before. you may test the installation now in python console:

import multidaq
print(multidaq.multiDaq().listDevices())

The output should be a list of strings describing the detected ports. if none is connected you see only an empty list ("[]").

launch demos: Open a terminal in the unpacked archive and launch the python scripts as usual. (e.g. "python demo1.py" in Windows console)

Note

linux specific:
if you did not install the drivers via install.sh (--> installation):
you need rights to access the devices and a installed SDL2 lib.
There are at least 3 ways to get the rights. Method 3 is the safest.

  1. Be administrator or open python with sudo, you have all rights.
  2. Add yoursel to dialout group: Open a terminal and enter following command with your <username>.
    sudo usermod -a -G dialout <your_username>
  3. Use udev: First download the file from github and copy to a system location:
    sudo cp 50-biovision-devices.rules /etc/udev/rules.d/50-biovision-devices.rules

SDL2 is widely used and probaly installed on your PC. If not, install at least:

sudo apt-get install libsdl2-2.0-0 libsdl2-ttf-2.0-0 libsdl2-image-2.0-0

manual install

You did not install multidaq per pip command and want to use C or matlab simultanously with the device. Then manual install is approbiate.

Note

linux specific: Driver must be installed for that purpose. (--> installation)

The /share/python folder of the archive contains the module folder multidaq and sample files for Python. This module is the central hub for communication with the DLL and must be accessible in the folder where your script is located. In the simplest case copy folder multidaq to your working folder.

multidaq requires numpy. If numpy is not installed, install it within a command prompt:

pip install numpy

That's it. Now you can use the driver from source. But you have to take care that version of DLL and version of multidaq.py are compliant. The big advantage is, that you may use the driver simultanously from C, matlab or whatelse.

Launch example

Open a command prompt in the /share/python folder of the archive. You may start for example

demo1.py:

python demo1.py

Some examples require the matplot library. (install within command prompt: 'pip install matplotlib')

Note

python uses the DLL stored in the multidaq folder and not the DLL stored in the installation folder (Linux: /usr/local/lib ). You may specify other locations (e.g. /usr/local/lib) of the DLL in python when creating the object.
for example:

import multidaq
dev1 = multidaq.multiDaqLowLevel("/usr/local/lib") # linux installation folder
dev2 = multidaq.multiDaq("c:/where/your/installation/is") # 

in windows you may use '/' or '\\'

Matlab/Octave

Note

linux specific: Driver already installed? You need them for matlab.

The /share/C folder of the archive contains example files for Matlab. The functionalities for Matlab are available in source and must first be translated.

Windows require the Mingw64 C compiler for Matlab, which can compile the required mex file from the code. Under Linux a GCC compiler is installed by default.

Important

Windows specific: install mex compiler
To install the compiler, use the Add-Ons menu.

  1. On the MATLAB Home tab, in the Environment section, click Add-Ons > Get Add-Ons.
  2. Search for MinGW or select from Features. If you only have the MinGW compiler installed on your system, the mex command automatically chooses MinGW. Go to the next step. However, if you have multiple C or C++ compilers, use mex -setup to choose MinGW.
    mex -setup
    

Compile Mex file

This step is the same for matlab and Octave. Change working folder in matlab/octave to the share/matlab folder of the unpacked archive. The file translate.m to compile the source file is there and the environment is ok.

translate

The mexfile is generated in this directory. To use it, copy to a location, where you need it.

Launch scripts

With the compiled mexfile you should be able to start the demo scripts there. The mexfile { the extension starts with .mex and may be longer e.g. *.mexw64 ( matlab on Windows ) }.
Note that the compiled file must be in path of matlab/octave or in the folder, where you start the script.

Note

Windows: If the DLL is not accessible system-wide, the DLL must first be copied to the working directory. if not, open a command prompt in the /share/python folder of the unpacked archive:

copy ..\..\bin\biovisionMultiDaq.dll .

Clone this wiki locally