ā07-30-2012 02:08 PM
How do I stop a for loop with a stop button? I have 2 case structures and 2 while loops inside my for loop.
ā07-30-2012 02:12 PM
@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.
ā07-30-2012 02:13 PM
select and right click on the for loop, and check conditional terminal.
ā07-30-2012 02:17 PM
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.
ā07-30-2012 02:19 PM
@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.
ā07-30-2012 02:24 PM
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.
ā07-30-2012 02:34 PM
Is there an error being generated? An error should be the only thing keeping the file from writing.
ā07-30-2012 02:42 PM
There are no errors that I can find. Is there a way to manually find an error?
ā07-30-2012 02:55 PM
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.
ā07-30-2012 03:12 PM - edited ā07-30-2012 03:32 PM
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. š