Difference between revisions of "Contributions:NIDAQLogger"

From BCI2000 Wiki
Jump to: navigation, search
Line 61: Line 61:
 
<code>SignalGenerator.exe --LogNIDAQ=1 --LogNIDIO="dev1-000100200100" --LogNIAO="dev1-10"</code>
 
<code>SignalGenerator.exe --LogNIDAQ=1 --LogNIDIO="dev1-000100200100" --LogNIAO="dev1-10"</code>
 
===BCI2000 Parameters===
 
===BCI2000 Parameters===
If either the <code>--LogNIAI</code> or the <code>--LogNIAO</code> flags are used, there will be a parameter in the configuration box (under Source)
+
There are three possible parameters that the user will be able to use. They are outlined below:
that will allow users to specify the voltage range they want the device to work under. There will be as many range parameters as there are devices connected
+
*<b>#IVRange</b> - the available voltage ranges for analog input for the given device (where <b>#</b> will be replaced by the device name)
that use analog functionality. It will be labeled as <b>dev#VRanges</b>, where # represents the device number.
+
**<i>This parameter will only be enabled if the </i><code>--LogNIAI</code><i> flag is being used</i>.
 +
*<b>#OVRange</b> - the available voltage ranges for analog output for the given device (where <b>#</b> will be replaced by the device name)
 +
**<i>This parameter will only be enabled if the </i><code>--LogNIAO</code><i> flag is being used, or there are multiple possible ranges</i>.
 +
*<b>NIDAQSampleRate</b> - the sampling rate for the NIDAQLogger
 +
**<i>This parameter will be here if the </i><code>--LogNIDAQ</code> flag is being used</i>.
 +
 
 +
The parameters will be located under the <b>Source</b> tab, in the section labeled <i>LogNIDAQ</i>.
  
 
==States==
 
==States==

Revision as of 18:30, 29 June 2010

Synopsis

National Instruments Data Acquisition Module

Location

Not yet in the repository. (It would be in the following directory: http://www.bci2000.org/svn/trunk/src/contrib/SignalSource/NIDAQLogger)

Versioning

Author

Justin Renga (justin.renga@gmail.com)

Version History

Source Code Revisions

  • Initial development: --
  • Tested under: --
  • Known to compile under: --
  • Broken since: --

Functional Description

Acquires/Generates signals to/from National Instruments Data Acquisition boards, other devices, and the computer. Device must be connected to computer beforehand.

Parameters

Command Line Parameters

Initializing NIDAQLogger

To begin using the NIDAQLogger module, use the --LogNIDAQ flag (on SignalGenerator.exe), set equal to 1. To activate device(s) for specific functions, use the following flags:

  • --LogNIDIO (for digital input/output)
  • --LogNIAI (for analog input)
  • --LogNIAO (for analog output)

The format for the inputs for the above flags is as follows: [flag]="[device name]-[port specification]" Note that if --LogNIDAQ is used, that at least one of the three above flags MUST be used.

Device Specification

The device name (usually) is to be written as "dev1" or "dev2" (without the ""). Afterwards, use a - to indicate the device name is finished.

Digital Port Specifications

There are three acceptable states that the user can specify for each digital port:

  • 0 - this indicates the port is INACTIVE.
  • 1 - this indicates the port is to be used as INPUT
  • 2 - this indicates the port is to be used as OUTPUT

Analog Port Specifications

There are two acceptable states that the user can specify for each analog port (both input and output):

  • 0 - this indicates the port is INACTIVE
  • 1 - this indicates the port is ACTIVE

Example

Let's assume that the user wants to use one device for both digital input/output and analog output. The device has 2 Analog Output ports and 12 Digital I/O ports. The user also wants to use the 1st analog output port, the 7th digital port as Digital Output, and the 4th and 10th digital ports as Digital Input.

The user needs to use 3 flags to accomplish this:

  • --LogNIDAQ=1
    • This flag activates the NIDAQLogger for use.
  • --LogNIDIO="dev1-000100200100"
    • This flag indicates that the user wants to use digital I/O.
    • "dev1" is the name of the device connected to the computer that she wants to use.
    • 0001000200100 indicates that the user wants to use ports 4 and 10 (the 1's) as INPUT, and port 7 (the 2) as OUTPUT
  • --LogNIAO="dev1-10"
    • This flag indicates that she wants to use analog output.
    • "dev1" is the name of the device connected to the computer that she wants to use.
    • 10 indicates that she wants to the use port 1 on analog output.

The full command that the user would use is the following:

SignalGenerator.exe --LogNIDAQ=1 --LogNIDIO="dev1-000100200100" --LogNIAO="dev1-10"

BCI2000 Parameters

There are three possible parameters that the user will be able to use. They are outlined below:

  • #IVRange - the available voltage ranges for analog input for the given device (where # will be replaced by the device name)
    • This parameter will only be enabled if the --LogNIAI flag is being used.
  • #OVRange - the available voltage ranges for analog output for the given device (where # will be replaced by the device name)
    • This parameter will only be enabled if the --LogNIAO flag is being used, or there are multiple possible ranges.
  • NIDAQSampleRate - the sampling rate for the NIDAQLogger
    • This parameter will be here if the --LogNIDAQ flag is being used.

The parameters will be located under the Source tab, in the section labeled LogNIDAQ.

States

The states that are available are dependent on the port specifications declared in the command line parameters. The format for the states is the following:

NIdev#[A:D][INPUT:OUTPUT]#

  • The first # refers to the device number.
  • The second # refers to the line number (starting at 0).
  • The [A:D] denotes if the state refers to an analog (A) or a digital (D) channel.
  • The [INPUT:OUTPUT] denotes if the state refers to an input or output channel.

For example, if the command parameters look like this:

SignalGenerator.exe --LogNIDAQ=1 --LogNIDIO="dev1-000100200100" --LogNIAO="dev1-10"

the states that will be created are the following:

  • NIdev1DINPUT3
  • NIdev1DOUTPUT6
  • NIdev1DINPUT9
  • NIdev1AOUTPUT0