Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Oct 23, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Digital Change Detection in NI-DAQmx

3 ratings | 3.33 out of 5
Print

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.

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 strobbed operation meaning that transfers are controlled by hardware (clock signal or handshaking lines). Once a change occurs, data is latched in hardware buffer, and then the pattern is transferred via Direct Memory Access (DMA) or Interrupt to the PC memory.

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.

Digital Port Masking

Consider a digital operation with the following parameters:

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

Then the following occurs for the set of data transmitted:

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

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 performe change detection in the DAQmx Timing VI.


[+] Enlarge Image

Figure 1: Change Detection on Rising and Falling edge.

3 ratings | 3.33 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).