LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQ Frequency

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

0 Kudos
Message 1 of 9
(3,461 Views)

I don't understand why you are adding the frequencies over time.  Are you just looking for an average?


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 9
(3,452 Views)

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?

0 Kudos
Message 3 of 9
(3,445 Views)

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.

0 Kudos
Message 4 of 9
(3,443 Views)

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

 

 


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 5 of 9
(3,434 Views)

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

0 Kudos
Message 6 of 9
(3,428 Views)

What is the number being fed to me in the DBL?  Is that frequency?

0 Kudos
Message 7 of 9
(3,426 Views)

You conifgured the DAQmx task to give you Frequency.  So that is what you are getting.


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 8 of 9
(3,404 Views)

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.

0 Kudos
Message 9 of 9
(3,367 Views)