From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

DAQmx Change Detection Event Registration

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

This code demonstrates how to capture both the rising and falling events associated with change detection.

 

Description

This code demonstrates how to capture both the rising and falling events associated with change detection.  By adding the boolean logic, you can now have seperate actions based upon the rising or falling edge of a signal.

 

Requirements

Software

  • LabVIEW 2012 or compatible
  • NI-DAQmx 9.5.5 or compatible

Hardware

  • NI Multifunction DAQ Device

 

Steps to Implement or Execute Code

1. Select the physical lines and connect signal.
2. Run the program.

 

Additional Information or References

 搜狗截图17年01月07日2036_15.png

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

 

 

A_Ryan
AES
National Instruments

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

Comments
Jeff_Long
Member
Member
on

Very nice example of using change detection with events!  I used this today with a USB-6525 to detect a 10ms pulse from a host machine as a start signal for my software application.

Regards,

Jeff Long, President
AutomationWorks, Inc.
http://www.automationworks.com
Gardo
Member
Member
on

-- Author has updated example adding Unregister--

Thanks.

Åland
Member
Member
on

 Is it by any chance possible to get this example to work with USB-6003? 

I want to fire an event when a digital in pin go HI. 

 

I tried this example but get an error message saying

 

Requested value is not a supported value for this property.

The property value may be invalid because it conflicts with another property.

 

Property: SampTimingType
Requested Value: Change Detection
Possible Values: On Demand

Titen
Member
Member
on

Hardware Compatibility Note:

 

Not all DAQ hardware supports Change Detection. Please view the following KB to see if your device is compatible

MAILFERTSeb
Member
Member
on

That was mostly what I wanted to do, thank you!

Is it possible to monitor events coming form multiple digital lines and then know which line creates the event in order to respond with something specific and different for ecah line?

I'm not able to know in this example which line produced the event.

Best regards.