09-05-2012 12:58 PM
Hi,
I'm trying to make a 2-D array out of a Channel group in a TDMS file, so that I can view it similar to how Excel displays the file in a table format. I would then further process the elements of the 2-D array. I'm having trouble converting it into a table using the TDMS Read VI as I keep getting error -2532, cannot convert to specified format. I thought that treating the file as a 2-D array of strings would work but apparently it does not.
thanks,
Omar
Solved! Go to Solution.
09-05-2012 01:08 PM
Can you show the code what you have tried?. Did you try using the TDMS file viewer vi?
09-05-2012 01:24 PM
Oh, here's what I have:
I want to take the output and process it further, thats my main goal. Viewing the data is just a debug tool for myself, so that's why I'm not using the TDMS file viewer.
thanks
Omar
09-05-2012 01:34 PM
You need to read each channel by itself using the datatype that it was written to. If you do this in a FOR loop and use autoindexing, you'll have a 2D array. Of course, you will then need to convert to strings in order to put into a table. Do you have a sample TDMS file for us to play with?
09-05-2012 01:38 PM
I do, I had to zip it to upload. it has 3 channel groups. I'll try out your suggestion
thanks,
Omar
09-05-2012 01:45 PM
Are you sure that the data you are writing ino the file is a 2D string array?. Also try using the file viewer so that atleast you can confirm the data is present in the file.
09-05-2012 02:28 PM - edited 09-05-2012 02:29 PM
Ok, your culprit is the first channel (Time). It is a timestamp while the other channels are doubles. So you can follow this code in order to read all of the other channels into a 2D array. You can convert to a string from there. You can read the Time channel separately if you so desire.

09-05-2012 03:14 PM
Crossrulz, that works perfectly, thanks! I was expecting to also have the channel names in the table, is that also possible? I need the channel names because I am cross-checking the data with a "correct" value for each channel. want to iterate through each channel and wanted to use the channel/column name as it contains the signal ID I need to compare. Is there a way to also have this in the array? Or to associate each column with the channel name somehow?
thanks,
Omar
09-05-2012 03:28 PM
Actually, I think I've got it, I'll just use the array of channel names from the second read TDMS VI to get the index and use that to go to the correct position of the 2-D array.
thanks for the help guys 🙂
05-15-2014 03:39 PM
Hello Omar,
I have looked at the attachment 2012.08.23_14.27.12_Data.tdms.zip 60 KB in your post, and I am really amazed by that. I am also doing some data grouping using TDMS in LabVIEW, and there will nearly 1000 channels, each keeping update its data per second. I was wondering whether you could send or post the block diagram you used to construct the attachment. I would really appreciate it since it will be extremely helpful to me.
Thanks a lot!
Sunming