Edge Counting

NI-DAQmx

Edge Counting

Edge counting is when a device counts rising or falling edges using a counter channel. You can choose to do either single point or buffered sample clock edge counting.

The following figure shows an example of edge counting in which the counter in a device counts five edges on the input terminal.

With buffered edge counting, the device latches the number of edges counted onto each active edge of the sample clock and stores the number in the buffer. There is no built-in clock for buffered edge counting, so you must supply an external sample clock.

In NI-DAQmx, when doing on-demand edge counting, you first arm the counter by calling the Start function/VI. Each subsequent read returns the number of edges counted since the counter was started. If you perform multiple reads without first starting the counter, the counter implicitly starts and stops with each Read function/VI call, and the number of counted edges is not cumulative between read calls.

You also can pause counting with on-demand edge counting in NI-DAQmx by configuring a pause trigger. To configure a pause trigger, use the trigger attributes/properties to set the source terminal of the digital trigger as well as the level on which to pause.

Making Signal Connections

Creating a Program

Examples