Example Code

Emotiv Example for Reading EEG Commands

Code and Documents

Attachment

Overview

Use the Emotiv headset and communicate with the control panel in the Emotiv software to read Congitiv actions.

Description

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, Emotivional states, Headset data like the gyro, and trained Cognitive actions.

More information, including the required Application Programming Interface (API) can be found here: https://decibel.ni.com/content/docs/DOC-18059

Steps to Implement or Execute Code

  1. After installing required software (see below), open the attached "Cognitiv Actions-Control Panel.vi"
  2. Run the VI
  3. If prompted, browse to a save/load location for the Profile
  4. You can now read actions from the Emotiv headset

Requirements to Run

Software

LabVIEW 8.6 or above (LV 8.6 through 2012 at time of edit)

VI Package Manager by JKI: http://jki.net/vipm/download

Emotiv disk shipped with headset: http://www.emotiv.com/store/sdk/edition/sdklite/

Emotiv Toolkit for LabVIEW: https://decibel.ni.com/content/docs/DOC-18059 (also linked above)

Hardware

Computer with USB port

Emotiv Headset* http://www.emotiv.com/store/hardware/epoc-bci/epoc-neuroheadset/

Saline solution (eye-contacts solution)

*Note

You can also use a simulated headset for software development purposes. Details can be found here: https://decibel.ni.com/content/docs/DOC-18059 (also linked above)

Additional Images

Block Diagram

EmotivControlPanelExample.png

- Regards,

Beutlich

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

Comments
Abuzer619
Member
Member
on

i am trying to run this program but with no success. i have the emotiv toolkit for labview. what other things i will need?

Beutlich
Member
Member
on

You need LabVIEW, and you will need the driver software from Emotiv. You can use an SDK that is free. Each software driver for the Emotiv exposes additional functionality, and is expensed at different rates.

Do you have the EPOC Control Panel open and working? You should get this panel working with the headset first, and then try programming the headset.

- Regards,

Beutlich
Abuzer619
Member
Member
on

i have labview and emotiv research edition and my epoc control panel is working with the headset. now i want to display the output in labview. i input the edk.dll file in labview. what other files i have to input? can u mail any labview vi that only displays signals from emotiv headset?

Beutlich
Member
Member
on

This particular example that you commented on is for Cognitiv Actions, which require that a User Profile is generated already by training a User through the Front Panel. If you have not already trained with the headset, you may try a simpler example to verify proper operation, like: https://decibel.ni.com/content/docs/DOC-18060

I never had access to the research edition, so I never was able to generate VIs for the research specific functions like the individual sensor signals. The process of adding the research specific functions to the VIs involves wrapping the DLL headers correctly to upgrade the toolkit. What is your application? What do you want to do with the headset?

- Regards,

Beutlich
Beutlich
Member
Member
on

I hope you had a good Thanksgiving! Are you still working on this? Any questions I haven't addressed?

- Regards,

Beutlich
Abuzer619
Member
Member
on

I got it done. Thanks a lot for your help.

schwiean
Member
Member
on

I'm trying to use LabVIEW to read cognitive actions, and my code looks similar to the screen shot above.  However, I keep getting an error at the EmotivStartTask.vi.  The initial error from the main block diagram says that there was an issue connecting to the GPIB device.  When I went into the subVI, there was a point that it said there was an invalid task.  Do you have any ideas as to what the issue may be?  Thanks!

h.samadi
Member
Member
on

Hi to all

I want to find four direction (left, right,front,back) via Emotiv EPOC headset and labview

I use emoComposer and use of look right and look left for test program

but it don't work, anyone can help me.

ReadDirection.JPG

thanks

sam

PatriciaBc
Member
Member
on

First thanks for sharing this example, I'm doing research and helped me a lot.

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 different frequency bands 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 error in my program ?

I hope you can help me

Thank you

Contributors