LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read multiple tdms files into a matrix

Hi everyone,

I wrote a vi, based on my setup to view one tdms file.

I need a program which allows to import 12 different tdms files at one time and display it.

The idea is to create a matrix and load the tdms files into certain positions but I'm quite unsure how to do it.

0 Kudos
Message 1 of 7
(3,150 Views)

You can modify the VI you uploaded to use a Path Control to determine the file to read (instead of the dialog) and then call it as a subVI inside a loop.

 

Each iteration will produce all of the indicators you've set up - ROI, {in-phase, out-of-phase, reflectivity} img, TRprop (although I'd perhaps replace the local variable with a constant there), and optionally intensity graph. You might want the last one to be removed from this new 'subVI' too, and place that in the top VI, but it's up to you and your needs.

 

Once you have that, you'll need to look at the accepted ways to display your data in whatever type of graph you're looking for - the multiple plots options are described in the Detailed Help (hover over a graph and see the Context Help (Ctrl+H) on the block diagram, then choose Detailed help).


GCentral
0 Kudos
Message 2 of 7
(3,092 Views)

Thanks for your answer. You mean I should create a subVi which allows to read multiple files and than put in inside the loop?

0 Kudos
Message 3 of 7
(2,738 Views)

I mean you should make some minor modifications to the existing VI that you uploaded, and then you should put that VI inside a loop.

Pass a path value into the VI (via the new control I mentioned in my previous reply) and then use the For loop to index over the values, like this:

Example_VI.png


GCentral
0 Kudos
Message 4 of 7
(2,714 Views)

expectation1.png

Thanks for the answer. I manage to display the data in one intensity plot but I would like to have something like this (see above) where all the pics has a same scale and are not in one column but like a matrix.

0 Kudos
Message 5 of 7
(2,687 Views)

Hi Simon,

 


@simonschluter wrote:

I would like to have something like this (see above) where all the pics has a same scale and are not in one column but like a matrix.


So you want to create a larger 2D array from several smaller 2D arrays?

All you need to do is one of these two options:

  1. initialize a large 2D array and use ReplaceArraySubset to put the smaller arrays into the bigger one
  2. build the larger 2D array by using BuildArray (and maybe TransposeArray) one those smaller arrays in the right order…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(2,680 Views)

Hi GerdW,

thanks for your answer. I had more a less the same idea but I wasn't sucessful to create running Vi. I did something like this - but the result is the same, I have all tdms files display in a column not like a matrix.

Best

Simon

simonschluter_0-1580467225006.png

0 Kudos
Message 7 of 7
(2,677 Views)