Contributions:ParallelPortFilter: Difference between revisions
| Line 27: | Line 27: | ||
==Parameters== | ==Parameters== | ||
The ParallelPortFilter is configured in the ParallelPort tab. The configurable parameters are: | The ParallelPortFilter is configured in the ParallelPort tab. The configurable parameters are: | ||
===SourcePorts=== | |||
This parameter is used to initialize the filter and to keep track of the number of ports being used. This number should be the total number of parallel ports that should be used to communicate. It should be an integer value greater than 0 if being used else 0. Most computers do not have more than 3 parallel ports but some have 4. In good practice this value should not be greater than 3 unless you are sure you have that many ports. | |||
===SourcePortsList=== | |||
This parameter lists the ports to be used and the order to communicate through them. It should be a list of the port names LPT1 - LPT3. You can not use the same port twice in on list. This list must be the same length as the value in Parameter SourcePorts. | |||
===LPTMapping=== | |||
This parameter is to manually enter the hardware address of the ports incase that the computer being used does not conform to general use hardware addresses. Column one should have the names of the ports such as LPT1 or LPT2, same as the values in Parameter SourcePortsList, and column two should have the hexadecimal value of the port such as 0x378. The number of rows in the matrix should be equal to the value in Parameter SourcePorts, while it must have two columns if being used, no more, no less. | |||
===DigitalOutputEx=== | |||
This matrix of expressions that controls the outputs on the parallel ports. Each port has 8 bits which correspond to 8 rows on the matrix. If the ex For more information on digital output and expressions usage for ParallelPortFilter see [[::Contributions:ParallelPortFilter#Digital Output|Digital Output]] | |||
The g.STIMbox has 16 digital outputs which can be controlled via expressions in this matrix. Some of the outputs can only be accessed via the D-SUB connector on the front of the box. To control a port, create a new row in this matrix and change the row label to the number of the port you wish to control. If the expression in column 1 in that row evaluates to True, the port will be set high, and the port will be set low whenever the expression evaluates to False. If an 'F' is specified immediately after the row label (for example, '3F'), that port is assumed to be in 'Frequency Mode' and the port frequency will be set to whatever the expression evaluates to. If the expression evaluates to 0 or False, the port will be set low (off). Note that changing the frequency while in frequency mode will reset the port to 'high' immediately. This means that changing the frequency too often will result in the port reading 'high' all the time. | |||
Revision as of 17:42, 30 June 2015
Synopsis
An integration of the parallel port communication with BCI2000.
Location
http://www.bci2000.org/svn/trunk/src/contrib/Extensions/ParallelPortFilter
Versioning
Authors
Kristopher Kaleb Goering (kaleb.goering@gmail.com)
Version History
- 2015/06/30: Initial public release
Source Code Revisions
- Initial development: --
- Tested under: --
- Known to compile under: --
- Broken since: --
Functional Description
This simple filter extension resides in the Application module and makes input and output with the parallel port easy.
Integration into BCI2000
Compile the extension into your source module by enabling contributed extensions in your CMake configuration. You can do this by going into your root build folder and deleting CMakeCache.txt and re-running the project batch file, or by running cmake -i and enabling BUILD_PARALLELPORTFILTER. Once the extension is built into the source module, it can be used.
Parameters
The ParallelPortFilter is configured in the ParallelPort tab. The configurable parameters are:
SourcePorts
This parameter is used to initialize the filter and to keep track of the number of ports being used. This number should be the total number of parallel ports that should be used to communicate. It should be an integer value greater than 0 if being used else 0. Most computers do not have more than 3 parallel ports but some have 4. In good practice this value should not be greater than 3 unless you are sure you have that many ports.
SourcePortsList
This parameter lists the ports to be used and the order to communicate through them. It should be a list of the port names LPT1 - LPT3. You can not use the same port twice in on list. This list must be the same length as the value in Parameter SourcePorts.
LPTMapping
This parameter is to manually enter the hardware address of the ports incase that the computer being used does not conform to general use hardware addresses. Column one should have the names of the ports such as LPT1 or LPT2, same as the values in Parameter SourcePortsList, and column two should have the hexadecimal value of the port such as 0x378. The number of rows in the matrix should be equal to the value in Parameter SourcePorts, while it must have two columns if being used, no more, no less.
DigitalOutputEx
This matrix of expressions that controls the outputs on the parallel ports. Each port has 8 bits which correspond to 8 rows on the matrix. If the ex For more information on digital output and expressions usage for ParallelPortFilter see [[::Contributions:ParallelPortFilter#Digital Output|Digital Output]]
The g.STIMbox has 16 digital outputs which can be controlled via expressions in this matrix. Some of the outputs can only be accessed via the D-SUB connector on the front of the box. To control a port, create a new row in this matrix and change the row label to the number of the port you wish to control. If the expression in column 1 in that row evaluates to True, the port will be set high, and the port will be set low whenever the expression evaluates to False. If an 'F' is specified immediately after the row label (for example, '3F'), that port is assumed to be in 'Frequency Mode' and the port frequency will be set to whatever the expression evaluates to. If the expression evaluates to 0 or False, the port will be set low (off). Note that changing the frequency while in frequency mode will reset the port to 'high' immediately. This means that changing the frequency too often will result in the port reading 'high' all the time.