Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

does the inner while loop have to be stopped before the outer loop will run?

too many while loops cause my controls to be very sluggish.
0 Kudos
Message 1 of 2
(2,941 Views)
Hello,

The outermost while loop executes everything inside it over and over. Therefore, if you have a while loop inside another while loop, the first iteration of the outer while loop will execute the inner loop, and then the inner while loop will execute over and over again until it is stopped. At this time the outer while loop will perform another iteration, and the process will repeat until the outer loop is stopped. Generally, embedding while loops within while loops is not recommended.

Please visit the below sites for more information on program efficiency.

http://zone.ni.com/devzone/conceptd.nsf/webmain/b6605678ad7a09a8862568eb007a6d7a?OpenDocument

http://zone.ni.com/devzone/learningcenter.nsf/03f7c60f17aad210862567a90054a26c/1b36040af87887078625
6cbc006fe314?OpenDocument

I hope this helps!

--Liz F
0 Kudos
Message 2 of 2
(2,941 Views)