02-11-2019 09:19 AM
There is a bug in the TDMS Open function, which will always ensure that the file extension created is of ".tdms". Here is a simple VI that I made which just creates a file in the Temp folder. The file specified to be created is "My File.hov" but what is actually created is "My File.hov.tdms"
If after the file creation I rename the file to be "My File.hov" and then run my VI again, it opens properly and creates the "My File.hov.tdms_index" as expected. But what I want it to do is create the file I specify exactly, and don't try to change anything about the file name. This is causing me to have to do extra work to write code which renames files after a TDMS close, and delete or rename the index too.
Why does this matter? Well I made my own file extension and registered it with my LabVIEW built EXE. This way when a user double clicks a ".hov" file my EXE will be launched, and it will open the file and the user can edit it in my editor, and then save. This all works just fine, but if in my program the user goes to File >> New File and saves it, then it doesn't save it with the ".hov" file extension it makes it a ".hov.tdms" file. The only reason for this is that we already have the ".tdms" file extension registered for a normal TDMS viewer, but I want a these specially made TDMS files to be opened differently.
Other file save operations don't behave this way. Using the Report Generation Toolkit I can save a Word report as any arbitrary file extension and it doesn't append .docx to it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-11-2019 10:39 AM - edited 02-11-2019 10:41 AM
02-11-2019 11:41 AM
Yeah I made a wrapper named TDMS Close Plus which also does a bit more stuff. In addition to allowing non standard TDMS file extensions I also added the ability to set the index file creation, access, and last write data to match the TDMS file which is also a recent request I've had. My method of file renaming also is dependent on Windows, and setting file date/times is a .Net function so this example is Windows only.
Still if NI is listening this is still a bug that should have a CAR and be fixed.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-12-2019 05:22 AM
I also changed my TDMS logger class to rename when calling close.
I was in too much of a hurry at the time to bitch about it, but it is a pain and it should be changed.
02-12-2019 10:58 AM
This may be more trouble than it is worth, but have you looked at this
http://www.ni.com/white-paper/6471/en/
It allows you to write basic TDMS files using low level file IO, not TDMS specific IO. You would have to change all of your writes in your program, but you could give it an unique extension. But it may/probably not work for your use case.
mcduff