06-15-2016 09:01 AM
I want to use the Date/Time property to set the date when the file was created. How do I use this property?? The TDMS file properties list does not appear to include this property in its list of properties, which I'm still somewhat baffled by since .Author, .Title, .Name, etc. are there. I have added a custom property to include the date in my TDMS file but this is still not what I ideally want, as doing it this way may be somewhat confusing to the end user when they view the TDMS and the bold fonted Date/Time field is empty. See attached file.
Thank you,
D.
06-16-2016 08:28 AM
Hi D.
You should be able to write to the Date/Time field using the TDMS Set Properties.vi using the string DateTime wired into the Property Names. If you put the "/" between Date and Time as it is written in the TDMS bolded property name, it will create a custom property named Date_Time. Once you have the DateTime property written correctly, you should be able to wire a Date/Time string into it to indicate when the TDMS file was created.
06-16-2016 08:54 AM
Grey,
I am creating and writing to the TDMS file via .NET, not LabView.
Thanks,
D.
06-16-2016 09:27 AM
Yeah sorry, I realized that after I posted the message. The process is pretty much the same. If you add a property named DateTime to the TDMS file, and give it a date/time string, it will again write to that Date/Time field in the TDMS file. I've posted an example of this below.
TdmsFile file = new TdmsFile(@"C:\test.tdms", new TdmsFileOptions()); TdmsProperty dateTime = new TdmsProperty("DateTime", TdmsPropertyDataType.String, "06/16/2016"); file.AddProperty(dateTime);
You could easily replace the 06/16/2016 with a DateTime String.