Example Code

Digital Change Notification

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview
The example shows how to use the change detection of the digital pin to trigger the read operation of the newly connected hardware

Description:
The VI would execute starting with accessing the Digital Input pin of the DAQ hardware and use the DAQmx Timing to define the change detection feature, it would then start the task and utilize the characteristic of the event structure to notify and execute the code by detecting the value of the task itself

Steps to implement or execute code
To implement this example:

  1. Define the digital lines to be used
  2. Run the VI
  3. (Optional) Turn on the Highlight Execution to see the flow of the VI


To execute this example:

  1. Install the required software.
  2. Connect the DAQ hardware that supports the DIO features
  3. Confirm the connection with the MAX with TestPanel
  4. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible
NI-DAQmx 16.0 or compatible

Hardware
cDAQ with C series Digital IO Module

 

fp.JPG

 

bd.JPG

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,
Dan King

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
PeteD
Member
Member
on

Using the specific or similar code to http://decibel.ni.com/content/docs/DOC-2280 (digital change notification.vi) I am observing unexpected but consistent behavior from the event structure. The event structure captures an event the first time data is received at the event structure; even if there has been no change at the assigned digital port. After that initial unexpected event, the event structure behaves as expected.

Just wanted to know if anyone had any insight into this. Does the initialization of the change detection task trigger this event?