LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set a autocounter for file saving

Hi
 
I was wondering if anybody had a quick solution for autofile naming with a look-up so lab-view can deduce what the next file should be named.
 
A counter would be the perfect example where if the last file stored in the directory was 001, the next file would be stored as 002.
 
e.g.    if the selected path chosen path was C:\Ashley\data, and the last file was numbered 001 the new file would be saved as C:\Ashley\data\002.
 
I have used a counter in a loop in which the data is acquired but don't find this a satisfactory solution.   I would prefer a look-up as suggested.
 
Many thanks
 
Ashley
0 Kudos
Message 1 of 3
(2,584 Views)
Under the file I/O functions menu, goto advanced file functions. There is a list function that will return a list of all of the files in a specified directory. Use this to perform your lookup.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 2 of 3
(2,570 Views)
Here is a quick vi that will return the highest file name. This will work if the file names are numbers only. eg. 001.txt. The file extention doesn't matter, you can chage that.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 3 of 3
(2,562 Views)