Page 1 of 1

Visual Studio supported languages

Posted: 15 Jun 2010, 08:23
by fapplin
This site says that the version 3 of BCI2000 will work in Visual Studio. Does this mean that other Visual Studio languages (such as Visual Basic or C#) can be used to tie into BCI2000?

Posted: 15 Jun 2010, 08:45
by mellinger
No. It means that BCI2000 version 3 may be compiled using the Microsoft Visual C++ compiler coming with Visual Studio.

Posted: 15 Jun 2010, 08:57
by fapplin
Could Visual Basic or Visual C# talk to the BCI2000 modules via DLL calls or any other means?

Posted: 17 Jun 2010, 08:52
by mellinger
The operator module has been separated into a functional core, which is provided as a DLL, and the GUI, which is an application linking against the DLL.

You could, in principle, write a GUI application in VB or C# that uses the DLL. For a documentation of the DLL's exported functions, see its header file at
BCI2000/src/core/Operator/OperatorLib/BCI_OperatorLib.h.

Posted: 17 Jun 2010, 09:45
by fapplin
Thanks. We have many experiments already written in C# that we are sending simple event codes to BioSemi with. We would like to try BCI2000 and see if we can do the same kind of things. Some of our experiments have people picking playing cards (like guessing at suits or color). So, our GUI is a little different than an experiment where you just display a picture for a specified period of time.

Do you know if anyone has done this, yet (using the DLL via VB or C#)?

Posted: 17 Jun 2010, 10:58
by mellinger
I'm not aware of anyone who has used the DLL from languages other than C++ so far.

Also, using the Operator DLL would not allow you to control stimulus presentation, or the event codes written into the BCI2000 data file. For this, you would need to modify an application module, which currently requires C++ coding.

Posted: 17 Jun 2010, 11:09
by fapplin
So, could we have our C# application communicate via TCP/IP to BCI2000?

Posted: 17 Jun 2010, 12:00
by mellinger
You can communicate with BCI2000 over UDP. For details, see
http://www.bci2000.org/wiki/index.php/T ... _Connector.

As an example, if your C# app is presenting stimuli, and BCI2000 is used for recording brain signals, the setup would be as follows:
Run an empty dummy app on the BCI2000 side, i.e. an application module that contains only the AppConnector filters.
The C# app would use the AppConnector protocol to set a StimulusCode state, indicating when stimuli have been presented, and which.

Posted: 17 Jun 2010, 12:07
by fapplin
Thanks. We'll try that.