Showing results for 
Search instead for 
Did you mean: 

How to get the last data point from a TDM file in LabVIEW?


I am using LabVIEW to analyze some rather large TDM files, and I need a way to get only the last data point.  So far, the only way I have been able to accomplish this is by reading the entire file.  Is there a property in the TDM file or a function in LabVIEW that will allow me to get the index of the last item in a channel?  



0 Kudos
Message 1 of 4

Do you want to avoid reading whole file and want to be able to reach or get the index of last value of channel? is there any specific reason? I am not sure you could do it without loading the whole file. But the easiest way would be just to use array functions "array size" would give you the index of last element. 



Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 2 of 4

Thanks for the reply.  What you described is what I am currently doing.  However, I am reading very large files over a network, and I really only need the first and last data points.  So, if I could somehow avoid having to read the whole file, my processing time would be orders of magnitude faster.  I would expect there to be a property or a function that would help with this, but so far I have not been able to find it.  Does anyone know if there is a way around reading the whole file?



0 Kudos
Message 3 of 4

In order to access the stored data you will need to first load the entire file.  This is a standard file i/o protocol which is managed by the operating system.  It just is not feasibly possible to only open a part of a file.  If you only want the first and last data point you could save them off seperately when the files are created.


Jacob Kerksiek | Applications Engineering |

Jacob K
0 Kudos
Message 4 of 4