LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency measurements using cDAQ-9178 and NI 9411 module

Solved!
Go to solution

I have been trying to use the NI 9411 device to measure frequency using the cDAQ counters. I have hooked up a function generator to the PFI 1 input on the cDAQ chassis. I configured the DAQ assistant to acquire the counter input on this channel from counter 0. However, when I try to read frequency from the daq assistant I get an error saying the operation did not complete because the time out expires. This happens after about ten seconds. I have tried varying the samples, but I still receive other errors about supplying a source clock. I have used an analog function generator and an arduino to generate a square wave as input to the PFI 1 channel, and I cannot seem to get a frequency reading from this. I have followed the video attached below, and believe the method I used should be working. Is there anything that I am perhaps overlooking. Any help or related examples I could be pointed to would be greatly appreciated. I have spent time looking for a solution to this myself, and have not been able to resolve it.

 

https://www.youtube.com/watch?v=0Cjeq1Z3Dz4

0 Kudos
Message 1 of 4
(3,086 Views)
Solution
Accepted by topic author Gage_Haas

It'd help to see your code, preferably back-saving to LV 2014 or so (many of us go some years between version changes).

 

Instead of a DAQ Assistant, first go to "Help-->Find Examples...".   Find an example named something like "Counter - Read Pulse Width and Frequency (Continuous).vi".  Configure for your device and signal connection -- make sure to select the tab for measuring Frequency.   See whether this example works for you.

 

If so, open it up and look inside.  Try to learn how to use the regular DAQmx functions you find there.  In the medium and long run, they offer much more capability and configurability than the DAQ Assistant.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 4
(3,068 Views)

I have tried opening up multiple examples as you suggested and I receive this error with all of them. 

 

Error 200284

 

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

 

When I try to run the Vi I attached I receive this error. 

error 200474

Specified operation did not complete, because the specified timeout expired.

 

I am reading a signal as 100 Hz from my arduino with a multimeter. The arduino signal is connected to the PFI 1 channel and counter 0 is configured for use. I am not understanding why I am not able to run these example VI's or the example in the video linked above. 

0 Kudos
Message 3 of 4
(3,060 Views)

Can't say for sure yet, but the symptoms are consistent with a signal that isn't TTL-compatible.  For example, a 5V square wave should allow frequency to be measured while a 1 V square wave would show the symptoms you've described so far.

 

Another example you could try is "Counter - Count Edges.vi", specifying PFI1 as the Input Terminal.  This should give a further clue.  Counting edges is one of the simplest things a counter can do.  If it works well, that's an indication that the signal is TTL compatible.  If not, probably not.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 4
(3,049 Views)