Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with PCI 6221

Hi,
I am using Labview 7.0 and PCI 6221 for data aquisition. I want to use them to get Voltage vs. time spectrum, and I need high sampling rate. I can do it at 10k sample rate if I just put a "DAQ assistant" express VI, wire it to "write labview measurement file" express vi, and surround them with a while loop. However, I can not put control of sample rate at the front pannel, so I have to go to block diagram and change property of "DAQ assistant" if I want to change sample rate.
So I just go with regular VI. I modified an expample VI found with NI Example Finder. It is "Cont Acq&Graph Voltage-Int Clk.vi". I just wire a "write labview measurement file" express vi to the data output terminal of DAQmx read vi. However, this time I will have error 200279 if I use sample rate higher than 5k.
Any idea toward the solution will be highly appreciated.
 
0 Kudos
Message 1 of 4
(3,372 Views)

 Nanopore,


That error officially means:


“Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.


Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.”


So what could be happening in your system is that you are collect samples faster (as you increase your sample rate) then you are pulling them out of the buffer. The “Rate” input determines your sample rate, and the “Samples to Read” determines how many samples you wait for to be in the buffer before you pull them out. One thing you may try is to reduce the “Samples to Read” value, that way you pull from the buffer more often and hopefully avoid this error.


Another thing you should try is to remove the writing to file from the while loop for now. What could be happening is the writing to file takes too long, and that is causing the buffer to overwrite itself. So for now just run the example program as is, with no file logging, and make sure it can run at the speeds you need. Then if that works, you will have determined that it’s the file IO that is bogging things down. Then you can look into more efficient ways of writing to a file (i.e. not using the express VI inside the while loop).


Give those things a shot, and let us know how it goes. Once we know where the problem is, we can offer advice as to where to go from there.


Hope this has helped.


-GDE
Message 2 of 4
(3,345 Views)
GDE,
Thank you very much.
Actually I have tried to reduce the sample numbers, and the problem did not go away. It seems that the write to LVM express vi is too slow. However, I have to record data in line. I think just using the DAQ assistant express VI is ok with me now. 
0 Kudos
Message 3 of 4
(3,329 Views)
If you still want to stream to disk, try NI-HWS (on your driver CD under the computer based instruments tab).  It was designed for high speed streaming from NI-SCOPE devices (among other things).  Typical data rates are 10+MBytes/second from hardware to disk.  I have done 12MBytes/sec on a 650MHz six year old PC.  You can usually do about twice that with a modern machine.
0 Kudos
Message 4 of 4
(3,315 Views)