LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I modify my VI such that it looks like the table below in excel? I tried, but kept getting a broken VI.

Solved!
Go to solution

I have a picture of my VI below or clicked the attached file to the VI on labview

I want to generate a table like this when I run my VI:Capture.PNG

 

Here is my VI:

Capture.PNG

Thanks for your help, guys!!!!!

0 Kudos
Message 1 of 7
(2,634 Views)
Solution
Accepted by topic author GRC5000

Is there a reason for the doubly nested For Loops?

Get rid of that extra N=2 For Loop.

Get rid of that last Build Array.

Check all of your array operations and the auto-indexing tunnels.

 

 

You have an inner For Loop creating a a couple 1-D arrays.

An outer For Loop creating 2-D arrays.

A Build Array building those 2-D arrays into a 3-D array.

A Build Array building that 3-D array into a 4-D array.

 

Then you are feeding that 4-D array into the Excel function.  No wonder that function doesn't know what to do with it.

 

Only keep the items I bolded in the list above.

Message 2 of 7
(2,609 Views)

You are basically writing a 2D Table that starts in (Excel) Row 2, Column A.  As RavensFan points out, you appear to not understand much about LabVIEW, as Arrays and how they interact with For loops is generally covered in the first few lectures.

 

There are some pretty good examples of how to use the Report Generation Toolkit to write nicely-formatted Excel Reports, including Reports that have Column Headers.  Once you've learned how to build a 2x2 Data Array that you want to write to Excel, check out the Examples, including those found in the Forum (such as this one.

 

Bob Schor

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

The doubly nested for loops create a 2x2 table

0 Kudos
Message 4 of 7
(2,546 Views)

No, they don't. They create a two 2 x 2 arrays, that you then build into a 2 x 2 x 2 cube.

 

If you get rid of the 2nd random number generator and the build arrays, you'll get a 2 x 2 array.

0 Kudos
Message 5 of 7
(2,541 Views)
Solution
Accepted by topic author GRC5000

@GRC5000 wrote:

The doubly nested for loops create a 2x2 table


Not the way you are doing it!

 

You were creating two 2x2 arrays, then building them into a 2x2x2 3D arrays, then building it into a 4D array.

 

I recommend to go back to the basic tutorials, then create a small VI playing with loops and array functions until you actually get a single 2x2 array. Only after all that add the excel stuff.

 

Here's a hint to get you started:

 

exearray.png

Message 6 of 7
(2,538 Views)

Hey RavensFan. Thank you very much. I know I'm pissing you off with all my labview questions, but I still love you, bro. You are awesome and don't forget to cheer for the green bay packers. WHOO WHOO WHOO WHOO. They are going to play the chiefts in the evening. The chiefs are going to get packed.

Message 7 of 7
(2,524 Views)