09-28-2020 05:20 AM
Hello,
Is it possible to read DAQmx tasks from multiple devices simultaneously? I have application, which using 2 audio cards PXI-4461.
I have created one task for card 1 - and in this task I have "ai0" and "ai1". Then I have second task for card 2 - this task has also "ai0" and "ai1".
Acquisition took 1,2sec.
I have both read VIs in while loop, but is seems that they are called sequentially, because the read from both cards took 2,4sec (2x 1,2sec).
I have also tried to put each VI into separate while loop, but the behavior seems that the DAQmx read is executed sequentially.
Thank you for any idea.
Best Regards,
Petr
09-28-2020 07:18 AM
You will need to pass the sample clock of one of the cards through the PXI backplane and have the second card use that as the sample clock. If you dig through the examples, I'm sure there is at least one in there that does this.
09-28-2020 11:13 AM
It appears that channel expansion should be supported for your pair of identical PXI devices. That'll be an even simpler way to sync the two - let DAQmx handle all the timing signal routing for you!
-Kevin P
09-30-2020 02:50 AM
Finally, I figured out that the problem was in setting of VI properties - category "execution".
Based on the logs from NI IO Trace - I realized that in VIs are the daqmx read functions called in parallel (in multiple threads) - this was checked with TestStand sequence which called the LabVIEW steps.
When I called the build .NET assembly from TestStand, the daqmx read functions were executed sequentially using the same thread.
When I changed the VI property Preferred Execution System form "same as caller" to "instrument I/O", then after build the read daqmx functions were called from multiple threads and executed parallel.