Digital Change Detection in NI-DAQmx

Publish Date: Oct 22, 2018 | 12 Ratings | 2.17 out of 5 | Print | Submit your review

Table of Contents

  1. Overview
  2. Digital Port Masking
  3. DAQmx Hardware that Supports Change Detection
  4. LabVIEW Example

 The National Instruments Getting Started with NI-DAQmx Series is aimed at helping you learn NI-DAQmx programming fundamentals. Through video and text tutorials, this series will take you from verifying your device's operation in Measurement & Automation Explorer (MAX) to programming data acquisition applications using LabVIEW. It is intended for both the beginner who wants to learn how to use the DAQ Assistant, as well as the experienced user who wishes to take advantage of advanced NI-DAQmx functionality.

1. Overview

Change detection is a digital operation in which a transition on one or more digital input lines causes the entire group or port to be captured in hardware. Change detection is a strobed operation, meaning that transfers are controlled by hardware (clock signal or handshaking lines). Once a change occurs the pattern is transferred via Direct Memory Access (DMA) or Interrupt to the PC memory.

Note: USB DAQ devices do not support DMA. See Data Transfer Mechanisms for more information.

Change detection can quickly identify changes in digital port state, and allows port monitoring without polling in a software loop. It also removes redundant data, and registers for the entire port. Change detection is useful for monitoring lines that change at irregular intervals.

Back to Top

2. Digital Port Masking

Consider a digital operation with the following parameters:

  • Port size: 16-bits
  • Lines to monitor: xxxxxxxxxxxxxx11
  • Mask: 0000000000000011 (0 = don’t-care input)

 Then the following occurs for the set of data transmitted:

  • First data: 1111111111111111 Latched
  • Second data: 1011110001111011 No change
  • Xth Data: 0001010110100100 Change, entire port is latched

A change in either of the two monitored lines will latch the data.

Back to Top

3. DAQmx Hardware that Supports Change Detection

The following National Instruments devices support change detection with NI-DAQmx, version 8.0 and later:

  • Industrial DIO
    • NI 6509
    • NI 6510
    • NI 6511
    • NI 6514/6515
    • NI 6518/6519
    • NI 6528
  • High-Speed DIO
    • NI 653X
  • Some M Series (Port 0 ONLY)
    NOTE: USB Bus-Powered M Series devices like the USB-6210 and USB-6211 and our Industrial M Series cards (NI 623x) do NOT support change detection.  However, USB High-Performance, PCI M Series, and PXI M Series devices DO support change detection.
  • X Series
  • C Series
    • NI 9401
    • NI 9402
    • NI 9411
    • NI 9421
    • NI 9422
    • NI 9423
    • NI 9435

Back to Top

4. LabVIEW Example

Figure 1 shows a LabVIEW program that continuously monitors a change on the rising and falling edge of some the digital lines. When a change is detected, the values on the digital lines are read or latched into memory. Notice that you configure your digital input task to perform change detection in the DAQmx Timing VI.

Figure 1: Change Detection on Rising and Falling edge.

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit