"Config" and "Set Config" disabled when running my own ADC

Forum for software developers to discuss BCI2000 software development
Post Reply
minguillon
Posts: 5
Joined: 10 Oct 2016, 18:43

"Config" and "Set Config" disabled when running my own ADC

Post by minguillon » 18 Oct 2016, 06:04

Hello,

I used the NewBCI2000Module to create a template to build my ADC. The problem appears when I include any call to any imported function of my ADC API (dll): the compilation is OK but "Config" and "Set Config" options are disabled in BCI2000 operator. If I build the .exe file wihout calling any function of the API (with API functions imported) these options are enabled.

I'm using BCI2000 compiled from source code with Win64 and VS11 express. The API dynamic library was compiled with Win64 and VS14.

Thank you in advance.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by pbrunner » 18 Oct 2016, 10:00

Minguillon,

there are two reasons why the "Config" and "Set Config" button can be disabled:

(1) The modules did not connect with each other. This can be because you have a personal firewall that blocks applications from communicating over UDP/TCP sockets. In this case try to disable the firewall.

(2) One of the modules did not properly start. In this case try to check if the processes corresponding tot he three modules (Source, SignalProcessing and Application) exist in the Task Manager. If they do, check which of them did not connect trough the connection window in the BCI2000 Operator.

Let me know if this resolves the issue.

Regards, Peter

minguillon
Posts: 5
Joined: 10 Oct 2016, 18:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by minguillon » 18 Oct 2016, 10:34

Dear Peter,

Thank you for your reply.

I guess it is the second reason because "Config" and "Set Config" are enabled when I use SignalGenerator or my own ADC without calling any function of the API (I mean compiling the original code generated by the NewBCI2000Module tool). The problem appears when I include (in the code) a call to an imported function of the API (even if the call is not executed). My ADC does not properly start and the status is "no status available". It cannot turn into "waiting for configuration". The API has been successfully imported by other software such as Matlab.

Best,
Jesus Minguillon.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by pbrunner » 18 Oct 2016, 10:46

Minguillon,

I suspect that the loading of your API functions from the DLL does not properly work. I see that you are using the last release (i.e., v3.0.5). Can you try to download the latest trunk source code [1]? To build this, follow the instructions in the BCI2000 v3.6 beta test thread [2]. Once you have build everything, there will be a DylibTool.exe in the build directory. Apply this to your SDK to create the glue code to dynamically import the API functions to your BCI2000 source module.

Let me know if this works.

Regards, Peter

[1] http://www.bci2000.org/svn/trunk
[2] http://www.bci2000.org/phpbb/viewtopic.php?f=1&t=2955

minguillon
Posts: 5
Joined: 10 Oct 2016, 18:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by minguillon » 19 Oct 2016, 05:10

Dear Peter,

I used the DylibTool.exe of my current version of BCI2000 and it works. I just needed the xxxx.imports.cpp and xxxx.imports.h files generated by DylibTool.

Thank you so much.

Best,
Jesus Minguillon.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by pbrunner » 19 Oct 2016, 16:51

Minguillon,

you are welcome and I am glad that this is now working for you.

Regards, Peter

minguillon
Posts: 5
Joined: 10 Oct 2016, 18:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by minguillon » 28 Oct 2016, 09:47

Dear Peter,

I post again in this thread because I found another problem while running my ADC. Let me know if you prefer to open a new thread.

I get the following error after acquiring and plotting the first data block:

2016-10-28T15:37:17 - SignalSource error, DataIOFilter::Resting: PlatEEGADC::Process:
State PlatEEGADCSyncTriggers must be defined as a stream if used with the Sample() accessor.
2016-10-28T15:37:17 - SignalSource error:
Lost connection to SignalSource.

The first data block is successfully acquired but not the same for the next ones. I have updated and I'm currently using the latest trunk source code of BCI2000. In the DoAcquire function I call WaitUntilBufferFull and GetData functions of my ADC API. The first function blocks until the buffer is full, that is the next data block is ready.

Thank you in advance.

Best,
Jesus Minguillon.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by pbrunner » 28 Oct 2016, 10:13

Jesus,

the error message you are getting indicates that you are defining PlatEEGADCSyncTriggers as a STATE, but accessing it on a sample by sample basis. For this purpose there is a STREAM definition (see below). Please try to change your state from STATE to STREAM, this should fix the issue. On another note, if the source module that you are writing is useful for other users, you can consider contributing it to the BCI2000 SVN server. Let me know if this would be of interest for you.

Code: Select all

 BEGIN_STREAM_DEFINITIONS
    "PlatEEGADCSyncTriggers 8 0 0 0",
 END_STREAM_DEFINITIONS
Regards, Peter

minguillon
Posts: 5
Joined: 10 Oct 2016, 18:43

Re: "Config" and "Set Config" disabled when running my own ADC

Post by minguillon » 28 Oct 2016, 11:08

That fixed the issue!! Thank you so much Peter. Regarding the contribution, for sure I will do it as soon as the ADC is ready and released.

Best,
Jesus Minguillon.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests