LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set TDMS file name to include timestamp

I am relatively new to LabVIEW and I am logging to a TDMS file, When I use the Build Path function I set the filename to '%Y%m%d_%H%M%S', minus the quotes, but the file is created with exactly what is typed, instead of the current date/time. How can I edit the TMDS file name to include the current timestamp?

 

...I have already tried to use type cast(string to TDMS) and coerce with no success.

0 Kudos
Message 1 of 3
(2,589 Views)

You need to use "Format Date/Time String.vi" to actually make things like %Y = 2020.

 

ShockHouse_0-1590014001624.png

 

0 Kudos
Message 2 of 3
(2,546 Views)

Be aware that there are pros and cons in naming files with various time date format.  I've seen some that are something like

 

<4 digit year> ❤️ digit day of the year> <Military Time>

 

The logic behind it was that file names could be sorted by the name and you would see the files from newest to oldest.  I think this was a bit silly since file explorer allows for sorting on this.  Then there is the ISO time standard format which is discussed here:

 

This is useful but people may not like that the timezone is shifted from whatever time zone they are in.  That is unless you do abide by UTC where you live.  If you know your software will only ever be used in one time zone, and the files will never be sent to another, setting them to the local time of the machine isn't necessarily a bad choice.  But then again I've made lots of software assumptions over the years that later changed.

0 Kudos
Message 3 of 3
(2,485 Views)