Ian,
What you want is a "Change Detection" operation, which your M Series card supports as of NI-DAQmx 8.0. Please check the ReadDigChan-ChangeDetection.c example located in the C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Read Dig Chan-Change Detection directory. By configuring "
risingEdgeChan" and "
fallingEdgeChan" in the DAQmxCfgChangeDetectionTiming function, you indicate when you want to latch the state of the lines specified in the task. More information can be found in the NI-DAQmx C Reference help.
"Pattern Matching" is a little different as it can be used to start a hardware-timed digital operation whenever the state of the port matches a certain pre-defined pattern.
In your case, it sounds like change detection is the best method. In order to get accurate timestamps of when the data was latched, you will need to call the DAQmxReadDigitalLines() function with the
numSampsPerChan input set to a single sample. Whenever this function returns, you should query Windows for the time. This will be the closest to "timestamping" that you can get. In this manner, you application will wait at the DAQmxReadDigitalLines() function call until the device detects a change, signals the driver, and the driver returns the data to your application.
Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments