02-25-2019 07:35 AM
Hey guys,
I have different optical spectra data I am saving to TDMS file. This data array is a 2D array containing the absorption coeffiecent of a chemical species and its corresponding wavenumber. I want the channel names to be:
wavenumber | absorption coefficient | wavenumber | absorption coefficient | wavenumber | absorption coefficient
But I cannot have same channel names in one group, because the data will get appended and only two channels will exist. I am doing this because then I can easily copy the data out of the TDMS file into originLab for further data visualization and processing. I have added a screenshot of an excel file demonstrating how I want my data to be saved in TDMS file. This format is the most easiest to copy into OriginLab.
Hope you guys can help me.
Kind regards
Slev1n
Solved! Go to Solution.
02-25-2019 09:54 AM
02-25-2019 10:50 AM - edited 02-25-2019 10:51 AM
The TDMS file doesn't have any thing it stating how to display data. It doesn't know about rows, or columns it just knows the data that is in it. When you are viewing it in Excel it performs an import to show the data in a new way, but the data doesn't change, and the importer doesn't know anything about how you want it formatted.
For this reason I personally will import the data, and then perform actions to update the spreedsheet to have a custom formatting. Here is the example where I convert TDMS files to XLSX files by importing them, and then adding conditional formatting, freeze the first row and column, and a custom summary page. If you do want to have a custom viewing for your data, I'd suggest looking into doing something like this where it imports it, then you modify it to have the extra rows at the top with other information. Of course if multiple groups (which are worksheets after imported) work then that would be alot easier.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-26-2019 04:10 AM
Thanks for your suggestions.
The currently easiest way for me is to keep the channel input of the TDMS_Write.vi open, doing this one row is added and each column has unkown | unkown1 | unknown2 aso. I also convert the TDMS file in the end into an XLSX file as well. Then, I open the XLSX file delte the first row, press ctrl + A and copy all of it into originLab. Using different groups would mean I have to copy each worksheet successively (if I understood you correct).
I guess I could add the functionality that the first row of the XLSX file is automatically deleted.
02-26-2019 04:54 AM
Attached are the VIs, I once downloaded them and fitted them to my needs. I take no responsibility for any misbehavior of my vis 🙂
02-26-2019 09:45 AM
EDIT: Note, that the first row of the second worksheet is deleted, to change it to the first worksheet go into the blockdiagram and change the Sheets -> Index input from 2 to 1!