Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Why I got the wrong frequency value when I use TCWCounter Component to check PCI0 pin in the 6025E card?

Hi,

I try to check the frequency input from the PFI0 pin in the 6025E card. I use VB sample code (freqmeas.zip, I download from this website) to get it. I changed 'CWCounter1.TimebaseSource = cwctrPFITB' and
added 'CWCounter1.TimebaseSignal = 0'.

The source code is as
CWCounter1.MeasurementType = cwctrFrequency
CWCounter1.TimebaseSignal = 0
CWCounter1.GateWidth = 1#

CWCounter1.Configure
CWCounter1.Start

If I input 10 Hz into PFI0 pin, I got the value '38-40 Hz' from my program. And if I input 1K hz, I got '3.7k - 3.9k'. That is almost 3 times to the actually frequency value and the result is ramdon.

I don't know what any other things I
should do if I want to get the acurate and stable frequency value.

Bird
0 Kudos
Message 1 of 2
(3,394 Views)
Bird,

My thought is that the signal you are wiring to the PFI0 pin may be noisy. You can try putting the example code back to its original state and wiring the 10 Hz signal directly to the counter source to see if you get the same results. Use a function generator for testing, if you aren't already.

Also, try running the C:\Program Files\National Instruments\NI-DAQ\Examples\Visual Basic\Counter\Pulse and Period example. Then, frequency = 1/period. Since this is such a low frequency signal, this should be acceptable. This will at least give you some more data as to what might be going wrong. I hope this helps!

Regards,

Geneva L.
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 2
(3,394 Views)