02-05-2008 09:39 AM
02-06-2008 06:33 PM - edited 02-06-2008 06:33 PM
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.
02-07-2008 02:56 AM
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.
02-08-2008 02:29 PM
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.