キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/14
5,503件の閲覧回数

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, TestStand2016/2019
0 件の賞賛
メッセージ2/14
5,482件の閲覧回数

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 件の賞賛
メッセージ3/14
5,470件の閲覧回数
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 件の賞賛
メッセージ4/14
5,453件の閲覧回数

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 件の賞賛
メッセージ5/14
5,425件の閲覧回数
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 件の賞賛
メッセージ6/14
5,420件の閲覧回数

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 件の賞賛
メッセージ7/14
5,384件の閲覧回数

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 件の賞賛
メッセージ8/14
5,352件の閲覧回数

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 件の賞賛
メッセージ9/14
5,341件の閲覧回数

Hi all,

 

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

 

Thanks,

Jack

0 件の賞賛
メッセージ10/14
5,315件の閲覧回数