LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

New to Labview. Is there a TDMS VI I can use to decimate TDMS files

I have very large TDMS files(GB range) and I am trying to import TDMS and decimate the TDMS file by taking every 20th sample point. Is there a VI out there that I can use for this? I am new to Labview and tried building the VI my self and failed.

0 Kudos
Message 1 of 20
(3,139 Views)

The TDMS Read VI has a count and offset control.  So you can choose to only read at offset 0 a count of 1, then at offset 19 a count of 1, then at offset 38 a count of 1.  This should be done in a for loop and using the i terminal to help determine the offset you should be reading at (i * 20) - 1 should do as you want.

0 Kudos
Message 2 of 20
(3,119 Views)

@Hooovahh wrote:

The TDMS Read VI has a count and offset control.  So you can choose to only read at offset 0 a count of 1, then at offset 19 a count of 1, then at offset 38 a count of 1.  This should be done in a for loop and using the i terminal to help determine the offset you should be reading at (i * 20) - 1 should do as you want.


First you increment by 19, then you give a formula that doesn't match what is needed.

 

All you need is take sample i*20 and write it into a new TDMS file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 20
(3,109 Views)

@crossrulz wrote:

@Hooovahh wrote:

The TDMS Read VI has a count and offset control.  So you can choose to only read at offset 0 a count of 1, then at offset 19 a count of 1, then at offset 38 a count of 1.  This should be done in a for loop and using the i terminal to help determine the offset you should be reading at (i * 20) - 1 should do as you want.


First you increment by 19, then you give a formula that doesn't match what is needed.

 

All you need is take sample i*20 and write it into a new TDMS file.


Wow...well I guess I won't get the kudo for this one then.

0 Kudos
Message 4 of 20
(3,102 Views)

Attached is the TDMS VI that I put together with your info. The problem I am running into is an Error 4 Occurred at TDMS Read in TDMS VI..vi End Of File Encountered. This happens as soon as it loops 3 iterations. How do I get it to read correctly? Could you please modify my VI so that it will work and attach it in a reply post? Please

0 Kudos
Message 5 of 20
(3,074 Views)

I thought you wanted to grab every 20th sample.  This code is nowhere close to doing that.  First of all, your number of samples to read should just be set to 1.  Use a while loop and exit when you get that End of File error.  You will get that when you read the last possible value.

 

Give this code a try.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 20
(3,061 Views)

First off, I want to thank you very much for the help and the VI. Here is the problem I face now. The vi goes through the first loop(header info) and when it enters the second loop(actual data) it encounters the error code 4 End of File Encountered. What will fix this issue? Attached is a sample of the large file(which is TDMS, but I zipped it in order to post it), this might help us both understand how to get is get the final file that contains every 20th sample.

0 Kudos
Message 7 of 20
(3,023 Views)

You actually just posted a shortcut to the data, which is useless to me.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 20
(3,015 Views)

I zipped it though WinZip which is a free software to download and enables you to unzip this file. I dont know of any other way to compress the file and send it via this post. Any thoughts?

0 Kudos
Message 9 of 20
(3,005 Views)

Give this VI a try.  It iterates over each group and channel and writes 1 sample at a time.  You will want more descriptive channel and group names to make this work appropriately.  With your given test TDMS file, all of the channels come out to "Untitled", so you only get 1 channel in the end.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 20
(2,994 Views)