LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set divisor and Measurement time for accurate frequency measurement?

Hi I am using PXIe 6368 DAQ. Could you please let me know how should I set the divisor and Meas time to have a accurate reading for frequency reading from 160kHz to 5Mhz.

 

Is there a relation between eastimated frequency and  divisor and Meas time? How can I set resolution?

 

Untitled.png

0 Kudos
Message 1 of 8
(3,145 Views)

sorry I forgot my other question. How can I meas frequency of multiple lines at the same time?

For example can I use the frequency of PFI0 and PFI1 if I output PXI1Slot2/PFI0,PXI1Slot2/PFI1 to the CI.Freq.Term

 

Thanks

0 Kudos
Message 2 of 8
(3,144 Views)

The X Series user manual has a good section describing the various counter frequency measurement methods and their accuracy (see Choosing a Method for Measuring Frequency here).

 

I would suggest to use the sample clocked method instead of the large range method for consistent accuracy and measurement times across your range of frequencies.  The biggest downside is that if the input signal drops below the frequency of the sample clock this results in a hardware error and you must restart the task (this shouldn't be an issue for you since you said 160 kHz minimum, but some people get the idea that they want to measure from 0 Hz on up and don't understand why measuring 0 Hz isn't possible).

 

To measure multiple inputs you will need to use one counter for each input.  You can do this by creating a separate task for each counter.  If you use the sample clocked method you might need to use a third counter to generate the sample clock at the desired rate (or if you have a sample clock available from the AI subsystem for example and want to sync the measurements you could do that instead).

 

 

Best Regards,

John Passiak
0 Kudos
Message 3 of 8
(3,132 Views)

Hi John, than you for your help. 

 

Unfortunately all the DAQ lines are accupied and I don't think I can use any of the lines as an External clock for sample clock method

 

The other problem is each PFI line supposed to measure frequency of 1 DUT and 6368 just has 4 counters . Does it mean that I can max meas frequency of 4 PFI lines?  I need to be able to measure frequency of all 16 DUTs ( connected to 16 PFI lines ) at the same time?

 

 

 

 

0 Kudos
Message 4 of 8
(3,113 Views)

A quick lock at the spec told me that you migth be able to stream your 16 channels with 10MSPS ...

Critical @5MHz 😉

but with a more envolved algorythm than just counting the pulses .....

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 8
(3,086 Views)

The sample clock may be routed internally so that's not a dealbreaker.

 


@ethen99 wrote:

I need to be able to measure frequency of all 16 DUTs ( connected to 16 PFI lines ) at the same time?

  


 

People always mean different things when they say this.  If you are OK with stopping/starting the tasks and stepping through each PFI line then you could use the counters (the wiring wouldn't have to change at all since you may specify the input terminal for each counter measurement).  The measurements wouldn't be taken "at the same time" but within a few hundred ms or so of each other.  It sounded like each input has a continuous frequency source attached to it so if this is true then it seems that sampling each input sequentially (in groups of 4 most likely) would be perfectly acceptable.


While the 6368 can accomodate up to 32 digital input lines at a 10 MHz sample rate, you'll have a rough time measuring your 5 MHz signal with any degree of accuracy using the DIO.

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 8
(3,072 Views)

Hi John, could you please show me how can I implemnet the averaging method? I searched for it but I couldn't find any example

I might be ok with Large range method but then for any frequency value I need to change my meas time and divisor value but sounds like using averaging I don't need to change anything and I still have the least error

 

For example I see when the frequency is 50k then the divisor is 50 and when it is 5Mhz then the divisor is 5000. So I thought maybe I can use the following rule 

 

frequency less than 1000---------->Low frequqncy with 1 counter

1000 to 5000..................> Large range with 2 counters ...divisor=5

5000 to 50000..................> Large range with 2 counters ...divisor=50

50000 to 500000..................> Large range with 2 counters ...divisor=500

500000 to 5000000..................> Large range with 2 counters ...divisor=5000

 

Could you please let me know if you think I can use these values ? 

Thanks

 

0 Kudos
Message 7 of 8
(3,060 Views)

The two counter methods have generally fallen out of favor now that the sample clocked method is available with newer STC-3 based devices (though certain specific circumstances might still dictate their use).  This is the sample-clocked method I was talking about (adapted to run on all 16 input terminals, averaging is on by default):

 

MultiPFICtrFreqRead.png

 

 

The sample clocked method does not require setting a divisor--it will give you good accuracy and a uniform sample rate at all mesaurement frequencies.  

 

A lower sample clock rate would give more accuracy, but at the cost of an increased measurement time.  In the example above I used freqout to generate the sample clock which has a minimum rate of 6250 Hz--you could use one of the other counters and go lower if you wanted to (accuracy calculations are in the X Series User Manual linked in my earlier post), iterating through all 16 channels only took about 50 ms total on my PCIe X Series.

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 8 of 8
(3,044 Views)