how to programatically repeat a DAQ sequence?
Thu, 04/10/2008 - 12:35 pm
The general scheme is (1) define a stimulus output wave , (2) start DAQ tasks for waveform generation (using the stimulus output wave), counter (trigger) generation, and repetitively triggered wave scanning (input, sampled acquisition). A scan hook function processes the input waves after each triggered scan, counts the scan iterations, and upon reaching a count limit, stops all DAQ tasks. To give concrete numbers, each scan waveform lasts 0.4 seconds, and I typically scan 6 times to be sure the stimulus-response function has settled to equilibrium. This all works with no problem.
My question concerns how to programatically change the stimulus waveform by varying an input parameter, and repeat this entire DAQ sequence. One issue seems to be how to ensure the outer procedure loop (that changes the stimulus) executes synchronously with the DAQ cycle, and does not outrun it. Most things I have tried give an error message that the waveform scanning task is running, even after it should have stopped. Various error trapping methods (as suggested in the NIDAQ Tools manual) have not revealed the source of the problem.
I welcome any suggestions, and can provide code snippets if requested.