BCI2000 and e-Prime

Forum for software developers to discuss BCI2000 software development
Locked
Mabi
Posts: 7
Joined: 18 Jun 2013, 11:11

BCI2000 and e-Prime

Post by Mabi » 21 Jun 2013, 07:17

Hi,
Here I have an e-Prime application which is now connected to NetStation and sends to it trial,direction of movement and frequency,I can see these data in my external application which is written in Java.Now I want to send these data to BCI2000 but I don't know how I should use it in BCI2000.
Do I need this external application which is in Java and here I suppose it as an intermediate program between e-Prime and BCI2000?
Shall I use BCI2000Remote Interface? If yes,would you please say how?

Best Regards
Mabi

mellinger
Posts: 1210
Joined: 12 Feb 2003, 11:06

Re: BCI2000 and e-Prime

Post by mellinger » 24 Jun 2013, 11:42

Hi,

in order to make a suggestion, I will need to understand what you are trying to do, which is difficult from the information you provide.

AFAIK, NetStation is a data acquisition software provided by EGI. So e-Prime sends some information to NetStation, I guess this is because you want it to be recorded in the data file, right? In addition to that, you have a Java program that is able to receive that data, and display it. How does the Java application receive that data, and from where? From e-Prime, or from NetStation?

Now when BCI2000 comes in, does it replace NetStation? Do you intend to send data from e-Prime to BCI2000 for the purpose of recording, or in order to control BCI2000? Would you like to use e-Prime for stimulus presentation, and BCI2000 for recording, and online processing? Would e-Prime need to receive processing results from BCI2000?

Regards,
Juergen

Mabi
Posts: 7
Joined: 18 Jun 2013, 11:11

Re: BCI2000 and e-Prime

Post by Mabi » 24 Jun 2013, 12:16

Hi,
thank you for your reply.
AFAIK, NetStation is a data acquisition software provided by EGI. So e-Prime sends some information to NetStation, I guess this is because you want it to be recorded in the data file, right?
for now I want to use BCI2000 and not any more NetStation.
In addition to that, you have a Java program that is able to receive that data, and display it. How does the Java application receive that data, and from where? From e-Prime, or from NetStation?
In my Java application I received some data (like timing,frequency and motion type according to my e-Prime application) from e-Prime and now I sent these data to BCI2000,but I don't know how to use these data in BCI2000.
Now when BCI2000 comes in, does it replace NetStation? Do you intend to send data from e-Prime to BCI2000 for the purpose of recording, or in order to control BCI2000? Would you like to use e-Prime for stimulus presentation, and BCI2000 for recording, and online processing? Would e-Prime need to receive processing results from BCI2000?
As you mentioned I want to use e-Prime to provide stimulus and BCI2000 for recording and online processing and e-Prime will need to receive processing results from BCI2000.
Best Regards
Mabi

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

Re: BCI2000 and e-Prime

Post by gschalk » 24 Jun 2013, 16:56

Why don't you use BCI2000's StimulusPresentation module instead of ePrime?

Gerv

Mabi
Posts: 7
Joined: 18 Jun 2013, 11:11

Re: BCI2000 and e-Prime

Post by Mabi » 25 Jun 2013, 06:18

Hi,
I need to send some information which comes from different programs in e-Prime.
Regards,
Mabi

mellinger
Posts: 1210
Joined: 12 Feb 2003, 11:06

Re: BCI2000 and e-Prime

Post by mellinger » 25 Jun 2013, 07:24

Hi,

so it seems you don't need the Java application any more. Instead, you may open a TCP connection to the BCI2000 operator module's Telnet server, and send Operator Scripting commands through that connection. Use ADD EVENT and SET EVENT in order to record your external information into BCI2000 data files.
To read BCI2000's processing results, you may either poll the signal using GET SIGNAL(1,1), or use WATCH SIGNAL(1,1) to send signal changes to a UDP port, and read it from there from ePrime. The second method is more reliable but also more difficult to implement -- the first method is simpler, but you may lose some signal values if polling is too slow.

If ePrime allows you to call functions from DLL, then you might consider using BCIRemoteLib, which is a wrapper around such a TCP connection, so you don't need to deal with the connection itself.

HTH,
Juergen

Mabi
Posts: 7
Joined: 18 Jun 2013, 11:11

Re: BCI2000 and e-Prime

Post by Mabi » 02 Jul 2013, 11:20

Hi,
thank you for your reply,
I opened a TCP connection to the BCI2000 operator module's Telnet Server,now I want to specify scripts command through this connection.I new that BCI2000Remote class has two methods "SetScript" and "GetScript". Shall I use these methods and if Yes,how? or just type commands in preferences dialog box in operator module?
for now I typed command
-ADD EVENT Artifact 1 0
in On Suspend textbox
and also
SET EVENT Artifact 1
SET EVENT Artifact 0
separately in function button part
and after running and click on Suspend button I faced this error:
Script error: Could not add event Artifact to list outside idle state
and according to what I read http_nospam_www.bci2000.org/wiki/index. ... _on_States
event is used in idle state while I want to mark each block of brain data with external information as soon as I received it.Shall I use events or just states?

Best Regards,
Mabi

mellinger
Posts: 1210
Joined: 12 Feb 2003, 11:06

Re: BCI2000 and e-Prime

Post by mellinger » 02 Jul 2013, 11:31

I new that BCI2000Remote class has two methods "SetScript" and "GetScript". Shall I use these methods and if Yes,how?
How can you use methods of the BCI2000Remote class? Are you programming in C++, or in Java?

Mabi
Posts: 7
Joined: 18 Jun 2013, 11:11

Re: BCI2000 and e-Prime

Post by Mabi » 03 Jul 2013, 10:57

Hi
I wrote a piece of code in C++ according to what I read http_nospam_www.bci2000.org/wiki/index. ... 2B_Example and could run BCI2000 from my code and also this piece of code receives the needed information from e-Prime,Now as you have said:
Use ADD EVENT and SET EVENT in order to record your external information into BCI2000 data files.
I want to ADD EVENT and SET EVENT,I did it in OnConnect handler and OnSuspend handler, in two ways,both in my code and using SetScript() function and also in preferences window
and in both ways I faced this error:
Could not add event Freq to list outside idle state
would you please give me more guide line?
Best Wishes
Mabi

mellinger
Posts: 1210
Joined: 12 Feb 2003, 11:06

Re: BCI2000 and e-Prime

Post by mellinger » 04 Jul 2013, 07:48

Hi,

the SetScript() and GetScript() methods correspond to the SET SCRIPT and GET SCRIPT scripting commands. I don't think you would want to use those.

There are no wrapper functions for ADD EVENT and SET EVENT. Instead, use the generic Execute() method, which allows you to execute arbitrary commands:
b.Execute( "ADD EVENT blubb 32 0 0 0" );

Note that you need to add events before modules are connected, this is why you cannot call this command from an OnConnect handler.

Regards,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 24 guests