Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute a callback when a DI signal changes value

Hi all:
I'm using the Qmx library on the PCI-6220 ADC device. My problem is that I want to monitor a digital input signal. I want my application to be interrupted when a change in the value of the digital input signal is detected. How do I do this? I'm new to this field so this may be a very easy question. The traditional NI-DAQ had an api call to register a callback function - I don't see anything in the DAQmx library that does that. From what I read the Traditional NI-DAQ and the NI-DAQmx don't work together without reconfiguring the device. I've written all my code using the DAQmx and want to stick with this exclusively if possible. Help!
 
Greg
0 Kudos
Message 1 of 4
(3,663 Views)
Since you're using a 6220 (M-series device) you *have* to use DAQmx.

Events were added to NI-DAQmx in version 7.5; be sure you have the latest version.

You need DAQmxRegisterSignalEvent, found in the DAQmx C documentation under Task Configuration/Control->Events.

BUT, if I understand things correctly, the 6220 doesn't support change detection on DIO lines. I can't recall now how I found this out.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 2 of 4
(3,656 Views)
See the thread http://forums.ni.com/ni/board/message?board.id=250&message.id=15722

It confirms that you can't do change detection with M-series cards, but gives hope for the future.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 3 of 4
(3,649 Views)

Another possibility is to use the serial or parallel port.  Have the TTL signal drive a mosfet that shorts together the serial port handshake lines and then set up a handshake OnChange event.  The parallel port directly supports one of its input lines as an interrupt line.  The ease of implementing this depends on your development language.

Steve

 

0 Kudos
Message 4 of 4
(3,639 Views)