LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I've seen that a single "while loop" in a diagram let me save datas on file very fastly, if I put two "while loop" in the same diagram the savement is slower.Why?

I've build a diagram to acquire frequency with a while loop and then I've build another diagram to acquire frequency and four analog inputs:the first acquirement is much faster than the second .Why?I send you the two program to make you understand better.
Thanks.
Download All
0 Kudos
Message 1 of 2
(2,183 Views)
The attached file you sent that has two while loops performs data acquisition in the second loop which will take up more resources and slow down the overall program.
Also, the AI Read used in the second loop is a synchronous operation. This means that the second loop has to wait on the AI Read. The way around this would be to set the AI Read to run on a separate thread than the calling VI. To do this, open AI Read.vi, right click on its icon in the upper-right hand corner, and select "VI Properties." Select category "Execution" and for "Preferred Execution System," select "data acquisition," apply and OK. Save the VI as a new name so as not to modify VIs in vi.lib. This should set the AI Read to not run in the same thread as the rest of your code, thereby not lock
ing your parallel loop. This should help speed up your program.
0 Kudos
Message 2 of 2
(2,183 Views)