LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic file save naming

Solved!
Go to solution

Hello everyone, I created a system that can save wavelength output from each waveform into a CSV file. But in my Vi, I only use the constant file naming for example: "saved_data.csv". What I want is, the name of the file is changing automatically along with the timestamp of the file is being saved, for example: "saved_data_1594208640.csv".

 

Thank you

0 Kudos
Message 1 of 5
(2,335 Views)

Use Format into string to combine that with your timestamp value.

 

Now I don't understand how 1594208640 correlates with the current date, so I can't give you a format string to give you that result.

 

But when you don't want something to be constant, then you need to program it so that you aren't using nothing but constants.

0 Kudos
Message 2 of 5
(2,310 Views)
Solution
Accepted by topic author keyvdir

I was converting the date and time to Unix timestamp, I thought LabView has this function. I solved the problem by using concatenate string as the input for the relative path. Thank you for your reply.

0 Kudos
Message 3 of 5
(2,293 Views)

I have a colleague who uses time-stamps as part of the file name.  I hate that -- makes names "user-hostile".

 

For at least the last 5 years (and probably longer), LabVIEW has had an auto-incrementing feature when creating file names, such as "My Data (1234).dat" (where the "1234" is the incrementing suffix, the next file saved in that folder will be 1235, etc.).  There are other things that might make more sense relative to the data being saved (for example, if done in a testing lab, you might incorporate the serial number of the DUT).

 

Make the file name relevant to the data being saved.  Write LabVIEW code to help you do this.

 

Bob Schor

0 Kudos
Message 4 of 5
(2,267 Views)

I am also a fan of the Format Into String.  It just makes the file name so much cleaner.

 

I don't know what Bob's colleague is doing, but I absolutely love having the date/time in the file name.  It makes sorting through my test data a lot simpler.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(2,263 Views)