Once again, I am reverse engineering a system that was passed down to me without documentation.
I have some code (TCL code on a Linux machine) that opens a UDP port and reads data from the BCI2000 App Connector (set up on a separate Windows PC, connected via network switch). This code reads labels and values, and controls a robotic arm accordingly.
This code expects to receive some of the standard states for BCI2000 and CursorTask (such as TargetCode, ResultCode, CursorPosX, Running, etc.), but it also expects to receive states that don't seem to be sent by BCI2000 in it's default CursorTask configuration, including Preflight, Initialization, IntertrialInterval, and PreTrialPause. It also seems to expect to receive some parameters via the App Connector, including WinWidth, WinHeight, NumberTargets, and the target matrix, but only once, in a specific order, after receiving the "Initialization" state value of 1.
In data files generated by the default CursorTask configuration, the header obviously does not include these additional states or parameters. In some data files associated with the old system, the header includes some (but not all) of these states, especially IntertrialInterval.
I have read that the App Connector sends all of the states in the state vector, which makes me think that states and possibly parameters) were added to the state vector. But the previously used configuration doesn't seem to use any custom modules (just CursorTask and ARSignalProcessing). This leads me to three questions:
1) Is it possible to add states (like IntertrialInterval and PreTrialPause) to the state vector without writing custom modules?
2) Is it possible to add parameters to the state vector, or to send them out via the App Connector at all?
3) Is "Initialization" a state that could be sent via the App Connector? I have read that Preflight and Initialization are functions, but have they been transmitted as states previously?
Adding states/parameters to state vector for App Connector
-
gphilips
- Posts: 14
- Joined: 07 Aug 2012, 15:18
-
gschalk
- Posts: 615
- Joined: 28 Jan 2003, 12:37
Re: Adding states/parameters to state vector for App Connect
Hi,
You can definitely add states without writing custom code. See BCI2000's scripting options:
http://www.bci2000.org/wiki/index.php/U ... _Scripting
The AppConnector cannot be used to transport parameters. This and many other simplifications are design choices, i.e., to make it as easy as possible to write external modules, without having to implement all elements of BCI2000's internal communication protocols. See
http://www.bci2000.org/wiki/index.php/T ... _Connector
I do not think that Initialization, etc., have every been transmitted as states before. Actually, this doesn't even make sense because the system is not even completely running (e.g., it does not yet send states around) during these stages in the state machine.
You can definitely add states without writing custom code. See BCI2000's scripting options:
http://www.bci2000.org/wiki/index.php/U ... _Scripting
The AppConnector cannot be used to transport parameters. This and many other simplifications are design choices, i.e., to make it as easy as possible to write external modules, without having to implement all elements of BCI2000's internal communication protocols. See
http://www.bci2000.org/wiki/index.php/T ... _Connector
I do not think that Initialization, etc., have every been transmitted as states before. Actually, this doesn't even make sense because the system is not even completely running (e.g., it does not yet send states around) during these stages in the state machine.
-
gphilips
- Posts: 14
- Joined: 07 Aug 2012, 15:18
Re: Adding states/parameters to state vector for App Connect
Thanks for the information. This is very helpful.
As it turns out, I think a few custom application modules may have been used.
I also managed to run the whole system on BCI2000 version 1.0 today, and somehow the other computer actually received the "preflight" ID and parameters over the app connector port. I will have to dig through the custom application source code (if it still exists) and see how the managed this.
As it turns out, I think a few custom application modules may have been used.
I also managed to run the whole system on BCI2000 version 1.0 today, and somehow the other computer actually received the "preflight" ID and parameters over the app connector port. I will have to dig through the custom application source code (if it still exists) and see how the managed this.
Who is online
Users browsing this forum: No registered users and 0 guests
