LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Bug - Open/Create Appends .TDMS Extension To Created Files

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"

 

Example_VI_BD.png

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.

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

You could create a wrapper for TDMS close that you use instead of the built-in LabVIEW one. I did some minor testing and this seems to work, but I don't know all of the details about your project. Give this a try. 

Message 2 of 5
(2,391 Views)

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.

Message 3 of 5
(2,376 Views)

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.

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

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

Message 5 of 5
(2,337 Views)