LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform graph not displaying data

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

0 Kudos
Message 1 of 8
(1,765 Views)

Well a graph can't display data if there is no data to display! 

 

Are your DAQ functions returning any errors?

0 Kudos
Message 2 of 8
(1,760 Views)

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).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 8
(1,755 Views)

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.

0 Kudos
Message 4 of 8
(1,736 Views)

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.

0 Kudos
Message 5 of 8
(1,731 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(1,727 Views)

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?

0 Kudos
Message 7 of 8
(1,714 Views)

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. 

0 Kudos
Message 8 of 8
(1,711 Views)