LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to automatically create file names?

If i do a set of measurements and i want to save each measurement in own file is it possible to automatically create filenames? For example XXX1.vi XXX2.vi ... XXXn.vi
0 Kudos
Message 1 of 7
(7,267 Views)
Hi timohe,

I dont know what you really want to do. If you want to save your measured data as a text file, there is a lot of option in "File I/O" functions. Or if you want to save your front panel image, you can use "property node" to get your front panel image. Or you can do the datalogging of your front panel data and it is quite limited. You can tell us what you try to do and somebody here can help you out. Welcome to LV forum.
------------------------------------------------------------------
When you feel sad, laugh
0 Kudos
Message 2 of 7
(7,267 Views)
See if this vi will give you some ideas
Message 3 of 7
(7,267 Views)
Hi,

i want to save my data as a text file so that each measurement data would be in own file and LabVIEW would automatically create filename for each file. I must do a lots of short measurements and it would be faster if i don´t have to write a new name every time i save.
0 Kudos
Message 4 of 7
(7,267 Views)
> i want to save my data as a text file so that each measurement data
> would be in own file and LabVIEW would automatically create filename
> for each file. I must do a lots of short measurements and it would be
> faster if i don´t have to write a new name every time i save.

You don't mention which nodes you are using to write out your data, but
anything that opens/creates a file should have a path input. If left
unwired, LV will often popup a file dialog asking you to find or name
the file. If you programmatically increment a number and append it to a
string or format the date and computer name into a string, then append
this unique string to the directory path using Build Path, and wire this
into the open/create, you should be s
et. If you are using Express VIs,
I think they default to having the path input not be visible, and you
might want to make that programmatically settable using the express
dialog for the file node.

Greg McKaskle
0 Kudos
Message 5 of 7
(7,267 Views)
Is the n in XXXn a counter or a test number? See my attached example Create Report File from Serial Number. It creates a report file name starting with the serial number of the UUT and then appending a counter. You don't have to save the counter: the program looks for the next available filename on disk.
Your question shows file names ending in .vi. You may not have intended it, but don't use .vi for data files: save that extension for real VIs. If each measurement has its own VI and you want to name the datafile based on the name of the calling VI, see my attached example Create Report File from Calling VI. It gets the name of the calling VI and creates a .txt file with the same name as the caller (with the new extension .txt).
0 Kudos
Message 6 of 7
(7,267 Views)
Yes you can do it this way. Create a path, common part of the file names,
file index and convert all of them into one string. Then use "String to
Path" function to convert it to path. Wire the path to your write file vi.

Hope this helps.

-Fan
"timohe" wrote in message
news:50650000000800000058B70000-1073519706000@exchange.ni.com...
> If i do a set of measurements and i want to save each measurement in
> own file is it possible to automatically create filenames? For example
> XXX1.vi XXX2.vi ... XXXn.vi
0 Kudos
Message 7 of 7
(7,267 Views)