Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error: One task can not contain two independent devices?

Hello,

I am trying to control two DAQ devices: 6289 and 6015/BNC.  When I want to use:
        DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleAIDev1,"Dev1/ai0,Dev2/ai0","",DAQmx_Val_Cfg_Default,-0.05,0.05,DAQmx_Val_Volts,NULL));
it tells me "One tast can not contain two independent devices".

It seems I have to make two tasks for them. Does it mean that if I want to use these two devices at the same time, I can not really synchronize their results?

Thanks.

sipher
0 Kudos
Message 1 of 3
(3,081 Views)
 
Simply having two channels from different devices in one task (if that were allowed) would not be enough to synchronize the inputs anyway.  Both devices have their own sample clocks, so depending on what level of synchronization you need, you've got a couple options.  First, if you do not need hardware synchronized inputs, meaning that you could live with software latencies, you could simply set up two independent tasks with the same sample rate.  You could then start them at the same time (by calling the DAQmx Start Task for both tasks back-to-back).  Then, in your program, you could do the reads at the same time (two DAQmx Reads back-to-back). 
If you do need hardware synchronization, then you will probably want to share a sample clock.  In this case, you would export the sample clock from one device (master) to a PFI line.  Then physically connect the master PFI line to a PFI line on the other device (slave).  Then, configure the slave to be externally timed.  That would achieve hardware synchronization.  Here is a synchronization tutorial that might be of use.  All of the programming examples are in LabVIEW, but the NI-DAQmx concepts are the same regardless of the ADE:  Timing and Synchronization Features of NI-DAQmx
 
-Alan
0 Kudos
Message 2 of 3
(3,079 Views)
Hi Alan,

Thank you very much. That really helps.

Regards.

sipher

0 Kudos
Message 3 of 3
(3,073 Views)