07-07-2020 09:45 PM
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
Solved! Go to Solution.
07-07-2020 11:09 PM
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.
07-08-2020 01:25 AM
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.
07-08-2020 06:01 AM
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
07-08-2020 06:26 AM
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.