Example Code

Emotiv EEGlogger sample program with LabVIEW

Code and Documents

Attachment

I replaced  example5: EEGlogger in Emotiv SDK  with an example vi by making a new dynamic link library.

For building the dynamic link library: Labview_emotivEEG3.dll and the example vi : Emotiv_labviewEEG3.vi, I used  vc2008 express and LabVIEW2010 Fall 2010.

Before  starting Emotiv_labviewEEG3.vi, please change the data file path in the Emotiv_labviewEEG3.vi as you like it.

Please put edk.dll and edk_utills.dll  in the same folder  including Labview_emotivEEG3.dll.

User number of the first dialog in Emotiv_labviewEEG3.vi must be 0.  In the Emotiv_labviewEEG3.vi given by the Labview_emotivEEG3.dll,  the user number  is fixed as 0,

because  of  making the program easily.

I also upload new version of  Labview_emotivEEG3english : Labview_emotivEEG3_spread_sheet2  such that  Emotiv_labviewEEG3_spread_sheet2.vi  writes EEG data to a spread sheet

and it is made without flat sequential structure. For building the dynamic link library: Labview_emotivEEG3.dll and the example vi :  Emotiv_labviewEEG3_spread_sheet2.vi,

I used  vc2008 express,  LabVIEW2011 sp1 Spring 2012, and Windows7.

Someone reported the sample program install result as follows:

After changing the data file path to one of the 3 .dll in the Debug folder (Labview_emotivEEG3.dll, edk.dll, edk_utils.dll),

he could not progress running the VI. It seems that because of language problem (japanese to occidental),

the functions called in call library function must be changed (either the function name, in which sometimes "?" symbols appear or the function prototype).

he knows it's a little of work, but, could you translate to the correct names? Also, which data file path must be Labview_emotivEEG3.dll or the other .dll for each library call?

Hope to be able interfacing correctly with labview.


I really thank him for his feedback.

I tried opening the VI on a different PC with Japanese LabVIEW installed, and the "?" symbols appeared here as well.

It seems this is not a language problem, but a problem with path settings of the DLL.

The "Call Library Function Node" settings have an absolute path of:

C:\Documents and Settings\hideaki\デスクトップ\Labview_emotivEEG3english\Labview_emotivEEG3\Debug\Labview_emotivEEG3.dll

This folder does not exist on his PC, so the function prototype has a "?" in front.

Once he selects the proper path for the DLL, the "?" should go away.

I changed the VI so that it looks for the DLL in C:¥LabVIEW_emotiv_EEG3.

Please extract the contents of the updated ZIP file into C:¥LabVIEW_emotiv_EEG3.

This way, you will have the same folder structure as mine.

In addition I also changed the new version VI so that it looks for the DLL in C:¥LabVIEW_emotiv_EEG3_spread_sheet.

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

Comments
mlt
Member
Member
on

Hello,

I'm trying to find a way to connect the emotiv headset with LabView. I downloaded your example vi, but I cannot seem to get it to run. You have comments beside your coding, but they are all in gibberish, I'm assuming they were either in Japanese and are not loading right for me, or perhaps you wrote them in a different text encoding?

Any thoughts on how I can view your comments? They won't load right for me, and I would really like to give your vi a try!

Thanks,

Mariko

hideok34
Member
Member
on

Dear Mariko

I read your e-mail and thought the content carefully.
As your guess, I used Japanese version and wrote English label in the example vi.
Unfortunately I did not care about the character code of the label.
I think the character code problem causes your gibberish problem.
In my example vi, I mainly used Call library function nodes that link to the corresponding functions in the Labview_emotivEEG3.dll, and did not write any comments in the vi.
The dynamic link library of the Emotiv is very sensitive, and depends on the visual studio 2008 c++ library, the corresponding frame work version. In fact, in the computer where  visual studio 2010 c++ is installed, Emotiv sdk does not work.   I recommend to rebuild Labview_emotivEEG3.dll by using visual studio 2008 c++ and reassign the directory of  all  Call library function nodes by using the directory of the rebuilt Labview_emotivEEG3.dll.

hideok34
Member
Member
on

Hi, dsy

Emotiv Emostate and EEGlogger sample with LabVIEW

https://decibel.ni.com/content/docs/DOC-22735

is the most excellent software of mine.  Please use this sample, read carefully the settings, and name the different filenames for emostate and EEGlogger data files.

Contributors