11-29-2018 04:41 PM - edited 11-29-2018 04:47 PM
I'm attempting to acquire the pulse frequency of my digital flowmeter. I have the FM signal routed to DIO0 on a NI 9402 module. When I use a 'digital input' virtual channel, I can see the flowmeter data coming through on a digital waveform graph. In an effort to simplify things, I'd like to take it a step further and use the 'counter input' virtual channel type to directly read pulse frequency -- however when I run this through DAQmx read, I'm not seeing any data (read.vi just times out). My digital signal experience is pretty limited, so I'm sure I'm missing something obvious. Does anyone know what edits I can make in order to read pulse frequency directly?
In other words: Method 1 (DI) shows me successfully acquiring data, but requires post processing to obtain pulse frequency. Method 2 (CI) does NOT show successful acquisition of data.
Note: I've sifted through various examples and forum posts, but haven't been able to solve my issue. I've attached my VI below. Thanks!
11-30-2018 12:59 PM
Hi PFour,
As a place to start I would recommend using the example program Counter - Read Pulse Width and Frequency (Continuous), found at Help>>Find Examples>>Hardware Input and Output>>DAQmx>>Counter Input. The main difference looks to be the DAQmx Timing VI setting, which ought to be implicit for counter input.
Regardless, the example program should give you a great place to start.
Best of luck.
11-30-2018 05:30 PM
Hey Kevin.MN,
Thanks for the suggestion. I've looked through that example pretty thoroughly and unfortunately, even that won't generate data for me -- very weird. I made the timing.vi change to "implicit" but with no luck. When I probe the lines in my while loop, I can see that the loop is iterating, but there is absolutely no data being pumped out of the read.vi.
Again, normally I would assume this is a hardware/ harnessing issue or something of that ilk, however when I use a DI channel instead of a CI channel everything works perfectly (but requires post processing in order to get my desired parameter, pulse frequency). It's all very strange -- seems as if the pulse frequency option for CI channels flat out doesn't work... hate to be that person who blames the hardware.
Also, the fact that even the 'Counter - Read Pulse Width and Frequency' example doesn't generate data when I know that data is flowing has me scratching my head.
12-03-2018 06:14 AM
I'll bet you're getting an error. You should let your terminate on either an error *OR* the stop button, and then also show that error somehow (front panel indicator, simple error dialog, etc.). But it's hard to give advice on fixing an error unless we know what it is.
-Kevin P