01-15-2012 02:09 AM
I borrowed this VI from another thread, which works perfectly for what I am trying to do.
http://forums.ni.com/t5/LabVIEW/Convert-tdms-to-lvm/td-p/738286/page/2
What I am trying to do is record some voltages, save them to a TDMS as well as a LVM file (which the above VI does). The issue I am running into is I would like the converted LVM file to show an average of all the samples taken for each colum/channel. In other words, just have one row of the sample averages instead of multiple rows of all the samples taken. Since I didn't write this VI originally, I don't quite understand how it works and how to change it to just write the averages to the LVM file. I was hoping someone could show or tell me what to do if it isn't too much trouble.
Solved! Go to Solution.
01-15-2012 08:08 AM
you can use "index array" function to extract a specific row from an array. Leave the first index input unwired and to the second one down wire the row number you would like to extract (+1 since the array starts at 0)
01-15-2012 10:06 AM
01-15-2012 11:06 AM
01-15-2012 01:16 PM - edited 01-15-2012 01:18 PM
So would this work for a 3D array as well? In other words, if the original VI uses n amount of columns, would this average each column?
01-15-2012 04:10 PM
@MCHammer wrote:
So would this work for a 3D array as well? In other words, if the original VI uses n amount of columns, would this average each column?
No, it would average each plane because after the first indexing you get a 2D array. You can easily average each column with a little more code. Of course you also need to decide which direction you want to average, because there will be 3 different possibilities.
01-15-2012 06:18 PM
Thanks for the pointers guys. I managed to put together something that works from all the help. I thought I would post it in case someone else has the same problem as me.
01-15-2012 10:53 PM - edited 01-15-2012 11:00 PM
That inner FOR loop makes no sense at all. You should get exactly the same outcome of you would delete it.
Don't hardwire N of the FOR loop, unless your array always has the same number of columns. Read the number of columns from the array size.
Where is Array 3 coming from? What is it's size?
03-03-2016 11:28 AM
How did you get the "mean" inside the For Loop?
03-03-2016 11:43 AM - edited 03-03-2016 11:44 AM
Are you at all familiar with LabVIEW? Most likely you need to disable indexing on the array input tunnel.
.. But as we already said, the inner FOR loop is not needed.