04-14-2011 12:50 PM
Hi Everyone,
I am new to the cDAQ world and am currently just trying to get a frequency output from a chopper TTL signal. I confirmed the frequency at 23 Hz on an oscilloscope. It is a nice clean 5V square wave, but when I try to measure the frequency in labview using an example VI (measure dig frequency continuous), it just times out. Trying to look at the signal input in signal express shows an inconsistent digital signal that is around 3 Hz and clearly the result of the port being polled for input too infrequently. The end goal is to get this working with the labview PLL vi's for a detector lock in amplifier, but first I have to be able to measure and read out this frequency properly.
My hardware is a cDAQ-9174 with a NI 9402 for use with the digital input. I'm not sure it matters, but the 9402 module is in slot 3 and i am using channel 0. Software is labview 8.2 with DAQmx 9.1. Is there some hardware timing issue or setting I am missing here? Any help is greatly appreciated, thanks!
Solved! Go to Solution.
04-14-2011 03:14 PM
Hi Skaboss,
Counters have multiple terminals (source, gate, aux, and out), which map to separate PFI lines on your NI 9402. For frequency measurement, the default input terminal depends on the measurement method (low frequency, high frequency, large range). Here's the relevant section of the NI-DAQmx Help (which is located on the Start Menu):
The following table lists the default input terminals for various counter measurements. You can use a different PFI line for any of the input terminals. To change the PFI input for a measurement, use the NI-DAQmx channel attributes/properties.
| Measurement | Ctr0 | Ctr1 | Ctr2 | Ctr3 |
|---|---|---|---|---|
| Count Edges | Edges: PFI 0 Count Direction: PFI 2 |
Edges: PFI 3 Count Direction: PFI 1 |
Edges: PFI 1 Count Direction: PFI 0 |
Edges: PFI 2 Count Direction: PFI 3 |
| Pulse Width Measurement | PFI 1 | PFI 2 | PFI 3 | PFI 0 |
| Period/Frequency Measurement (Low Frequency with One Counter) | PFI 1 | PFI 2 | PFI 3 | PFI 0 |
| Period/Frequency Measurement (High Frequency with Two Counters) | PFI 0 | PFI 3 | PFI 1 | PFI 2 |
| Period/Frequency Measurement (Large Range with Two Counters) | PFI 0 | PFI 3 | PFI 1 | PFI 2 |
| Semiperiod Measurement | PFI 1 | PFI 2 | PFI 3 | PFI 0 |
| Two-Edge Separation Measurement | Start: PFI 2 Stop: PFI 1 |
Start: PFI 1 Stop: PFI 2 |
Start: PFI 0 Stop: PFI 3 |
Start: PFI 3 Stop: PFI 0 |
| Position Measurement | A: PFI 0 B: PFI 2 Z: PFI 1 |
A: PFI 3 B: PFI 1 Z: PFI 2 |
A: PFI 1 B: PFI 0 Z: PFI 3 |
A: PFI 2 B: PFI 3 Z: PFI 0 |
You can also override the default with the CI.Freq.Term channel property.
Brad
04-14-2011 05:39 PM
Thanks Brad,
Took me a bit to figure out what was going on. I had figured that setting to counter zero on the module meant I would be needing to have the input at the 0 channel for the BNC input. Got the system hooked up to input 1 for low frequency measurement with counter 0 now and it is working great. Thanks again!
~Dylan