Forum for software developers to discuss BCI2000 software development
-
louismayo
- Posts: 20
- Joined: 25 Jun 2007, 05:40
Post
by louismayo » 21 Aug 2007, 10:29
Hello,
I am trying to include a new feature to my acquisition module. This VCL feature display a EEG-cap map with the online impedance values. It has been already test and it works well.
I tried to add the form to my Refa acquisition module by the following mean:
Code: Select all
...
USEFORM("ImpedanceCheck\Form_IC.cpp", Form1);
...
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
...
Application->CreateForm(__classid(TForm1), &Form1);
...
}
where Form_IC.cpp is the Impedance Check form code.
Everything compiles and the impedance check executes normaly, but the following error occures when the fMain (from bci2000) launches:
Code: Select all
Unexpected system state transistion 11->1
I tried to do it by other ways but each failed by the same. Do you have an idea of what I should do to get rid of that error?
Thank you
Louis
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Post
by mellinger » 22 Aug 2007, 06:03
Louis,
basically this error means that the operator module receives messages from core modules that are incompatible with its present state, e.g. a module sends a parameter list but the operator module is not in the publishing phase, and thus cannot respond appropriately.
Often, this error is caused when one runs a module from the debugger, aborts its execution, and then restarts it. Then, the BCI2000 system as a whole will be in an undefined state.
Rather than just restarting a single module, you need to quit BCI2000 from the operator module, and then restart all modules.
HTH,
Juergen
-
louismayo
- Posts: 20
- Joined: 25 Jun 2007, 05:40
Post
by louismayo » 22 Aug 2007, 10:07
Juergen,
Thank you for your answer. I tried to run the acquisition module (with the impedance check form) for the exec file instead of from debugger as you suggested but had no more success: got the same error.
From what I understood from the differents BCI documentation (Project outline, Error handling and Design document), it seems that the "Check Impedance Form" modifies the StateVector. But I wonder how it could be possible since this part does not access to State() neither to UEnvironnement.h .
Maybe the following code matters:
Code: Select all
USEFORM("..\..\shared\UCoreMain.cpp", fMain);
USEFORM("ImpedanceCheck\Form_IC.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->Title = "EEGsource V0.20";
Application->CreateForm(__classid(TForm1), &Form1);
Application->CreateForm(__classid(TfMain), &fMain);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}
Should I precise in the first form code some code lines to set StateVector to a special value?
Thanks
Louis
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Post
by mellinger » 22 Aug 2007, 12:33
Louis,
when you perform the following steps:
- quit the BCI2000 operator,
- use the Windows Task Manager (process view) to kill any remaining BCI2000 module,
- start the BCI2000 operator and the modules as usual,
does the problem still occur?
-- Juergen
-
louismayo
- Posts: 20
- Joined: 25 Jun 2007, 05:40
Post
by louismayo » 22 Aug 2007, 12:59
Yes I did this already and I still have the error. (I restarted the computer to be sure about it after your post)
If I create the form as bellow, the error does not occures but the Form1 does not appears:
Code: Select all
Application->Initialize();
Application->Title = "EEGsource V0.20";
Application->CreateForm(__classid(TForm1), &Form1);
Application->CreateForm(__classid(TfMain), &fMain);
Application->Run();
If I try to do Initialize->CreateForm->Terminate for each form, It fails.
Both way fails, sthg should be wrong in my code regarding to delphi or bci2000 environment but I don't findout. The upper version should work, any idea why the window doesn't appears?
Thanks
Louis
-
mellinger
- Posts: 1341
- Joined: 12 Feb 2003, 11:06
Post
by mellinger » 23 Aug 2007, 12:22
Louis,
try to instantiate the form from your ADC class, e.g., in its Initialize() member. That way, you make sure that initialization of the VCL has taken place before your window is created.
Apart from that, Windows message handling may be broken for BCI2000 core modules.
If that is an option for you, I suggest to create a different application program for the impedance screen.
Regards,
Juergen
Who is online
Users browsing this forum: No registered users and 0 guests