LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous tasks using DAQmx functions

Hi all,

 

 Is there any example of DAQmx PCI-6251 on Labwindows in which Multithreading is used.
Basically i want to acquire and generate Analog signals from PCI-6251 by using Multithreading.

 

In which one Thread is for Acquiring the analog signals and the other thread is for generating
the analog signals after performing some calculations on the samples of the Acquired Signals.

 

So it means i dont want to Acquire and Generate analog signals Simultaneously but there must be a
"Little Delay" between the two Threads.

 

Any help on this topic will be Greatly appreciated.

 

Regards    

 

0 Kudos
Message 1 of 5
(3,526 Views)

Multithreading isn't really an option in this case. The software will still have to input the signal, perform the calculations, and output the signal in that order. If you're trying to cut down on processing time to control a device, you might consider the LabVIEW Real Time Module.

Jake H | Product Manager
0 Kudos
Message 2 of 5
(3,499 Views)

Hi Jake,

 

 I am using LabWindows CVI 2009. So, please give me the solution of handling this Task in Labwindows.

 

Thanks

0 Kudos
Message 3 of 5
(3,484 Views)

Sounds like you're trying to input a signal, do some calculations, then output to an analog device? If so, this is not possible by using multithreading.

Jake H | Product Manager
0 Kudos
Message 4 of 5
(3,482 Views)

Actually, this is entirely possible.  The primary difficulty is sharing data between your two threads.  The easiest way to accomplish this in LabWindows/CVI is with a thread safe queue.

 

I admittedly don't write much DAQ code, so it likely won't meet your specific needs, but I've attached a simple example of doing what you've asked about.  I create two threads, one for reading and one for writing.  Each thread creates a task, and then loops while reading or writing until told to stop.  They share data through a thread safe queue.

 

Let me know if you have any questions regarding the sample -

 

NickB

National Instruments

 

 

Message 5 of 5
(3,457 Views)