Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

EEG Data Loop

Hello all!


I am trying to take a binary file of EEG data, sort the data into 11 channels, and then output each channel concurrently through my NI9263 DAQ. I believe I have the binary conversion and channel sorting down, but I am getting stuck trying to output the voltage as a stream of data.

 

For example, if I had a matrix like this:

 

1 2 3

4 5 6

7 8 9

 

I would want to continuously loop through these 3 channels at the same time, inputting one voltage at a time in each channel and I'm getting stuck coming up with ideas! I have been attempting to utilize the DAQmx assistant, but I can't seem to figure out how to (1) output a specified voltage and (2) output an array as a stream of data.

 

I hope this is being clear enough, please let me know if you need more information! I appreciate your help!

0 Kudos
Message 1 of 9
(4,001 Views)

You should probably take a look at the examples in LabVIEW. Gen Mult Volt Updates-Int Clk.vi in particular should be helpful. You can build your data into an array that you then send to the NI 9263. This will also be more efficient that DAQ Assistant if you end up putting this in a loop. Remember to use context help to describe what a particular sub-VI is doing. Your code will end up very different from this example, but should be a good start.

 

Kyle K

 

 

Product Manager for Product Data
National Instruments
0 Kudos
Message 2 of 9
(3,969 Views)

Thank you very much for your tip! That made it do exactly as I'd hoped. Unfortunately now, I am running into memory problems when trying to open up my large array from a .csv file.  The rest of the code works as I would hope when using a smaller example file. I've attached my vi. Any suggestions?

 

Thanks a lot!

0 Kudos
Message 3 of 9
(3,947 Views)

There is a page on our website that explains much of that. Just go to http://zone.ni.com/devzone/cda/tut/p/id/3625 to read about it. It is also possible to use a file splitter program to chop up your data file into several smaller files. You should determine which method best suits your projects and computer performance.

 

Kyle K.

Product Manager for Product Data
National Instruments
0 Kudos
Message 4 of 9
(3,945 Views)

I''ve researched that page in the past and don't seem to understand how to apply that to my vi. I apologize, I am a pretty novice user! I think what I want to do is read my matrix one column at a time, but for some reason I can't figure out how to accomplish this goal. I've attached my vi if that helps!

0 Kudos
Message 5 of 9
(3,929 Views)

Megan_BSI:

I have a few questions for you so we can continue to help you build your code. How large is your .csv
file in bytes? What error and error number are you getting? (Please copy and paste
the exact text and error code.) Can you also attach your .csv file by chance? What version of LabVIEW
are you using and what is your Operating System? Also, have you tried opening those examples and
following the instructions in the tutorial listed to see if the concepts apply to your problem?


Tori W.

National Instruments
0 Kudos
Message 6 of 9
(3,901 Views)

Tori W,

 

I am using LabVIEW 2011 and Windows 7 and the .csv file can be anywhere from 9 to 20 KB depending on the trial. I tried looking at the examples, but I must admit I had a hard time following the programming to see if it applied to mine.  When I attempt to run my vi, a box pops up that freezes LabVIEW saying, "Error: Not enough memory to complete this operation" and I have to kill LabVIEW and restart the program. 

 

Also, it won't let me attach my data because the file is too large?

 

Thank you very much for your help!

Megan

0 Kudos
Message 7 of 9
(3,895 Views)

Also, if it doesn't freeze up the program I get this error after the memory error

 

Error -200292 occurred at Replay EEG_9-8-11_Preprocessed.vi

Possible reason(s):
Some or all of the samples to write could not be written to the buffer yet. More space will free up as samples currently in the buffer are generated.
To wait for more space to become available, use a longer write timeout. To make the space available sooner, increase the sample rate.
Property: RelativeToCorresponding Value: Current Write PositionProperty: OffsetCorresponding Value: 0
Task Name: _unnamedTask<2>

0 Kudos
Message 8 of 9
(3,888 Views)

Megan_BSI:

Are you able to read in your .csv file in an example vi? Use this example VI with one of your files
and see if you are still getting the error. This way we can narrow down whether the problem is in the
.csv file or your code.

Can you run Highlight Execution to see exactly where the cause of the error is located? You can do this
by clicking on the lightbulb button to the right of the abort and pause buttons. Note: this will
significantly reduce the speed of your code and should only be used for troubleshooting. Let me know

exactly where the error originates.

 

Do you get the same error running this VI with your roughly 20kB file on another computer? If you get
different errors, please report them back to me as well.

Those file sizes do not sound too large to me, but there may be a way to parse through it in sections
anyway if that would help. We can try that next, but get back to me with the results of the above
suggestions.


Tori W.

National Instruments
0 Kudos
Message 9 of 9
(3,881 Views)