This example shows how to do a buffered edge counting task using another counter on the same board to generate the sample clock.
This example was developed for the PCI-6602 but is applicable to all boards with two counters that support buffered acquisition.
The rate at which the count is sampled must be the same as the clock used in the counter input task. The onboard clocks cannot be used because they are too fast for this task. Instead of using an external clock to solve this problem, a second counter can be used to generate the clock at a specified sampling rate.
LabVIEW 2009 SP1 or compatible
DAQmx 9.0 or compatible
Most DAQ cards with counters
Steps to Implement or Execute Code
1. Generate a pulse train using a counter output task. Set the frequency of the pulse train equal to that at which you want to sample the edge count.
2. Create an edge counting counter task.
3. For the sample clock, choose the output of the counter used to generate the pulse train. Some cards allow you to route this internally. For others, an external wire may be required.
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Tanya Visser National Instruments LabVIEW Group Manager
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.