Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter issues with cDAQ-9172 and 9401

I'm trying to do a pulse count with a 9401 module in a cDAQ-9172 system. My problem is that the count always ends up in the 30 kHz range, when it should be in the range of 1 kHz - 5 kHz. Furthermore, the pulse count doesn't change even when the input pulse frequency is changing. I've used a multimeter to verify that the input signal is pulsing at the expected frequency. It seems like the system is counting the wrong thing (maybe defaulting to some sort of internal timing device?), but I can't figure out what it is or how to fix it.
 
Any advice would be much appreciated.
0 Kudos
Message 1 of 5
(5,160 Views)

Hello,

How have you programmed your application?  I would start out by eliminating the possibility that this is a hardware configuration problem by creating a task in NI Measurement & Automation Explorer (MAX) and testing it from there.  To do this, right-click on your 9401 in MAX and select Create Task.  When the task configuration window comes up, select Acquire Signals >> Counter Input >> Frequency.  Once you have finished setting the task up for one of the counters on your 9401, right-click on the newly created task and select Run.

For more information about the different frequency measurement methods available with the cDAQ-9172, see page 41 of the NI cDAQ-9172 User Guide and Specifications.

Once you have tried this out let me know what you find out.  And don't hesitate to ask if you have any questions. Smiley Happy

0 Kudos
Message 2 of 5
(5,140 Views)
Thanks for the response. MAX basically confirms what I've been finding.
 
Some more specifics:
 
I have two counters set up, only one of which should be getting a signal at a time. When I connect a function generator sending a square wave to one of the counters, that counter reads the correct frequency and the other counter reads zero - exactly what should happen. When I connect the signal I'm trying to measure to an oscilloscope, it shows a square wave with the frequency I'm expecting. However, when I connect the signal to one of the counters, that counter reads the wrong frequency, and the other counter is counting pulses when it shouldn't be receiving anything at all. The only thing I can think of at this point is that somehow my signal is creating some kind of noise that causes incorrect measurements on both counters, but this doesn't make a whole lot of sense to me, as the oscilloscope shows a pretty solid square wave. In fact, the signal doesn't really look appreciably worse than the output of the function generator. Even if there were some noise, it would have to be pretty severe to affect the edge count, I believe.
 
Essentially, I've been able to convince myself that the incoming signal signal is an acceptable square wave with the expected frequency, and that the DAQ system is capable of counting pulses on a similar square wave when it comes from a function generator. Somehow, when I try to combine the two it doesn't work, so I'm at a loss at this point.
0 Kudos
Message 3 of 5
(5,132 Views)
Which frequency measurement method are you using?  Some of the frequency measurement methods do use two counters.
0 Kudos
Message 4 of 5
(5,102 Views)
The measurement uses only one counter. I've also tried using a simple event counter and timing the measurement.
 
At this point, I've pretty much determined that the problem is noise from a motor controller in the lab setup. My next step is to look into various filters that I might be able to use.
0 Kudos
Message 5 of 5
(5,098 Views)