LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having same channel names in TDMS file

Solved!
Go to solution

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.

grafik.png

Hope you guys can help me.

 

Kind regards

Slev1n

0 Kudos
Message 1 of 6
(2,573 Views)

I might be missing something in your situation, but it seems like you should be using groups for "Acetone", "Ethanol", etc. Then the channels in each group can be wavenumber and absorption coefficient.

Message 2 of 6
(2,550 Views)

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.

0 Kudos
Message 3 of 6
(2,540 Views)

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.

0 Kudos
Message 4 of 6
(2,528 Views)
Solution
Accepted by topic author Slev1n

Attached are the VIs, I once downloaded them and fitted them to my needs. I take no responsibility for any misbehavior of my vis 🙂

 

 

 

 

Download All
0 Kudos
Message 5 of 6
(2,527 Views)

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!

0 Kudos
Message 6 of 6
(2,519 Views)