LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Searching a TDMS File via While Loop

I have a TDMS file contianing output data, which includes the status of a button (binary 1 or 0).  I want to search through the data for the point when the button is active.

 

I was thinking an "easy" way to do this was to read a single line of data from the TDMS file, one at a time, and then take action depending on whether or not a "1" was present.

 

I set this up in a while loop so that I could define the offset using the iteration counter.  However, I don't get an output that way.  Curiously, if I replace the iteration counter with just a numeric constant, I can get it to pull out the single line I want.

 

Why doesn't this work in the while loop?

 

 

Download All
0 Kudos
Message 1 of 6
(1,258 Views)

In while loop, TDMS Read will iterate channels for each call when there is no input for channel name and group name. So, you should give the inputs for these terminals in your case.

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

Personally, I would just read all of the data for the one channel you care about.  You can then use a FOR loop with Autoindexing to do whatever you need with the data.


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 6
(1,212 Views)

crossrulz wrote:

 

Personally, I would just read all of the data for the one channel you care about.  You can then use a FOR loop with Autoindexing to do whatever you need with the data.


Or convert the channel data to an array once it has been read out and use the Search Array function to find the next button state you want

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 4 of 6
(1,207 Views)

Those are good options, but the core file is 3.5gig (and the final ones are expected to be on order of 10gig).  Sure, it's one colum out of 23, but that's still a huge file to try and bring into LV.

 

Maybe I could take those approaches in smaller bites, though.... I'll play with it some more this morning, just discovered the EOF trigger I'd put in didn't flip for some reason, and my poor computer had been searching all night....

0 Kudos
Message 5 of 6
(1,204 Views)

Follow the process outlined above, but only deal with a "reasonable size dataset at any one time - read the file in chuncks

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 6 of 6
(1,200 Views)