LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MultiThread for data acquisition (basic problem)

Hi there,
I want to create a data acquisition VI that perform acquiring data in an independant thread, and when the data is ready, displaying it in a graph. In another word, one thread for acquisition and another one for UI events (button to start / stop acquisition, display cursor...). Data acquisition is higher priority than displaying data. Any VI concrete sample for multithread ?? Thanks in advance.
0 Kudos
Message 1 of 3
(3,091 Views)
> Hi there,
> I want to create a data acquisition VI that perform acquiring data in
> an independant thread, and when the data is ready, displaying it in a
> graph. In another word, one thread for acquisition and another one for
> UI events (button to start / stop acquisition, display cursor...).
> Data acquisition is higher priority than displaying data. Any VI
> concrete sample for multithread ?? Thanks in advance.

Just three words: forget about it. Create one single VI with subroutines for
everything, DAQ, GUI etc. Labview will automatically create treads for the
graphs, for the entire GUI, for DAQ and so on. In fact that are already too
many threads, so don't force Labview to create even more: too many threads
are ineffective, because the system has to spend a
lot of cpu-time for
multithreading-management, so in every environment timing becomes even
worse.

Philipp
0 Kudos
Message 2 of 3
(3,091 Views)
> Hi there,
> I want to create a data acquisition VI that perform acquiring data in
> an independant thread, and when the data is ready, displaying it in a
> graph. In another word, one thread for acquisition and another one for
> UI events (button to start / stop acquisition, display cursor...).
> Data acquisition is higher priority than displaying data. Any VI
> concrete sample for multithread ?? Thanks in advance.

By default, the UI runs in the UI thread. The execution of the VI runs
in the Standard execution system, which has its own thread. By default,
these threads are at the same priority. If you want your DAQ to run at
a higher priority, you can place your DAQ code in a subVI. Then set the
subVI to run in any execution system you like at a higher
priority.

Call the subVI in parallel with the rest of your UI loop, and determine
how you want the DAQ data to get to the UI. You can use a global, a
queue, etc. Don't overlook simply using the terminal or local for the
graph. All of these other methods have their advantages, but they also
add overhead. At some point, you will need to copy the data from the
DAQ code to the UI code. This is all that writing to a terminal or
local does as long as synchronous display is not turned on.

Greg McKaskle
0 Kudos
Message 3 of 3
(3,091 Views)