This example demonstrates how the NI PXI-6652 and PXI-6653 inputs can be used with different families of digital logic by varying the threshold value. It takes a periodic digital signal (such as a clock or a pulse train) on the PFI0 port of an NI PXI-6652 or PXI-6653 and counts rising edges across a user-defined threshold voltage. It uses the FPGA on these devices to count these edges and, based on a timed-loop in the FPGA code, measures period and frequency. The threshold can be set to several common, predefined values, or the user can set his own custom threshold.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.