Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing input from NI 9239 and output from NI 9260 USB cDAQ using C

I have two USB cards (NI 9239 - 4 input channels) and NI 9260 - two output channels. I would like to be able to trigger the input to start when the output starts. I have tried to use DAQmxCfgSampClkTiming and set the source of the clock for the input to the start of the output (dev1/ao0/starttrigger) but keep getting Error -200414. Is there any other way to do this?

 

My code creates two tasks, one for input and one for output, sets the parameters, then sets the sample clock and starts the read task and the write task. 

 

Thanks -

0 Kudos
Message 1 of 2
(1,833 Views)

You seem to mix and match clocks and trigger signals. They are very distinct resources. A trigger is usually a single or infrequent happening pulse, while a clock is a continuous pulse train.

 

You either want to have the AO and AI task use separate clocks, and synchronize the trigger of one to use the starttrigger signal of the other, or you want to use the sample clock of one for the sample clock of the other (if possible), and then software start the one using the clock of the other first, which will prime the circuitry and then start the other to make it start generating clock pulses.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(1,725 Views)