07-10-2006 08:40 AM
07-11-2006 09:01 PM
Finally, when you want to grab those samples, call a function that starts the master task (which will start the AI sample clock, in effect starting both tasks). Then call the AI read function to grab the 256 samples from the buffer. Once these are finished, you can stop both tasks.
Pseudocode would look something like this:
//Set up Master AI task
DAQmxCreateChannel();
DAQmxCfgSampClkTiming();
//Set up Slave AO task
DAQmxCreateChannel();
DAQmxCfgSampClkTiming(sample clock = DevX/ai/SampleClock);
DAQmxWrite(); //write the 256 values to buffer for future output
DAQmxStartTask(Slave);
//Call trigger function
Function SoftwareTrigger()
{
DAQmxStartTask(Master);
DAQmxRead();
DAQmxClearTask(Master);
DAQmxClearTask(Slave);
}
I hope this helps!
Thanks,
Justin M.
National Instruments
07-14-2006 02:34 PM