05-31-2016 11:56 AM
Hey LabVIEW community. I'm working on trying to read Frequency. However, my results don't necessarily make sense to me and maybe there's something I am missing. I am using NI 9421 as my DI and its max Clock Rate is 10 kHz. But I am using onboard counter. I have posted a FP displaying results with the settings and a BD of the of the code (FYI: made it from frequency example). Also attached the code. My results surprass 10 kHz. Am I not understanding something? I plan to use a faster DI module cuz I believe I need minimum 100 kHz. Also, the DO is NI 9472. Am I just reading noise? VI is in 2014
05-31-2016 12:02 PM
I don't understand why you are adding the frequencies over time. Are you just looking for an average?
05-31-2016 12:04 PM
Yes, I did that for definitive per second cuz I don't trust my data. But I don't trust that data either. 218k samples?
05-31-2016 12:05 PM
Daily Dose,
Your signature block is looking for an image at http://www.labvolution.com/wp-content/uploads/2014/03/Certified-LabVIEW-Developer_rgb.jpg that seems to be a broken link. You may want to update your signature. If you have an image to show, put it in your image library on the NI website rather than a third party website.
05-31-2016 12:11 PM
@DailyDose wrote:Yes, I did that for definitive per second cuz I don't trust my data. But I don't trust that data either. 218k samples?
The card is giving you raw frequency. You should not have to do any manipulation on it. Your math would work if you were using the counter to give you COUNTS.
Let's show the math of units:
Adding all of the frequencies together gives you Pulses/sec. Now divide that by seconds and you get Pulses/Sec^2. Nope, that is definately not a proper frequency.
If instead, you did counts: Pulses divided by number of seconds gives you Pulses/Sec. Hey, that is a proper frequency unit!
I would trust the hardware counter to give you a true frequency a lot more than using a software timer.
05-31-2016 12:20 PM
@crossrulz wrote:
@DailyDose wrote:Yes, I did that for definitive per second cuz I don't trust my data. But I don't trust that data either. 218k samples?
The card is giving you raw frequency. You should not have to do any manipulation on it. Your math would work if you were using the counter to give you COUNTS.
Let's show the math of units:
Adding all of the frequencies together gives you Pulses/sec. Now divide that by seconds and you get Pulses/Sec^2. Nope, that is definately not a proper frequency.
If instead, you did counts: Pulses divided by number of seconds gives you Pulses/Sec. Hey, that is a proper frequency unit!
I would trust the hardware counter to give you a true frequency a lot more than using a software timer.
This is basically what I'm asking. What is the data I am getting from the cDAQ? I thought the cDAQ was essentially giving me a number of pulses/samples. If that's the case, the my math is essentially right and follows this:
A summation of X Pulses/Sec over a span 10 Seconds is equivalent to (X Pulses/Sec)*(10 Secs) = 10X Pulses
I then divide by 10 seconds = (Avg)X Pules/sec
(Granted, this is now how I'd write Summation and etc. but you get the gist)
I don't understand how that's wrong.
05-31-2016 12:21 PM
What is the number being fed to me in the DBL? Is that frequency?
05-31-2016 02:01 PM
You conifgured the DAQmx task to give you Frequency. So that is what you are getting.
06-01-2016 10:56 AM
This is true. But I wasn't sure if the output was counts per sample or frequency per sample. So if it's frequency (which makes sense) then that means my math is wrong. Ok, I'm on board now. Thank you.