LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two vi read the same daq card

Hi, I have to do data acquiration by daq(E series). I have two programs and they will try to read the same daq channel data at the same time. Unfortunely, when I run one program, then the other can not read the daq data and I got the error message. It looks like that I can start daq by only one vi. Can anyone help me to solve this issue? Welcome for any suggestion. Thanks.
Fred.
0 Kudos
Message 1 of 4
(2,665 Views)
Do your two programs have to be separate? Can you make one a sub-vi of the other? Then you could open the DAQ and pass a reference to the sub-vi. Or you could create a main vi which opens the DAQ, then passes the reference to your two programs which would now be sub-vi's to the main. At the end, your main would also close the DAQ session.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,665 Views)
Hi, tbob

Thanks for your response. The main issue of my application is that I have two programs, one read data from cfp and update every 100ms, and the other vi read data from daq continuously. If I set one vi as subvi, then I will delay my daq acquisition speed which I do not want. However, I also need daq data for the cfp vi. How can I read the daq data for the cfp vi? Again, thanks for your response.
Fred
0 Kudos
Message 3 of 4
(2,665 Views)
You will have to combine both codes into one vi running separate threads. One thread will read the daq continuously. The other will read the time in milliseconds continuously and when 100 ms have passed, read cfp and reset timer.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(2,665 Views)