LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx read on multiple devices simultaneously

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

analyzer_read_loop.png

0 Kudos
Message 1 of 4
(1,473 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(1,445 Views)

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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 4
(1,418 Views)

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.

Petr350_0-1601452156228.png

 

0 Kudos
Message 4 of 4
(1,369 Views)