LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS data manipulation

Hello all! 

 

I have been working on a measurement software which takes a lot of analog input data. 100 million samples over 100 seconds to be exact. 

 

I have successfully made the measurement part and it is saved to a TDMS file. Now I would need to find the last data point that is over the value of 2.0 and record that index. 

 

Next I have an array of index values ready which are the ones I want to save to a spreadsheet. This array is calculated prior to filtering and the index of last 2.0 value is added to values of this array. 

 

I've never done anything with TDMS file format so I'm not sure how to go about this. Can I somehow pick the indexes from the file with a loop and save to spreadsheet? 

And how is the data handled in the file? Is it a 2-D file with time and data? Can I think of it as an array when handling it in the loop?

 

In the example vi I left a loop marked DATA FILTER which should do what I described. It gets the TDMS data and index array as inputs.  

 

 

0 Kudos
Message 1 of 5
(1,659 Views)

Example vi in the attachment

0 Kudos
Message 2 of 5
(1,658 Views)

Hi Akuaku,

 

maybe you should start to explain (and debug?) this part of your code:

I refactored the code, see my version above.

Both give the very same result: an empty array! How should we use this empty array for filtering the DAQ data?

 

The TDMS gives you an array of waveforms - as can be seen in the context help when you move the mouse over this brown wire!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 5
(1,615 Views)

Hello Gerd and thank you for the reply!

 

I feel stupid not thinking the output is an array of waveforms. So I think I can get the data with a simple Get Waveform Components- block. Hopefully from there I can gain the indexes I want. 

 

For your other question about the index array building I dont know what to tell you. It seems to work for me. I probably shouldn't have included in the example as it is quite confusing. I made it based on an equation I derived so thats why the sum is on a loop of its own. Doesn't really matter I suppose as long at it works...

 

I posted an VI with just the array building. With it I gain the array just fine.

0 Kudos
Message 4 of 5
(1,601 Views)

Hi Akuaku,

 

now the cleanup of this array generation VI is correct:

No need to calculate that logarithm twice, no need for a shift register to calc a sum of an array, no need for the case structure with those conditional loop tunnels…

(Many LabVIEW functions are polymorphic: they can operate on scalars and arrays!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(1,595 Views)