01-09-2006 10:09 AM
01-09-2006 10:41 AM
01-09-2006 10:43 AM
Oh, forgot to mention. When you install NI-DAQmx, tons of great examples are installed. Check out the example finder in LabVIEW. Go to Help>>Find Examples. Then navigate to Hardware Input and Output>>DAQmx. Then for analog input, go to Analog Measurements>>Voltage.
01-30-2006 04:51 AM
01-30-2006 11:33 AM - edited 01-30-2006 11:33 AM
Hello mseb,
I've got a couple things to mention. First, you are on the right track with solving this problem. As the error message indicates, some samples are being overwritten before they are read, which boils down to the fact that the loop with the DAQmx Read simply isn't being executed fast enough or perhaps we just aren't reading enough samples in each iteration. The tricky thing about this type of problem, is that the rate in which this error occurs is usually completely system dependent. On my machine (P4 3GHz, 1G RAM), I can not reproduce the error at 250k S/s and 1,000,000 reads (2048 samples to read) which is of course 2048 million samples. I had to decrease the number of samples to read (In your program, Points/bloc) to less than 20 before I received the error. Anyway, my suggestions are to read more samples per iteration, so increase your Points/bloc, even by a factor of 10x or so would probably be ok. Additionally, you can explicitly increase the size of the buffer that is allocated by NI-DAQmx, which might be necessary for your system. NI-DAQmx automatically selects a buffer size based on the sample rate (see image from NI-DAQmx help below). However, you can explicitly increase the size of that buffer using the "DAQmx Configure Input Buffer.vi", located on the NI Measurements>>DAQmx - Data Acquisition>>DAQmx Advanced Task Options palette. Hope one of these (or both) helps!
-Alan A.
Message Edited by Alan [DE] on 01-30-2006 11:33 AM
01-30-2006 11:36 AM
One other thing I noticed (and this is purely a LV programming suggestion) is that it looks like you want to start your acquisition on a button press. The best way to go about this in LabVIEW is to use an event structure. Take a look at the attached simple example. You might want to consider this for future apps.
-Alan A.
01-30-2006 12:09 PM
01-30-2006 01:02 PM
Hi mseb,
I have not looked at your VIs, but it sounds like your application is running into throughput problems and is not able to keep up with both data logging and data acquisition simultaneously.
To solve a throughput problem, you need to find the "bottleneck". Either the data acquisition or the disk throughput is likely to be the "bottleneck" to your application; however, other factors (such as additional processing) can be the bottleneck sometimes. To determine which part of your application is the bottleneck, try to run either Write to Disk or the DAQmx Read in a loop by itself. If you want to use Write to Disk by itself, you should determine maximum rate by which you can write data to disk, which will depend on the number of samples you write at a time and how fast your disk drive is. With standard off the shelf drives you should not expect much more than 10 Mbytes / second. However, if you have a RAID controller, you may get faster performance. If it is not the Write to Disk that is slow, then you can run DAQmx Read in a loop by itself and see what is the maximum rate you can acquire data without getting an error.
Also, if you want to increase the DAQmx buffer size, use DAQmx Configure Input Buffer VI in the "DAQmx : Task Config/Ctrl" palette to increase the buffer size used by the DAQmx driver. The default buffer size depends on your acquisition rate; for high rates the default is 1 million samples per channel.
01-31-2006 09:19 AM
03-06-2006 04:37 PM
Hello, I'm trying to do something similiar to your application. Would it be possible to get a copy of your application. My program uses a NI-6543 Data Aquisition card and I'm sampling data a 20Mhz with the data being 32-bits. I'm going to set up a RAID system to store the data. Also, I didn't catch what Allen was speaking about using the event structure?
thanks,
joe