How do I stop a for loop with a stop button? I have 2 case structures and 2 while loops inside my for loop.
@Mike227 wrote:
How do I stop a for loop with a stop button? I have 2 case structures and 2 while loops inside my for loop.
Change the FOR loop to a WHILE loop.
select and right click on the for loop, and check conditional terminal.
Attached is my VI.
I think I need the FOR loop because I use an iteration control. (control off of the N symbol) And I have an auto indexing array feeding in.
@Mike227 wrote:
Attached is my VI.
I think I need the FOR loop because I use an iteration control. (control off of the N symbol) And I have an auto indexing array feeding in.
If you stop the FOR loop, then not all the elements array are going to be processed. If that is fine with you, then do it.
yea, but how would I do that? Ive tried the conditional terminal for the FOR loop, and it then won't write my text to the file.
Is there an error being generated? An error should be the only thing keeping the file from writing.
There are no errors that I can find. Is there a way to manually find an error?
Mike227 wrote:I think I need the FOR loop because I use an iteration control. (control off of the N symbol) And I have an auto indexing array feeding in.
Your array is empty, thus the for loop will iterate zero times, no matter how big the number wired to N is.
I would recommmend to exclusively stick to "build path", "strip path" primitives. Dont manipulate entire paths as strings.
Should "test programs" be a folder or part of the filename? Does the folder exist?
If you want to stop at any time, the stop button belongs into the innermost loop.
Also note that you use an obsolete file open function. But since you wired the start path, it seems that "test programs" is actually a folder name and not part of the desired file name.
Anyway, your upper left code could look as follows.

Also note that making a string diagram constant bold will not make the text in the resulting file bold. ![]()