Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

for loop inside while loop

To all,

 

I have a question, I have a for loop inside a while loop. The for loop runs and displays the log data. It seems that until I stop the while loop that the log data is display. It almost seems that the for loop runs until the while loop is stop.

 

Any inputs?

 

Thank you,

 Cosmica 

0 Kudos
Message 1 of 3
(3,690 Views)

Hey Cosmica,

 

With a for loop inside a while loop, you will run the for loop however many iterations you specified. Then, because of the while loop, it will start over at the first iteration of the for loop and continue to repeat until you stop the while loop. So, it sounds like what you are seeing may actually be expected behavior. What sort of log data are you referring to? Would it be possible to post a picture of your code? What sort of behavior are you expecting?

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 2 of 3
(3,669 Views)
This seem's to be a duplicate post.
0 Kudos
Message 3 of 3
(3,657 Views)