george seifert Posted April 23, 2008 Report Share Posted April 23, 2008 What's the best way to store 2D array data in a TDMS file? Do I have to break up the data into a bunch of 1D arrays? Feeding the TDMS Write VI a 2D array certainly didn't work. George Quote Link to comment
orko Posted April 24, 2008 Report Share Posted April 24, 2008 In the past, I've flattened data (any data: 2D Array, cluster,etc) to a string and converted to a byte array. I believe it was suggested to do it this way in one of the classes I took to preserve any binary data that may be in the array. You can see below that the binary data I injected (\12\13\99) was properly handled. Quote Link to comment
ragglefrock Posted April 25, 2008 Report Share Posted April 25, 2008 QUOTE (orko @ Apr 22 2008, 06:42 PM) In the past, I've flattened data (any data: 2D Array, cluster,etc) to a string and converted to a byte array. I believe it was suggested to do it this way in one of the classes I took to preserve any binary data that may be in the array. You can see below that the binary data I injected (\12\13\99) was properly handled. I would vote for storing N 1D arrays rather than flattening the array to string. The disadvantage there is it makes it difficult tor read back only part of the data, or to scan through the data looking for certain events, especially from other programs that can't handle LabVIEW's flattened string data natively. Another idea would be to use Reshape Array and create long 1D arrays out of the 2D arrays. You simply need to store the dimensions of the array in order to read it back properly. One good way to do that would be to use custom channel properties. This would pretty much require, however, that you always write the data to file in the same dimension-size chunks. http://lavag.org/old_files/monthly_04_2008/post-5171-1209001157.png' target="_blank"> Quote Link to comment
george seifert Posted April 25, 2008 Author Report Share Posted April 25, 2008 QUOTE (ragglefrock @ Apr 23 2008, 08:28 PM) I would vote for storing N 1D arrays rather than flattening the array to string. I think that's probably best in my case. Other people need to access the data either in DIAdem or Excel. It is interesting to see these other ideas though. They might be handy some day. George Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.