Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous AI and AO using DAQmx Base

I am using DAQmx Base on Mac OS X with a USB 6008. My program needs to peform both AI and AO tasks. Currently it correctly handles the AO task, a software timed task since USB 6008 does not support hardware timed AO. It also correctly handles the AI task, a continous hardware timed analog read. However when both tasks are running simultaneously, the program goes into an infinite loop in either DAQmxBaseReadAnalogF64(...) or DAQmxBaseWriteAnalogF64(...) depending on whether the AI or AO task was started first, respectively.

Is it possible to have both a AO and AI task running at the same time? What conditions need to be fulfilled to enable this functionality?

Martyn
0 Kudos
Message 1 of 3
(3,001 Views)
Hey lmklassen,

You should be able to do simultaneous analog input and analog output on the USB-6008.  Are you running both tasks in seperate executables?  Or have you merged the two tasks into a single executable?  Either way, it should work.  If you have the two tasks running in the same executable, could you post your code?

Thanks,
Erik
0 Kudos
Message 2 of 3
(2,986 Views)

Hi Martyn-

Actually, running NI-DAQmx Base code in two seperate apps or any other multi-threaded application will not work.  Is it possible that your read and write operations are taking place within two different threads?  If so, you should be careful to ensure that NI-DAQmx Base calls are made sequentially within a single thread due to the single-theaded requirement of the NI-DAQmx Base driver.  Other than this condition there should be no other limitations of running both AI and AO concurrently.  If you're not able to get the app working with a single-threaded architecture, please post a small portion of your code that reproduces the issue.

Thanks-

Tom W
National Instruments
0 Kudos
Message 3 of 3
(2,975 Views)