07-18-2021 04:32 PM
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 -
08-09-2021 06:15 AM
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.