Raphael,
Very interesting... Yes, the theory sounds reasonable and it's an approach I hadn't thought of. Thanks for a new idea!
Further, yes, you should be able to set up both counters to start of a single hw trigger signal. At least that's what the help file says. I haven't verified it myself with an M-series board. The only reason I hesitate is that some of the M-series brochures and datasheets also mention a digital input capability (change detection) that isn't yet supported by NI-DAQ.
However, there's still a tricky part. Even if both counters start simultaneously, there are 2 more issues to deal with:
1. Your theory depends on counting cycles of the 80 MHz clock during *exactly* 350000 full cycles of your external signal. That's slightly different than the easier problem of counting during exactly 350000 rising edges. Depending on the phase of your external signal when you start, 350000 rising edges could mean anywhere from 349999.00001 to 350000.99999 full cycles. Combine that with the corresponding +/- 1 count from your other counter and your resolution becomes more like 15 Hz again.
So it would appear that you need to trigger your counters to start off the same edge of your external signal that you will use to count. However, this would create a race condition in the electronic circuitry. I'm not sure whether the edge that activates the trigger would also cause the count value to increment or not. And I'm also not sure if the result of the race would be consistent.
2. You also need both counters to stop at the same time. However, there are no "stop triggers" available. I started thinking of different weird ways to try to handle this, but then I had a better idea (I think)...
I think you can accomplish this with a single counter! Here's an outline:
A. Configure for continuous buffered edge counting. Use your external signal as your sample clock ("Gate") and the 80 MHz timebase clock as your source signal. You will need to make a big buffer because you'll be transferring data into it at 5 MHz. I'd suggest a size of about 1 or 2 million. Don't worry, you won't be processing this buffer.
B. Now every edge of your external signal stores a 80 MHz count value in the buffer. And you can know that values that are 350000 indices apart should have counts that differ by 5,600,000 when your signal is exactly 5 MHz.
C. I'm not 100% certain of the syntax for this part but I'll describe the idea. When you want to measure, query for the index of the "Most Recent Sample" using a DAQmx Read property node. Then use that index to actually read 2 specific values from the buffer. One can be at an offset of 0, the other would be at an offset of -350000. The difference between these values should be close to 5,600,000.
D. Two neat things -- 1. Even when the counter rolls over after ~54 seconds, the subtraction you do should still result in 5,600,000. 2. You can loop on step C as fast as you like. Essentially you'd be getting an average frequency over a sliding window of your signal.
Hope this helps. Post back as needed.
-Kevin P
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.