LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced TDMS reading

The property "NI_ChannleLength" is calculated by TDMS itself, it's the number of the data values of the channel, it's not explicitly written anywhere in the file.

0 Kudos
Message 11 of 19
(1,307 Views)

@YongqingYe wrote:

The property "NI_ChannleLength" is calculated by TDMS itself, it's the number of the data values of the channel, it's not explicitly written anywhere in the file.


If that's true then it's still quite worrying that the calculation is NOT being done on the file before I close and re-open it.  Once I close the file and re-open it, it seems to work again.

0 Kudos
Message 12 of 19
(1,289 Views)

@YongqingYe wrote:

The simplest way to get to the end of the file is, first to get the size of the file and then use Set File Position.


I thought of that yesterday evening.  For some reason I thought the "standard" file operations would not work on the TDMS files.  It may well have been an overzealous assumption on my part.  I thought a little about why I assumed that and I think it was along the lines of "Anything at the same level or below the OPEN function in the palette hierarchy can be used with that refnum, but not something above it in the hierarchy - the standard file operations".

0 Kudos
Message 13 of 19
(1,286 Views)

Yes, I think it's the expected behavior.

0 Kudos
Message 14 of 19
(1,253 Views)

@YongqingYe wrote:

The simplest way to get to the end of the file is, first to get the size of the file and then use Set File Position.


Wiring a TDMS refnum to the "Set File Position" results in a broken wire on my machine.

0 Kudos
Message 15 of 19
(1,233 Views)

So I'm running the danger of rutning this thread in a noob's guide how to fail with TDMS but whatever......

 

I have observed some serious slowdown when writing a large number of groups and channels to my TDMS files.  My data can be spread over thousands of groups, each with theoretically thousands of channels.  This seems sub-optimal.

 

My write speed decreases dramatically as the total number of groups / channels increases in my file.  Writing each group to it's own file significantly speeds things up (with a small dataset (40MB) it's three times faster writing to 40 files with one group each than one file with 40 groups.  Three times faster.

 

Why is this?

 

I also noticed that although the sector size of the disk I am writing to is 512 Bytes, each chunk of META data occupies 4096 bytes on disk, filled nmostly with NUll.  Again, why is this? Whouldn't the META data write consume only as many sectors as it actually requires?

0 Kudos
Message 16 of 19
(1,207 Views)

Sorry, I mean to use "TDMS Set Next Write Position" to write data.

0 Kudos
Message 17 of 19
(1,193 Views)

4096 bytes for the meta data is expected behavior. TDMS uses 4096 as the "meta data buffer size". TDMS has to take care of different disks, some currently use 512 byte, and some uses 4096 now and in the future. 4096 still can be compatible with the disks which use 512 as the sector size.

0 Kudos
Message 18 of 19
(1,190 Views)

But the function "TDMS Set Next Write Position" requires a group and channel input, so it really is as I said earlier in my post that I need to keep track of the last group and channel written to.  So basically, there is not ohter method than I have mentioned previously.

0 Kudos
Message 19 of 19
(1,168 Views)