LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Reading TDMS File In Chunks

Hi all,

 

I am having some major problems reading in all channels from a tdms file in chunks (to reduce memory load). The code below reads all channels, but does not loop to build an array. Only the first iteration of the while loop is read.... Any suggestions greatly appreciated.

 

Many thanks.

Jack

 

Read TDMS.png

 



0 Kudos
Message 1 of 14
(3,079 Views)

Hi Jack,

 

what is the reason for "Only the first iteration of the while loop is read"? Why doesn't it work correctly in the next iterations?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 2 of 14
(3,058 Views)

Maybe a little more info would be helpful.

 

Does the loop stop after the first iteration, or is it still running, but not reading anything?

 

Are you getting any errors at the end of the run?

0 Kudos
Message 3 of 14
(3,046 Views)
Hi all,

I want to read to whole file (all channels) in smaller chunks.... When run, only the first iteration shows on the graph with an EOF error..

I need the loop to keep running when the file is read for processing.

thanks,
jack
0 Kudos
Message 4 of 14
(3,029 Views)

Hi,

According to the doc of TDMS Read,

"If you do not wire data to this input, LabVIEW reads data from the first group when you run this function for the first time. If you run this function continuously for multiple cycles without wiring the group name in input, LabVIEW reads data from the nth group at the nth cycle. " 

 

In your case, even you have "offset" and "count" wired, TDMS Read reads data for the next group in your loop instead of next chunk of your current group. My advice is that you can use TDMS List Contents to get all the groups and channels, then read all channels one by one and chunk by chunk.

0 Kudos
Message 5 of 14
(3,001 Views)
Hi deppSu,

Is it a simple matter of wiring both straight through? I thought I did this and it still did nota work.... Will try again when back in the office..

Thanks.
Jack
0 Kudos
Message 6 of 14
(2,996 Views)

Hi deepSU,

 

Please see the attached... I assume I have inserted the "List Contents" vi into the correct location...

 

Still not worrying as needed? Each chunk loads as a different channels and arrays do not append,

 

Thanks,

Jack

0 Kudos
Message 7 of 14
(2,960 Views)

I don't think you can get the "NI_ChannelLength" from a TDMS group instead of a Channel. Except for that, your VI looks O.K. to me.

One thing to notify is that the chunk you set means samples not bytes. And you can observe your tdms file by TDMS Viewer to see the actual length of your channels.

My question How many iterations does your loop run? If it's possible you can upload your TDMS file and we can see if your VI works.

0 Kudos
Message 8 of 14
(2,928 Views)

Hi deppSu,

 

See attached vi... This now reads all data in chunks BUT each chunk does not concatenate as required? Each chunk is stored in a new row.

 

Surely this is a simple fix?

 

The tdms file (and index) will not attach as I get a "The file does not have a valid extension for an attachment" error on upload?

 

Thanks,

Jack

0 Kudos
Message 9 of 14
(2,917 Views)

Hi all,

 

Could someone please help with this? Getting desparate....

 

Thanks,

Jack

0 Kudos
Message 10 of 14
(2,891 Views)