Hello RedWoods,
Unfortunately, the NI PCI-6154 only has static Digital Input/Output lines
and not correlated (or hardware timed) Digital I/O. This makes it a
little more challenging to synchronize different operations, but not
impossible. I would recommend that you examine the
DAQmxRegisterSignalEvent
function. This function "Registers a callback function to receive an
event when the specified hardware even occurs." Amongst the valid
hardware events are change detection events, which are "signal[s] a DIO
device generates after it detects a change—a rising edge, a falling
edge, or both rising and falling edges—on the data lines."
You could register a change detection event for your digital lines and
then count the number of elements in your analog input array in the
callback function. This would give you the number of samples that you
had read into the program at the time of the digital pulse. The only
problem with this method is that the number of samples in the analog
input array is only updated when you read data from the DAQ card to the
program using one of the DAQmxRead functions. I am assuming you would
probably acquire your analog signal continuously at a rate of 100kS/s
as you described in your previous post. So, you would use the
numSampsPerChan
parameter to determine how many samples to read from the DAQ device to
your computer and then you would execute this read continuously for an
hour or so. In effect, you would have a maximum error of
numSampsPerChan
in your number of samples because the digital change event would be
processed between reads from the DAQ device. Depending on the precision
you require, this error may or may not be acceptable. However, there is
no way to synchronize static digital acquisition with the analog
acquisition in hardware.
You also mentioned that you have multiple NI PCI-6154 devices connected
with RTSI cables. If you are trying to monitor digital lines on
multiple devices for change detection, you will need to export these
signals to the device that is acquiring the analog signal. This can be
accomplished using the
DAQmxExportSignal function, which is described as such:
"Routes a control signal to the
specified terminal.
The output terminal can reside on the device that generates the control signal or on a different device. Use
this function to share clocks and triggers between multiple tasks and devices.
The routes created by this function are task-based routes."
In this way, you can share the digital lines on multiple boards and
monitor each one for a change event. For more information about the
functions I have described I would recommend that you view the
NI-DAQmx C Reference Help. This document should be located on your computer by going to
Start>>All Programs>>National Instruments>>NI-DAQ>>NI-DAQmx C Reference Help.
Matt Anderson
Hardware Services Marketing Manager
National Instruments