08-07-2020 05:19 AM
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.
08-07-2020 05:20 AM
Example vi in the attachment
08-07-2020 07:38 AM - edited 08-07-2020 07:40 AM
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!
08-07-2020 08:25 AM
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.
08-07-2020 08:39 AM - edited 08-07-2020 08:42 AM
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!)