Example Code

LabVIEW Emotiv Toolkit V2

Code and Documents

Attachment

Emotiv Brain Computer Interface

The Emotiv headset is a wireless EEG system that measures brainwaves and allows programmers to use brain activity in their application. The basic API allows you to access Facial gestures, Emotional states, Headset data like the gyro, and trained Cognitive actions. While the Research, Education and Enterprise Plus SDK allows access to the raw EEG data.

LabVIEW Emotiv Toolkit V2 package is based on LabVIEW Emotiv Toolkit by Eric Beutlich. It adds the capability of acquiring raw EEG data from the Emotiv headset and writing markers to the headset.

LabVIEW Emotiv Toolkit V2 also integrates examples to Plot and Save as CSV files the raw EEG data


Note:

In order to obtain the raw EEG data, Research, Education or Enterprise Plus SDK is necessary.

Instructions.

1. Install the Emotiv software

2. Localize the edk.dll, this path will be used for toolkit

(something like C:\Program Files\Emotiv Development Kit_v1.0.0.0-LITE\edk.dll for LITE version)

(something like C:\Program Files\Emotiv Enterprise Plus Edition SDK_v1.0.0.5-PREMIUM\edk.dll for Enterprise Plus version)

3. Download the package Emotiv Toolkit for LabVIEW V2 (below) and installed using VI Package Manager 2014

4. For plotting raw EEG data try the example "Plot EEG data.vi" installed with the package in

<Labview>\examples\NI\Emotiv Toolkit\Emotiv Examples\Emotiv Read Raw Data Examples


Screenshot 2014-12-03 15.33.59.png


Software you will need:

  • LabVIEW 2013 or above
  • VI Package Manager 2014 by JKI

          http://jki.net/vipm/download

  • Emotiv software

          https://emotiv.com/store/product_262.html

  • Emotiv Toolkit for LabVIEW V2 (below)
Raymundo Cassani

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Edcrupa
Member
Member
on

Hi!,

Nice work but I´m trying to run the "Plot EEG data vi" without success. I get the error code 12 in the "Emotiv Create Task. vi". I am using labview 2013 (64 bit),  Windows 7 and Emotiv Research Edition, also I select the correct edk.dll path. Someone has any suggestions?. Thank you!

rCassani
Member
Member
on

Hi Edcruzpa,

Check these links:

http://forums.ni.com/t5/LabVIEW/Error-12-using-a-32Bit-in-LabVIEW-64bit/m-p/1784776/highlight/true?l...

http://digital.ni.com/public.nsf/allkb/6059E812DFC60ED486257640007B5DAF


http://forums.ni.com/t5/LabVIEW/Talk-to-a-32-bit-DLL-file-using-a-VI-in-64-bit-LabVIEW/td-p/2450358

Summary: You cannot use 32-bit DLLs in LabVIEW 64-bit. Fortunately, as you own LabVIEW 64-bit, you can download the 32-bit version corresponding to your 64-bit version and use the same serial number to activate it

Raymundo Cassani
Edcrupa
Member
Member
on

thank you rCassani 🙂 !

optimaxch
Member
Member
on

hi rCassani

this is a very nice program, but unfortunately i have "black screen" -nothing happens.

i use the sdk lite 2

i installed labview 2014 / 32bit on a win 7 / 64 bit machine.

actually the edk.dll is there twice in installation directory - tried both no help.

   any idea?

    thank you and greetings

    rudolf

rCassani
Member
Member
on

Hi Rudolf,

You are not acquiring EEG signals from the headset, becuase: the SDK Lite 2 does not have access to the raw EEG.

You need the edk.dll included in Emotiv Researcher Edition, Education Edition or Enterprise Plus Edition to have access to raw EEG

Raymundo Cassani
optimaxch
Member
Member
on

thank you

all the best!

rudolf

alejandropachec
Member
Member
on

Hi!

I´m trying to run the example but I can´t because some errors appear. I think that I need a special library because I have the same message in every error . I would be very grateful if anyone could help me.

Captura.JPG

rCassani
Member
Member
on

Hi Alejandro,

Can you verify the lvclass in the path:

C:\Program Files (x86)\National Instruments\LabVIEW 2013\vi.lib\NI\Emotiv Toolkit

You should be able to see those files like in the image:

Screenshot 2015-03-27 13.25.07.png

Raymundo Cassani
alejandropachec
Member
Member
on

Ok I didn´t have those files there. Thank you rcassani !!

Now I have two errors that have the same message again. Any idea?

Captura.JPG

EmilianoCs
Member
Member
on

Hi! I am trying to use the ToolKit and i am using the edk.dll of the Emotiv Control Panel not the SDK Lite. So the Toolkit only works with the SDK Lite, but, the SDK Lite only works with EmoComposer. In that case there is no way to connect the Emotiv Headset if i don't have the SDK Premium?

rCassani
Member
Member
on

Hi EmilianoCs,

Please note that this toolbox only works with the SDK versions that allow raw EEG access (Research, Education and Enterprise Plus)

Raymundo Cassani
mahonri
Member
Member
on

Hey,

Hopefully this is a place I can still ask questions. I have the same problem as alejandro (above). I have all the files rcassani mentioned but they are here

C:\Program Files (x86)\National Instruments\LabVIEW 2015\vi.lib\NI\Emotiv Toolkit

Labview just posts errors when I try to run it

rCassani
Member
Member
on

Hi mahonri,

What errors do you get?

Raymundo Cassani
mahonri
Member
Member
on

2.jpg

mahonri
Member
Member
on

I was given a bunch of things to download from my supervisor on a usb all at the same time and the toolkit was part of it.

I hope the info Iam giving helps.

here is the contents of the toolkit.1.jpg

mahonri
Member
Member
on

Thankyou rCassani. I had the wrong toolkit! The problem was solved by uninstalling the toolkit package and installing the latest version.

PatriciaBc
Member
Member
on

Hi, i'm working with EEG signal and your comment was interesting for me. I download and connected the SWs (VI manager, Emotiv Toolkit, labview)  everything right here and when run the program anything happend. We don't have developer or student SDK just control panel V2, my question is: Is possible to connect v2 with labview and to receive EEG signal? 

Thank you!

pomanh_mon
Member
Member
on

this program saved me, however I don't want to save the data to a .csv, I want to save it to .edf formate .... like the testbench does . Please rCassani can you help me in that ?

rCassani
Member
Member
on

Hi PatriciaBc,

Unfortunately, if you don't have Research, Education or Enterprise Plus SDK you cannot use this toolkit to obtain raw EEG data

Raymundo Cassani
PatriciaBc
Member
Member
on

Thanks for answering, and you can run the program. I have another question I hope you can help me.

After obtaining the signals with Emotiv, I added a section to acquire the frequency bands of each channel but it is possible that when  get the results in frequency bands the ranges out different?. The ranges of frequencies are delta (0 -4 Hz), theta (4-7), alpha (8-12), beta (12-30) and gamma (30-100 Hz), my simulation results are for example alpha 4, theta 9 , delta 5, it is possible  or something is in mistake in my program ?

I hope you can help me

Thank you

rCassani
Member
Member
on

Hello PatriciaBc,

I'm glad to hear this toolbox helped you to obtaine EEG signals.

Frequency band features go beyond the scope of this document, you can send me an Private Message

Raymundo Cassani
yenylm14
Member
Member
on

Hi.

Somebody knows how can I download and install the SDK lite, is because the program doesn't exist in the page of Emotiv? (I have labview 2013 windows 8, 64bits)

Is possible to have the raw signal with the Emotiv SDK Research Edition?

Thanks.

tj1210485
Member
Member
on

Hi.

I use this toolbox to obtain EEG signals from EPOC+. But the data are different from the data of PUREGG. Can you help me?

EEGDATA.jpg

Laila.qa
Member
Member
on

Thanks  rCassani for this helpful example.

- I am working on Row EEG, and wanted to ask if it possible to read the row data from a file instead of acquiring it directly from the headset. 

- Also is it possible to choose certain channels to acquire from them instead of acquiring from the whole channels, I only need 8 channels out of the available 14, and I changed the channel type def. that contains the name of all channels to only the needed 8 channels, however I am not sure if this will affect the result  of acquiring. 

- Also, in the code, a constant 4000 were subscribed from the channels results before displaying them on the waveform chart (shown in the picture below), and I was wondering what is the purpose of this step.

 

capture from the code.PNG

Many thanks again.

looking forward to the answers.

 

 

Contributors