Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Detection Interrupts NI 6509

I have purchased a NI 6509 I/O board. I need the board to monitor 2 seperate input lines. Upon the falling edge on any of these lines I need an interrupt to occur and jump to seperate routines to do some tasks. The signals are at a rate of 400Hz and are about 10us in length. Also, what is likely to happen if the 2nd input line goes low when performing the interrupt of the first?

I have installed the DAQ stuff and looked at the examples, but the example code for change detection seems to me to be sat and waiting, polling. The text mentions that change detection can perform interrupts but have no idea of how to set them up. Unfortunately my experience in software is not the best so could the answers appear in plain English please. Have looked through the other directories for examples but have had no joy.
I am using visual C++ v6.0 but writing in ansi C and shall execute code from a DOS window. The application is time critical so really could do away with using anything from Windows.
Thanks
Smig
0 Kudos
Message 1 of 2
(3,751 Views)
Have you tried looking at the change detection example that ships with the DAQ driver? I found the following example:
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Read Dig Chan-Change Detection

This example doesn't use polling, but is true change detection.

The basic setup is:

Configure Timing --> Configure Change Detection --> Start Task --> Read --> Clear Task --> Error Check

The READ step will not start until the change is detected.


I have not seen any DAQ example that allows the user to configure an Interrupt Service Routine based on a change in a digital line. With DAQ 7.4, they recently added the functionality to create a call back function based on a digital change, but this would be done in CVI or with Measurement Studio.

Hope this helps,

Lilly
National Instruments UK
0 Kudos
Message 2 of 2
(3,688 Views)