LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual Oscilloscope; Slow Data Acquisition (5 Hz limit)

Solved!
Go to solution

Hi..  I have been trying for some time now to program a virtual oscilloscope using Labview software and the USB-6009 DAQ hardware.  

 

This has been my best attempt to date:  http://www.andthenbam.com/FievelScope.vi

 

I seem to only be able to measure frequencies up to 5 Hz, then signal frequencies begin to repeat themselves.  I am aware that this device is capable of MUCH faster speeds. I would appreciate it if anyone could take a look at my VI and recommend a fix.

 

Acquisition mode: 1 Sample (on demand)

Buffer: 100 samples

 

I have not been successful in getting any of the other acquisition modes to work.  Please help!

 

Here I am explaining my problem:

http://www.youtube.com/watch?v=k8oI9mL8ZD4

 

Ty

0 Kudos
Message 1 of 11
(4,109 Views)
Solution
Accepted by topic author Fievels

Your problem is that you are setup to do a single sample on demand.  This means that you are counting on the loop to set your acquisition rate.  You likely actually want Continuous Samples with a rate that is much higher, depending on what you are trying to capture.

 

It looks like you are trying to sample every 100ms.  That is 10Hz.  So based on Nyquist, 5Hz is the maximum frequency you can sample.  Anything more than that will alias down into the 0-5Hz range.


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 2 of 11
(4,081 Views)

 

 

0 Kudos
Message 3 of 11
(4,057 Views)

Hi.  Thank you for your thoughtful response CrossRulz.   I attempted your solution with mixed results.

 

So, here is what I did:

 

1.  I changed the input to a 60Hz power supply, so that I could focus solely on the acquisition rate.

 

A.  I tested the signal using the On-Demand setting that I had been using and received random frequencies between 1 and 5 Hz (Figure 1).

 

onDEMAND.jpg

 

 

 B.  I placed the DAQ assistant within the loop and changed the setting to 'Continous Samples'.

 

Samples to Read: 1k

Rate (Hz):  1k

 

continous.jpg

 

I received a much smoother signal, but the frequency still reads 0.5 Hz.

 

I will continue to be working on this issue if there any further suggestions.

 

0 Kudos
Message 4 of 11
(4,055 Views)
Can you post an image of the block diagram and please don't use some odd third-party site. Attach the image to this board.
0 Kudos
Message 5 of 11
(4,039 Views)

Okay.. this is the input portion of my VI.  

 

It goes   Input ->  Read -> Buffer/Collector -> Trigger -> Append -> Measurements/graph

 

 

 

Block_Diagram.png

 

 

I have been focusing on trying to get the input signal to read at a fast enough rate.  When switching from on-demand to continous, the DAQ assistant gets placed in its own little loop.

 

Also, I think the weird third-party sight you are referring to is my blog.  I posted the VI there because it is a convenient server to store and share files.  Wasn't trying to promote or anything.

 

Ty

 

 

0 Kudos
Message 6 of 11
(4,031 Views)

This is an image of what I get when inputing a 60-Hz AC signal from the wall.  As crossrulz pointed out, it must be reading at 10 Hz and aliasing a 59.97 Hz signal down to 4.97 Hz.

 

FievelscopeLimit.png

 

 

And here is my DAQ Assistant settings:

 

settings.png

 

0 Kudos
Message 7 of 11
(4,025 Views)
None of that makes any sense. The first image has a DAQmx Read with 1 sample and your DAQ Assistant is set for the very low rate of 120 Hz. That's not even close to the max sampling rate. Your number of samples should be less than or equal to the sample rate.
0 Kudos
Message 8 of 11
(4,017 Views)

I'm sorry..  I haven't been consistent with the pictures I uploaded.  It's because I am experimenting with the DAQ assistant, trying different input configurations.  

 

I forgot to change it back to Sample to read: 1k and Rate: 1kHz.

 

..so everybody seems to agree that it is an issue with the DAQ assistant settings? 

0 Kudos
Message 9 of 11
(4,007 Views)

First of all, you really should get away from the DAQ Assistant.  Use the actual DAQmx VIs.  They will make things easier to see what is happening and you won't have nearly as much overhead.

 

Secondly, your frequency measurements are way off because of your initial Build Waveform.  You have the dt hardcoded to 0.1.  That needs to match the rate of your sampling.


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
Message 10 of 11
(3,980 Views)