LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading NI_ChannelLength Property from TDMS file

I have read that we can read the NI_ChannelLength property for any given TDMS channel to find out the number of data points present.  I'm assuming that when writing to a file in chunks, this value will always accurately reflect the current length of the data in the file at the time of reading?

 

My question is whether this value is read from disk or cached by the TDMS code. I am considering a routine which will need to know the number of data points for each channel as it is being written (To do an on-line averaging preview).  Is this an actual value stored in the file or is it a value derived from the data structure on disk?

0 Kudos
Message 1 of 2
(3,198 Views)

From the quick test I did it looks like this value is updated after every TDMS Write, but may not be reflected on disk, until a flush or close.  So if you have a reference and read the property, it will be the maximum number of samples that you can read from that channel, at that time, regardless of what is on disk.  Similar to how a TDMS Read will return all the data it can, even if your file on disk is zero bytes in size.

 

On a side note I do wish there were more built in properties like this.  I'd find it valuable at times to have an NI_ChannelAverage property that is written every time I do a TDMS Write, of course that could be an expensive operation and maybe could be disabled by default.  What about NI_ChannelMin or Max too?

 

EDIT: okay convinced myself here is an idea for it.

0 Kudos
Message 2 of 2
(3,171 Views)