Setting up Two-Edge Separation Measurements for the NI 6602

Publish Date: Jul 22, 2015 | 0 Ratings | 0.00 out of 5 | Print | Submit your review

Overview

NI Counter/timer boards with the NI-TIO chip (such as the NI 660x boards) do not directly support stop triggers (or reference triggers). However, counting the number of digital edges between a start and stop trigger (on different lines) is possible using a Two Edge Separation task.

 Follow the steps below to implement this functionality.

  1. Place the DAQmx Create Virtual Channel VI onto the block diagram. This VI is located on the functions palette under Measurement I/O » NI-DAQmx » DAQmx Create Virtual Channel. Using the polymorphic selector at the bottom of the icon, choose Counter Input » Two Edge Separation.
  2. Next, right click on the units input of the DAQmx Create Virtual Channel VI and select Create » Constant. Change the enumeration to Ticks in order to count the number of incoming digital edges between start and stop pulses (instead of the time between those pulses).
  3. Third, use the DAQmx Channel Node located on the functions palette under Measurement I/O » NI-DAQmx » DAQmx Channel Node. The Counter Input » Two Edge Separation » First » Input Terminal and Second » Input Terminal specify the start and stop pulse lines respectively. The Counter Input » General Properties » Counter Timebase » Source specifies the physical line to measure digital edges on (between start and stop pulses).
  4. Next, place the DAQmx Timing VI onto the block diagram. This VI is located on the functions palette under Measurement I/O » NI-DAQmx » DAQmx Timing. Drag the polymorphic selector at the bottom of the icon to Implicit. You can use the Sample Mode input on the top of the DAQmx Timing VI to configure a buffered continuous acquisition, or a finite acquisition.

    Note: if you only need to count pulses between a single start and stop trigger, skip this step and do not place the DAQmx Timing VI on your block diagram.
  5. Finally, use the DAQmx Start Task and DAQmx Read VIs located on the functions palette under Measurement I/O » NI-DAQmx » DAQmx Read. Depending on the sample mode selected above (continuous), you may need to place the DAQmx Read VI inside a while loop. Be sure to place the DAQmx Clear Task VI (also located on the NI-DAQmx palette) on the block diagram to free up the counter resource when your VI is finished running.

Several examples of Two Edge Separation tasks are located in the NI Example Finder (Help » Find Examples) under Hardware Input and Output » DAQmx » Counter Measurements » Two Signal Edge Separation. Note that these examples count the time (rather than ticks) between a start and stop pulse, so they must be modified for an edge counting application.

See the attached 6602CountEdgesStartStop.vi for an example of digital edge counting between start and stop pulses.



Related Links:
KnowledgeBase 2D9G49EV: How Can I Measure the Time Between the Rising Edges of Two Digital Signals?
Tutorial: Measuring the Time Between Two Pulses On Separate Lines

Back to Top

Bookmark & Share


Downloads


Ratings

Rate this document

Answered Your Question?
Yes No

Submit