Adding states/parameters to state vector for App Connector
Posted: 10 Apr 2013, 14:34
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?
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?