Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronization for daq

I have a daq device. I want to run 2 parallel while loops in labview, each accessing data from the daq, but I get conflicts because sometimes they both try to get access at the same time. How can I avoid this? One while loop should not run when the other runs. What should I do, use semaphores, notifiers, or something else?

Douwe Monsma
0 Kudos
Message 1 of 4
(2,879 Views)
In article <50650000000800000086AA0000-1066448259000@exchange.ni.com>,
"douwe monsma" wrote:

> I have a daq device. I want to run 2 parallel while loops in labview,
> each accessing data from the daq, but I get conflicts because sometimes
> they both try to get access at the same time. How can I avoid this? One
> while loop should not run when the other runs. What should I do, use
> semaphores, notifiers, or something else?
>
> Douwe Monsma

Hi Douwe,

Long story short, use semaphores.

-Kevin
Message 2 of 4
(2,879 Views)
Hi Douwe:

Please see the attached VI to learn how you can use semaphores to control two DAQ tasks. You can also do simultaneous AI and AO within one while loop. Please look at the examples installed with LabVIEW.

If you are using traditional DAQ VIs, the examples are located in:
Help->Find Examples-> Hardware Input & Output-> Traditional DAQ -> Simultaneous Analog IO -> (choose the VI for your card)

Incase you are using DAQmx VIs. the examples are located in:
Help-> Find Examples -> Hardware Input & Output -> DAQmx -> Synchronization -> Multifunction -> Multi-Function-Synch AI-AO.vi.

Please let us know if you any additional questions.

Regards,
Bharat Sandhu
Applications Engineer
National Instruments
Penny
0 Kudos
Message 3 of 4
(2,879 Views)
thanks very much I will try

Douwe Monsma
0 Kudos
Message 4 of 4
(2,879 Views)