06-19-2014 01:32 AM
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
Solved! Go to Solution.
06-19-2014 07:05 AM
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.
06-19-2014 05:51 PM - edited 06-19-2014 05:55 PM
06-19-2014 05:54 PM
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).
B. I placed the DAQ assistant within the loop and changed the setting to 'Continous Samples'.
Samples to Read: 1k
Rate (Hz): 1k
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.
06-19-2014 06:22 PM
06-19-2014 06:53 PM
Okay.. this is the input portion of my VI.
It goes Input -> Read -> Buffer/Collector -> Trigger -> Append -> Measurements/graph
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
06-19-2014 07:25 PM
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.
And here is my DAQ Assistant settings:
06-19-2014 07:37 PM
06-19-2014 08:09 PM - edited 06-19-2014 08:24 PM
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?
06-20-2014 06:50 AM
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.