LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to concatenate multiple groups in a TDMS file to form single group without loosing data?

Solved!
Go to solution

I have saved data in TDMS file format. Each TDMS file contains 30 groups and each group contains 9 channels inside. Each channel contains 200 samples. I want to join all the 30 groups in such a way that respective channels (named same in each group) should be joined. At end i need a TDMS file with 1 group containing 9 channels and each channel should have 6000(= 200x30) samples in total. A figure is showing the current hierarchy of my tDMS file. TDMS.jpg 

0 Kudos
Message 1 of 18
(3,942 Views)

Hi irsa,

 

read the TDMS file, one group after the other, and write the data into a new TDMS file containing just one group.

 

You should know by now how to do that…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 18
(3,915 Views)

I created this code, its reading TDMS group by group but the written file contains only one group out of 30 groups. How the attached code can be corrected?

0 Kudos
Message 3 of 18
(3,910 Views)

Hi irsa,

 

I already told you about your problem with THINK DATAFLOW!:

You read the old TDMS data in the loop, but only write to the new file ONCE AFTER the loop.

Your problem description was "read old data AND write them to a new file IN A LOOP"…

 

You also still use ExpressVIs, but you already learned that you got all those groups in your TDMs file because you used them.

Why don't you talk with Jawad and use plain TDMS file functions instead???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 18
(3,908 Views)

Placing write to measurement file inside the loop yields the same 30 groups not one group in written TDMS file.See the attachment.... Am I doing something wrong again in code? 

0 Kudos
Message 5 of 18
(3,898 Views)

Hi irsa,

 

Am I doing something wrong again in code? 

Yes: you are still using the same ExpressVI…

 

Did you talk with Jawad? We already solved that problem of creating a TDMS file with just one group…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 18
(3,896 Views)

actually jawad gave up his task in LV and shifted to some other tool.But i have tried this thing without express VIs , it complicated the issue. Nothing from the attached code.....

0 Kudos
Message 7 of 18
(3,889 Views)

Hi irsa,

 

actually jawad gave up his task in LV and shifted to some other tool.

That's a pity… (Which tool is he using now?)

 

But i have tried this thing without express VIs , it complicated the issue.

Why should it complicate things when you can reach exactly what you are asking for?

 

You made the same error as I mentioned several times before:You are reading a file in a loop but only write the last data AFTER the loop has finished.

Additionally you wire (most probably) an error to the TDMSWrite function, which will not write anything in this case…

 

So I repeat: THINK DATAFLOW! (And do some debugging to find such problems with error handling…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 18
(3,886 Views)

debug identified error tdms read but i am unable to solve it out. plz check the code if it is a correct way.tdms is created after running code but no groups , no data sampes found in it, simply a 1 KB TDMS file.

0 Kudos
Message 9 of 18
(3,859 Views)

Hi irsa,

 

with your latest VI you are trying to write data to the very same TDMS file you are reading the data from.

I thought you wanted to convert one file to a different one???

 

This is the basic principle of "reading one file and writing the data to a different file":

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 18
(3,847 Views)