The frequency of a digital signal is the rate at which the period occurs, where the period is the time between either rising or falling edges, or the inverse of the period with a unit of Hertz (Hz). The frequency of a digital signal can be extremely useful in a wide variety of applications, from determining speed or angular velocity to decoding the intensity of a light source. Use LabVIEW and CompactRIO to program your C Series Digital Module to transfer the digital signal to the FPGA, which uses a period decoding algorithm. The period is then transferred to a host application, which extrapolates the frequency. After you acquire the frequency, you can map it to a known physical phenomenon.
Once again, by programming frequency input tasks in LabVIEW FPGA, you can increase the number of FPGA input tasks compared to NI-DAQmx. This may be especially useful, as some frequency input tasks require two counters.
Figure 5. Period and Frequency of a Digital Signal
The following example describes how to implement frequency measurements using LabVIEW FPGA and a CompactRIO system. The example uses Boolean logic to determine when an edge occurs and then uses the FPGA clock to determine the time between pulses. This example can be found in the Example Finder by going into LabVIEW and navigating to:
LabVIEW 2013 and later: Hardware Input and Output»CompactRIO»Signal Generation and Processing»Digital»Period and Phase Measurement»Period and Phase Measurement.lvproj.
LabVIEW 2012 and earlier: Hardware Input and Output»CompactRIO»FPGA Fundamentals»Counters»Frequency Measurement»Count and Period – cRIO.lvproj.
Configuring Your Frequency Measurement
- Physically connect signal of interest to a digital line.
- Modify the block diagram of the Count and Period (FPGA) VI with the digital input channel of the physical signal to replace the A and B Boolean controls.
- Run the VI to compile it and use it in interactive mode.
Figure 6. Determine the Period and Frequency of a Digital Signal