LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying m by n arrays on a 2-D table

I have an m by n array generated by two nested for loops where the inner for loop has two values (columns) I wish to display, and the outer for loop has one value I would like to display. The C code equivalent of my VI would be:

for (Pin = Pstart; Pin < Pstop; P++)
{
for(freq = start; freq < end; freq = freq + iterator)
{
Read "Pout" from instrument
}
}

Thus I want to display a 2D table consisting of values:

Pin freq Pout
0 1 2
0 2 2.2
0 3 2.1
1 1 3
1 2 3.1
1 3 3.3
0 Kudos
Message 1 of 3
(2,151 Views)


@EEjener wrote:
I have an m by n array generated by two nested for loops where the inner for loop has two values (columns) I wish to display, and the outer for loop has one value I would like to display. The C code equivalent of my VI would be:

for (Pin = Pstart; Pin < Pstop; P++)
{
for(freq = start; freq < end; freq = freq + iterator)
{
Read "Pout" from instrument
}
}

Thus I want to display a 2D table consisting of values:

Pin freq Pout
0 1 2
0 2 2.2
0 3 2.1
1 1 3
1 2 3.1
1 3 3.3




On the diagram, right-click the output of the outer loop, and create an indicator. LV will create a 2D array for your results. If you need a "table" instead of an array, then you have first to convert the numeric values to strings, and then you can use a 2D table (in "List & Table" sub-palette

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 2 of 3
(2,146 Views)
Thank you
0 Kudos
Message 3 of 3
(2,131 Views)