Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous frequency measuring

I have to measure for frequency signals simultaneously, so that I'm able to associate one measured value to the others. How do I synchronize this? Is this possible with the four counters on a 6601 board? Two of the signals have frequencies up to 15 KHz, two of them go up around 4kHz. I also have a 6014 board with an additional counter available, maybe I could use it somehow...I also have to synchronize the analog acquisition that I perform with the 6014 with the one of the frequency signals, namely a continuous TTL pulse.

Thanks in advance for any help!
0 Kudos
Message 1 of 5
(3,988 Views)
Hi Achim,

Typically, frequency measurements are made using two counters for increased accuracy. However, you can measure frequency using 1 counter and taking the inverse of the period measurement. You would just need to apply this to 4 counters. There should be a shipping example with the NI-DAQ driver that performs this. Here is a link to an excellent tutorial on frequency measurement.

Making Accurate Frequency Measurements
http://zone.ni.com/devzone/conceptd.nsf/webmain/CD2C8AAED8FA59A486256C230078FE75?opendocument

This being said, what I suggest in your case is to use a 6602 counter/timer board with 8 counters, 2 for each frequency measurement. Using a 660x board, you can also use triggering to simultaneously start all counters. This can be
done by routing a signal from the PFI line to the counter trigger using Route Signal.vi in LabVIEW or Select_Signal() in C function calls. Then you would setup a trigger and reference the common trigger signal that you routed the PFI line to. The following discussion thread might be useful:

Counter/Timer Triggering 660x
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=506500000008000000B2300000&ECategory=Measurement+Hardware.Counter%2FTimer

Anyway, I hope that helps. Have a good day.

Ron
0 Kudos
Message 2 of 5
(3,988 Views)
Hi Ron,
thanks for your answer! In addition to another answer in another thread, I was nearly able to solve the problem. I got a example from NI Germany support which was created for a 6602, but was a fine help to start from. My modification works quite good (for a 6601), I only wonder why one of the three counters used always counts one event more than the other two. Could it be, that the first counter sees the trigger earlier than the other two? I attached the example were I used PFI34 as the trigger signal, and all gates share the same signal to be measured.

Thanks again!
Achim
0 Kudos
Message 3 of 5
(3,988 Views)
Hi Achim,

Although all your counters start simultaneously, it is still possible for the source to each counter to encounter propagation delays of different lengths. This is usually not a concern but it has a greater possibility of occurring for faster sources. This propagation delay could also occur on the gate signal.

From looking at your code, it looks like you are using a synchronization filter on your trigger signal. To possibly improve your measurements I would try the 2 following suggestions:

1) Enable a line filter for synchronization on your common gate signal. Perform the exact same operation on the gate signal as you are performing on the trigger signal on PFI 34. This could help align all your gate signals.

2) Enable s
ynchronous counting on all your sources. For each counter configuration (in your for loop), just add a single VI, the Counter Set Attribute.vi with "counting synchronous" as the one parameter and "yes" as the other parameter. This will ensure that each counter receives a pulse synchronized with the 20MHz timebase (if you are using an external timebase).

Hope these suggestions help. Have a good day.

Ron
0 Kudos
Message 4 of 5
(3,988 Views)
Hi Ron,

I tried it, but it did not change it's behaviour at all. I still have one count difference between ch1 and ch2/ch3. Maybe you can have a look to the code again... I tried several combinations, but it did not work. It's not absolutely clear to me, what the Line attribute VI does exactly with it's synchronization input. Could you be so kind and explain this matter a little bit deeper?

Thanxalot in advance

Kind regards
Achim
0 Kudos
Message 5 of 5
(3,988 Views)