Difference between revisions of "Contributions:Blackrock"

From BCI2000 Wiki
Jump to: navigation, search
(Finalized v1.0 Documentation)
(Functional Description)
Line 25: Line 25:
  
 
You will also need to change your interface's network configuration ([http://www.howtogeek.com/howto/19249/how-to-assign-a-static-ip-address-in-xp-vista-or-windows-7/ Windows]):
 
You will also need to change your interface's network configuration ([http://www.howtogeek.com/howto/19249/how-to-assign-a-static-ip-address-in-xp-vista-or-windows-7/ Windows]):
IP address: 192.168.137.XXX where XXX is less than 128.  Ensure no other computers have this same address on this switch.
+
* IP address: 192.168.137.XXX where XXX is less than 128. <u>This number needs to be below 16 and not 10.</u> Ensure no other computers have this same address on this switch.
Subnet Mask: 255.255.255.0
+
* Subnet Mask: 255.255.255.0
Default Gateway: <Blank>
+
* Default Gateway: <Blank>
 
To test your network configuration, open a terminal or command prompt and type '''ping 192.168.137.128'''. This is the NSP's default network address.  If you can ping the NSP, you should be able to run the module.
 
To test your network configuration, open a terminal or command prompt and type '''ping 192.168.137.128'''. This is the NSP's default network address.  If you can ping the NSP, you should be able to run the module.
  

Revision as of 20:29, 10 August 2013

Synopsis

The Blackrock acquisition module enables signal acquisition from Blackrock Microsystems Cerebus and Neuroport acquisition hardware through the CereLink "cbsdk".

Location

http://www.bci2000.org/svn/trunk/src/contrib/SignalSource/Blackrock

Versioning

Author

Griffin Milsap (griffin.milsap@gmail.com)

Version History

  • V1.0 -- Analog Signal Acquisition and Digital Filtering Functionality

Source Code Revisions

  • Initial development: 4365
  • Tested under: 4365
  • Known to compile under: 4365
  • Broken since: N/A

Functional Description

The Blackrock source module is used for acquiring recordings from the Blackrock NSP through CereLink (https://github.com/dashesy/CereLink). It also happens to be one of the first BCI2000 SignalSource modules to function under Linux. This documentation explains the parameterization and specifics on how to set up the system.

Configuration

Building the Blackrock module should copy .bat files for standard experiments into the batch directory, in addition to a parameter fragment for the amplifier, placed in parms/fragments/amplifiers.

Ensure your machine is connected to a switch or router that the NSP is also connected to. This module communicates to the NSP using UDP, and is susceptable to packet loss. In the event of a lost packet, the module will crash (this is rare with a good switch). Ensure you have a commercial grade switch to avoid dropping packets. You can also use a crossover cable to connect directly to the NSP, but this prevents other computers from receiving data from the NSP.

You will also need to change your interface's network configuration (Windows):

  • IP address: 192.168.137.XXX where XXX is less than 128. This number needs to be below 16 and not 10. Ensure no other computers have this same address on this switch.
  • Subnet Mask: 255.255.255.0
  • Default Gateway: <Blank>

To test your network configuration, open a terminal or command prompt and type ping 192.168.137.128. This is the NSP's default network address. If you can ping the NSP, you should be able to run the module.

Windows

This should work out of the box with standard parameters.

Linux

If you encounter a segfault or error message on SetConfig, one of the most common issues is with permissions. NSP 6.03 and previous opens port 1002 and 1001 to communicate packets. This was a rather unfortunate choice, as administrative privileges are required in order to open ports below 1024 on standard *nix systems. NSP Firmware 6.04+ uses higher port numbers to avoid this problem. If you're running 6.03 firmware or below, you will need to start the Blackrock module with administrative privileges. One way to accomplish this is to comment out the "Start Blackrock" line in your batch file, and launch the Blackrock module from a separate terminal with "sudo ./Blackrock", executed from the bci2000/prog directory.

You may also receive an error complaining about the size of your network buffer size:

   Socket memory assignment error
   Consider using sysctl -w net.core.rmem_max=8388608
   or sysctl -w kern.ipc.maxsockbuf=8388608

Depending on your operating system (OSX or your favorite flavor of Linux) you should execute one of these commands with administrative privileges. You will need to do this once every time the computer reboots. There may be a way to do this on boot using some config file somewhere. If you have any ideas, edit this section. net.core.rmem_max is the proper key to use for Fedora 17.

Parameters

The following parameters are available for configuring the Blackrock source module. You will find these parameters in the Source -- Signal Properties section.

SourceCh

The Blackrock module supports a maximum of 144 analog channels. The first 128 of these channels are the analog EEG channels, and the following 16 are the analog input channels on the NSP itself.

AnalogCh

This parameter specifies what channels to acquire from the NSP. Again, the first 128 of these channels are the analog EEG channels, and the following 16 are analog input channels on the NSP itself. You can specify this parameter in two ways.

Manual

Specify a vector of 144 '0's and '1's; where there are SourceCh '1's. Example:

   SourceCh = 16;
   AnalogCh = 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

This parameterization acquires channels 4, 8, 9, 10, 17, 18, 19, 23, 29, 33, 37, 39, 44, 50, AINP1, and AINP2

Automatic

If you just want a sequential number of channels starting from channel 1, specify the number of channels to acquire as a negative number. Example:

   SourceCh = 32;
   AnalogCh = -32;

This parameterization acquires channels 1-32. NOTE: 0 is interpreted as -144 which means every channel is acquired.

SignalFilter

The following filters can be applied to *DESTRUCTIVELY* filter the data on the NSP before it is passed to BCI2000.

  • 0 -- No Filter
  • 1 -- HP 750Hz
  • 2 -- HP 250Hz
  • 3 -- HP 100Hz
  • 4 -- LP 50Hz
  • 5 -- LP 125Hz
  • 6 -- LP 250Hz
  • 7 -- LP 500Hz
  • 8 -- LP 150Hz
  • 9 -- BP 10Hz-250Hz
  • 10 -- LP 2.5kHz
  • 11 -- LP 2kHz
  • 12 -- BP 250Hz-5kHz

SampleBlockSize

Any number of samples is valid here: even 1. You may want to not do that, however. Clocking the system above 20-30 Hz is a bad choice.

SamplingRate

Only the following sample rates are supported.

   500
   1000
   2000
   10000
   30000

Future Work

  • Digital Input as States
  • Digital Output
  • Serial Input

See also

User Reference:Filters, Contributions:ADCs