LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Measure Change Detection Frequency in LabVIEW

Hello NI Community,

I am working on a LabVIEW program using a NI PCI-6224 DAQ to detect digital input changes. My current setup:

  • Digital Input Lines: port0/line0:15
  • Change Detection Line: port0/line29 (configured for rising edge detection)
  • DAQmx Timing: Configured for Change Detection
  • Data Visualization: 3D Scatter Plot

Now, I need to measure the frequency of change detection events (i.e., count the number of rising edges per second).

Current Implementation:

  • DAQmx Create Channel (Digital Input) to read port0/line0:15.
  • DAQmx Timing (Change Detection) to trigger on rising edges.
  • DAQmx Read (Digital 1D Bool 1Chan 1Samp) to capture data when a change occurs.
  • Processing & Visualization: Converting digital input into values and plotting a 3D Scatter Plot.

Questions:

  1. How can I count and store the number of rising edges per second?
  2. What LabVIEW functions should I use to measure frequency accurately?
  3. Should I use Tick Count (ms), Elapsed Time VI, or another approach to calculate frequency?
  4. How do I efficiently store the previous count and calculate the event rate dynamically?

I have attached my current LabVIEW program for reference. Any guidance, example VIs, or best practices would be greatly appreciated.

Thank you for your support!

0 Kudos
Message 1 of 2
(173 Views)

3.  Should I use Tick Count (ms), Elapsed Time VI, or another approach to calculate frequency?

Use another approach.  Measure the frequency much more precisely and accurately with a counter task.  Do this and the answers to your other questions follow along.

 

Open up a shipping example "Counter - Read Pulse Width and Frequency (Continuous)".  In the example, right-click the 'Frequency Input Terminal' input and select "IO Filtering".  Then check the box to "include advanced terminals."  Maybe also limit to your desired device.  After this, the drop down menu will make available an internal signal called the "Change Detection Event".  Select that and start running the example.

    Then run your change detection app which will start causing change detection event signals to pulse, and the example will measure the intervals between them and report them out as frequencies.

 

 

-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.
Message 2 of 2
(146 Views)