From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about for loop

Hi,

 

I am using labview 7.1 to communicate with red tide USB 650 spectrometer. In my program I want a certain function to operate 32 times and the whole set of 32 functions to operate n times. i was thinking about using one "for loop" inside another with the No. of iterations of inner loop as 32 and for outer loop as n. Will this give me 32 complete iterations in the inner loop in every one iteration of the outer loop?

Thanks in advance!

0 Kudos
Message 1 of 6
(2,715 Views)

Yes.

 

Should i expand?



Never say "Oops." Always say "Ah, interesting!"

Message 2 of 6
(2,706 Views)

That is correct. The outer loop may only proceed to the next iteration if everything inside it has finished executing. A loop will only finish its execution if it terminates due to the termination condition; a "standard" for loop has only a single terminal condition: i == N.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 6
(2,705 Views)
It should give you what you are looking for. It would be easier if you show a sample of your code so it can be evaluated but if you do it the way you explained it should work.
Tim
GHSP
Message 4 of 6
(2,701 Views)

Most definitely!

 

Whenever I have questions about nesting like this, I just use the highlight execution mode (the little "lightbulb" button on the block diagram window) and watch the loops run.

Message 5 of 6
(2,700 Views)
Thanks everyone for the help! Smiley Happy
0 Kudos
Message 6 of 6
(2,692 Views)