From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't un-write protect TDM files

I am using the storage VIs to manipulate a TDM file that was created using the TDM header writer API. When I try to do any operations on it (specifically, deleting a channel), i get error -2561 "Data storage is write-protected.". I have checked the permissions on the file and they should be correct.

 

I ran some tests and found that i can create a TDM file using the storage VIs and delete a channel without any issues. According to LabVIEW, the file created using this method has the same permissions of the problem file.

 

Do you think this could be a bug with the TDM header writer VIs? Or am i missing something obvious?

 

I have attached  files showcasing the issue.

 

Thanks in advance for any help.

0 Kudos
Message 1 of 8
(3,107 Views)

Hello, I was able to reproduce this issue.  It does seem fairly strange that both files have the same permissions but only one of them gives you an error.  I was however able to get around this issue by converting the file to TDMS and then writing something to it.  Perhaps this will be a valid workaround.  Could you provide more information on how this tdm file was created exactly?  Better yet, could you create an example VI that creates a problem file from scratch, and then tries to modify it?  This might give me a better idea of what is going on.  Thanks!

0 Kudos
Message 2 of 8
(3,078 Views)

 Thanks for the response. I added the file creation to the example. Good luck!

0 Kudos
Message 3 of 8
(3,061 Views)

i found this article which seems to explain things. Aparently it is impossible to edit TDM files created with TDMHW.This is just another hole in NI's support for TDM files. NI, why do you hate me?

 

http://digital.ni.com/public.nsf/allkb/E70F5DB0BB2B0906862570A6006652B0

0 Kudos
Message 4 of 8
(3,045 Views)

According to the article above, the TDMHW does not work because the data in interlaced. Does anyone know of any utilities to un-interlace the file so they can be modified with the data storage VIs?

0 Kudos
Message 5 of 8
(3,015 Views)
bazookazuz-

There is currently no utility that un-interleaves a data file.  Looking through the NI Developer Zone: Introduction to the LabVIEW TDM Header Writer VIs article, it appears you can read the file then transpose it to be end to end.  Then you can save it to a different file that you can edit as necessary.  Anyone else have any other suggestions?

Regards,

Mike S
NI AE
0 Kudos
Message 6 of 8
(2,996 Views)

That is a good idea, but requires a bit of development/debugging. Also, most of my files are 500MB so this approach would be pretty slow and eat lots of resources.

 

If i do this, I will have a mix of both files. How do i dintinguish between interleaved and end to end files? is there some sort of flag i can check?

 

And of course the million dollar question is why the "TDM standard" isn't standardized? Or is it even a standard? Just a general idea? Rule of thumb?...If it was a standard, then maybe all TDM tools could follow it.

0 Kudos
Message 7 of 8
(2,990 Views)
Bazookazuz-

The standard is described in the Developer Zone described above.  TDM files are binary files written such that it follows a particular pattern.  That way the data can be easily retrieved and interpreted later.  It is written in the fashion to save disk space and to be created/modified quickly.  All TDM files acquiring data from multiple channels follow the same format alternating between each channel taking each sample (also described in the Developer Zone article).  By converting the data to End-to-End, it makes all the data for each channel together. 

In order to distinguish between the modified and unmodified tdm files, there is no way to just look at the file type and know without a naming scheme.  Programmatically, you can parse out the first few data sets and see if they are the same channel and then you can determine from there. 

Regards,

Mike S
NI AE
0 Kudos
Message 8 of 8
(2,974 Views)