LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

threads in while loop with two data acq loops

Good day, I am using two while loops to perform data acquisition from two different pieces of hardware inside a "main" while loop - a total of three while loops. I want each of the data acq loops to run as fast as possible. With this model will each data acq loop run in a separate thread or will they be running in the same thread because they are both inside the "main" while loop.

 

I'm not getting the performance I would like and I'm looking at ways to optimize the execution. 

 

Thanks

John 

0 Kudos
Message 1 of 4
(2,694 Views)

What hardware are you using to capture data? Are they sampling at different rates?

 

Can you not use one while loop to capture data from both hardware devices? Or have only 2 sepeate loops?

0 Kudos
Message 2 of 4
(2,686 Views)

Yes each while loop is connected to a different camera in vision, they sample at different frame rates. The problem I have is when I record to disk the streams, the performance of labview slows to the point frames are droped. I want to be sure each while loop is running in a seperate thread to optimize execution. Since both loops are inside another while loop I dont now how labview handles the threading in this case.

 

John 

0 Kudos
Message 3 of 4
(2,675 Views)
I would have a loop for each of you data acquisition tasks and at least one, possibly two additional loops that will write your data to file. Let the acquisition loops collect the data as quickly as possible and simply queue it off for further processing. When these loops are in parallel LabVIEW will run them on separate threads. In addition you could have a separate loop with an event structure that could handle you UI interaction. This loop could control the overall application with respect to starting and stopping the tasks, etc. You don't really need to contain all these loops in any other loop or structure. They can all reside on the block diagram next to each other. Ideally you will create subVIs for the data acquision and data processing tasks.
Message Edited by Mark Yedinak on 10-06-2009 04:29 PM


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 4
(2,670 Views)