ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

incrementing file path?

I have a for loop that is going to write a number of files. I wish to name all the files differently bu have to many file to type in a new name each time. I there a way to say add the loop iteration to the filepath to create a contiuously changing file name? E.G iteration 1, Datafile1
iteration 2, Datafile2......
0 Kudos
Message 1 of 4
(3,114 Views)
see attached example vi
0 Kudos
Message 2 of 4
(3,114 Views)
You can convert the current iteration number to a string such as "5". Then use the string concatenation primitive to append a generic name like "Iteration " to get "Iteration 5". Then use build path with that and the directory.
0 Kudos
Message 3 of 4
(3,114 Views)
I have several applications running on customer's sites with a similar file naming requirement. I use the Date/Time vi and convert to a string. This way, using time resolution, or alternatively, the absolute value of the millisecond tick count, you will always have a unique file name. A bonus; the files will be time-sequentially named.
0 Kudos
Message 4 of 4
(3,114 Views)