I'm trying to recreate the example vi from this niglobal tutorial video. The only difference is I am using a variable DC power supply instead of a function generator. It's not throwing any errors when I run the VI, but waveform graph is not not displaying data. I probed the dadta output of the DAQmx read function. I didn't see anything there either. I opened up measurement and automation explorer and looked at the channel through test panels. It works just fine there. I'm not feeding the signal into the block diagram with a task I'm doing it through a physical channel.
I'm using a USB-6009 daq, LabVIEW 8.5.1, and DAQmx driver 9.3
Are you sure you are not getting any errors? You are not reporting it. You should have it so that an error can stop your loop and at the very least add an error cluster indicator to your front panel to show any errors that do happen.
The USB-6009 has a maximum sample rate of 48kS/s. You are trying to set it to 100kS/s. That is your problem (and should be getting an error).
It definitely has something to do with the sampling rate, but the behavior is inconsistent. I was able to get it to work with a 1000Hz sampling rate, but now I can't get it to work at all even with sampling rates as low as 100Hz. When it doesn't work the error out indicates an onboard device memory overflow. I've attached a screen shot of the error out indicator. I closed every program on my computer to see if that was the issue, but that didn't help and I have about ~6GB of available memory.
I believe that is an issue with the memory on the DAQ device, not your PC. Try grabbing more samples at a time - use -1 as the number of samples to get all the available samples.
That DAQ probably has a really small buffer on it. Try reading fewer samples at a time. A general rule of thumb is to collect 100ms worth of data at a time. So try reading 100 samples with a rate of 1kS/s. This will also make your loop run faster, so you will be seeing less data on your graph. You might want to replace your graph with a Chart, which keeps a history in it.
I think it is working now. I don't understand why though. If I have 1kS/s as the sampling rate and 100 samples per loop, then data DOES display on a chart. If I have the same sample rate and use -1 as number of samples per channel, it does NOT display on a chart nor does the error out indicate an error. If the daq can read up to 48kS/s why can't it read all the samples in the buffer at a sampling rate of 1kS/s?
If I am understanding the error correctly, it is due to the onboard memory of the DAQ overflowing - the card can handle 48kS/s, but they must be pulled off the card at a high rate. Even if you are sampling at a much lower rate, the onboard memory can still overflow if you dont pull samples off fast enough.
Note you are using a very old version of LabVIEW and DAQmx, so wiring up a -1 may not do what it does now. There are property nodes you can use to get the number of samples available as well.