Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxCfgImplicitTiming vs frequency measure accuracy

Hi,
 
I am trying to measure the frequency of a digital input. Its duty cycle varies a little but the total width of 18 pulses is always fixed. I tried to follow the example of "Dig Freq-Low Freq 1 Ctr" but it seemed the width of 18 pulses varied obviouly which is wrong. Then I tried another example "Buff Semi-Period-Finite" and this time the result was correct. I compared the two examples and found that the main difference is there is DAQmxCfgImplicitTiming func in the latter example. Then I added DAQmxCfgImplicitTiming to the "Dig Freq-Low Freq 1 Ctr" and now it works correctly. So my question is what DAQmxCfgImplicitTiming is for? How come it can improve frequency measure accuracy? Please give me some details instead of the simple instruction in the C reference help.
 
Thanks.
David
0 Kudos
Message 1 of 7
(5,101 Views)

Hi David,

I’m assuming that you are talking about the DAQmx Timing VI in its Implicit instance. The Implicit instance is used for signals that already have their own timing information associated with them; the DAQmx driver ignores any sampling clock information and is used for operations such as period/frequency measurement. This essentially places the fastest available digital clock on the counter source (by default this is the 20Mhz time base). This ensures you have the most accurate readings.

Hope this helps!

Abhinav T.

Applications Engineer

National Instruments

Abhinav T.
Applications Engineering
National Instruments India

LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Measurement Fundamentals
Message 2 of 7
(5,095 Views)

Hi,

Actually, I set the counter source to be the 20MHz time base in my program. The main concern is that the frequency measurement result differs so much with and without the DAQmxCfgImplicitTiming setting. With it, the accuracy can reach about 0.01% accuracy, but without it, only 0.1% accuracy can be achieved. That's why I am confused when I should use DAQmxCfgImplicitTiming and when not. In some examples like "Dig Freq-Low Freq 1 Ctr" and "Pulse Width", this function is not used, while in others like "Dig Periods-Buff-Cont-High Freq 2 Ctr" and "Dig Freq-Buff-Cont-Large Range 2 Ctr", it is used. Is there a guideline when it should be used and when shouldn't?

Thanks a lot.

David

0 Kudos
Message 3 of 7
(5,088 Views)
David,

The Implicit timing should be used in Buffered counter measurements. This DevZone article has more details about this.

Abhinav
Abhinav T.
Applications Engineering
National Instruments India

LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Measurement Fundamentals
Message 4 of 7
(5,068 Views)
From what I understand, am I right to say if I want to use DAQmxReadCounterF64 to get more than one counter data, I should use DAQmxCfgImplicitTiming, and if I use DAQmxReadCounterScalarF64, then no need to use DAQmxCfgImplicitTiming?
 
David
Message 5 of 7
(5,065 Views)
David,

I aplogize if my previous posts have been confusing, but here is how you should be configuring your DAQmx tasks:

- you should use implicit timing when doing any buffered counter measurement: so this includes a continuous or finite acquisition of counter measurements
- as such if you are performing a single 1 sample acquisition of data on the counters, you should not use implicit timing as it does not perform the timing measurement accurately (the counter does not start counting at the correct point)
- the DAQmxReadCounterScalarF64 function and DAQmxReadCounterF64 functions don't have an effect on the timing. You can use either depending on whether you are doing buffered measurement or not
- the difference between these two functions is that the ScalarF64 function returns the raw tick count for a frequency or period measurement. This is the count the counter returns when comparing your signal to the 20Mhz timebase. The other function makes the transformation from raw tick count to an actual frequency or period measurement (in Hz or seconds)

I hope this clears things up,

Abhinav
Abhinav T.
Applications Engineering
National Instruments India

LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Measurement Fundamentals
Message 6 of 7
(5,048 Views)
Yeah, this time I understand clearly. Thanks a lot!
0 Kudos
Message 7 of 7
(5,044 Views)