Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure frequency from an MIO with external clock?

Hi,
 
I am trying to measure frequency from the counter input of PXIe-6251. The three frequency measurement method works fine with the internal clock of the card.
 
Now I need to measure frequency using an external clock. But the "CI freq" method doesnot allow to configure an external clock. This method works only with the implicit or On Demand timing method.
 
The documents clearly says that we can configure an external clock for measurement.
 
Can anyone put some light on how to configure an external clock with CI Freq method?  If not, measuring CI edges is the only method to configure an external clock and then calculate the frequency from the number of edges (In case of Low freq measurement)?
 
Waiting for replies. Clearly, I use LV8.5, DAQmx, Right now I need to measure a low frequency of 10KHz, My external clock is 10MHz programmable.
 
Thanks
0 Kudos
Message 1 of 4
(3,425 Views)

Hi Vsh,

I tried to configure the Counter Input Frequency Task to include a Sample clock that had an External Clock as its source, but I received the error in the attached screenshot, which confirms the difficulties you described.

I do not believe that you will be able to get this task to work with an external clock. The way the DAQmx driver works for the Low Frequency 1 Counter Task is that uses the input signal as a gate and the internal known timebase automatically as the source. For one period of the input signal, the driver counts the ticks of the internal clock to determine the input’s period in seconds and then performs the inverse behind the scenes to output the frequency measurement.  

With an external clock, the timebase is unknown and therefore you can only count the ticks of the external clock. There is no way for the driver to convert these ticks into a meaning time measurement of which it could take the inverse. I think that you will need to use a Count Events task and the programmatically do the math yourself.

Can you tell me which documents said that you can use an external clock with the Counter Input Frequency Task?

Regards, Mallori M.



Message Edited by mallorim on 02-06-2008 06:33 PM
Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
Message 2 of 4
(3,378 Views)

Hi Mallori M,

Thanks for the reply. I have to admit that I cannot use "CI freq" method to measure the frequency using an external clock. So I got to follow the tick count measurement. Hopefully that works fine for the required application.

I got the information from the link http://zone.ni.com/devzone/cda/tut/p/id/3619 (Measurement Error and Three Frequency Measurement Methods, Method 1). The eample shipped with this method is using a CI freq create virtual channel.vi.

Also M series user manual, Counter section,  Period measurement method describes the same. Though the value obtained in a low frequency measurement method is just an inverse value of the period measurement method.

But the arguement is, why there is no provision for providing an external clock for this type? When a frequency measurement method exists with programming, why is it not provided with the full feature?, does it mean that Internal clock gives the better accuracy than an external?, my external clock has a better ppm than what the DAQ card provides though.

Anyway, thanks once again.

 

0 Kudos
Message 3 of 4
(3,368 Views)

Hi Vsh,

I looked at the documentation that you had specified in your previous post. While this could understandably be misconstrued, these documents are explaining how a period or frequency measurement could be taken with the DAQ hardware, not how the specific Counter Input Frequency instance of the DAQmx Create Channel Polymorphic VI works.

You will notice in the M-series User Manual’s Period Measurement section, it says that “you can route an internal or external periodic clock signal (with a known period) to the Source input of the counter. The counter then counts the number of rising (or falling) edges occurring on the Source input between the two active edges of the Gate signal. You can calculate the period of the Gate input by multiplying the period of the Source signal by the number of edges returned by the counter.”

This means that you can use an external clock with the Count Input Count Edges instance of the Create Channel Polymorphic VI as seen in the example Count Dig Events- Buffered- Finite- Ext Clk.vi and then programmatically calculate the period and then the frequency using the user inputted external clock’s time base. However, in order for the DAQmx Driver to perform the math for you behind the scenes and return a meaningful time measurement instead of a number of ticks, as it does in the CI Freq and CI Period, it can only use the internal timebase for which it has the known value.

To confirm this behavior, I modified the example VI Meas Dig Period- Low Freq 1 Ctr.vi to include an external clock, and received the error that this channel type does not support sample timing.

I hope that this has answered your questions. Regards, Mallori M.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
Message 4 of 4
(3,345 Views)