LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cascade two Build Array functions - what happens?

Solved!
Go to solution

I found the the code shown in the attachment in a very complex VI that I am overhauling.  Would someone explain to me what is happening with the "cascaded" Build Array functions.

 

I can see that the first Build Array function builds a 1D array of integers which passes to the second Build Array function which outputs a 2D array of integers but, since there is no Element or second Array input, I don't see how this works.

 

This is part of a subVI that is not embedded in a loop.

 

 All the examples have at least two inputs.  With one input there is no Concatenate Inputs option. There is some implicit operation here that I do not understand.

 

Would someone explain how this works? 

0 Kudos
Message 1 of 5
(2,786 Views)
Solution
Accepted by topic author wildcatherder

You are taking a scalar value and creating a 1-D array with exactly 1 element.

 

Then you are taking the 1-D array and building it into a 2-D array, with exactly 1 element.

 

Since you can't concatenate something with nothing, the only logical mode for the Build Array would be to build it into an array of the next larger dimension.

 

You could add a third one, then you'd have a 3-D array with exactly 1 element.  And so on.

0 Kudos
Message 2 of 5
(2,779 Views)

Try it to see what happens!  This is often the best way to learn about such things.

 

Hint: 2D array with how many elements?

 

This technique is used when a function or VI following requires an array input but only a scalar value is available.

 

Lynn

0 Kudos
Message 3 of 5
(2,776 Views)

I've almost got my head wrapped around it but I need a bit of an example.  If the integer input to the "cascade" is "5", what does the 2D array of one element look like?

0 Kudos
Message 4 of 5
(2,774 Views)

OK, the result is a 2D array consisting of 1 element whic is represented by coordinate 0,0 and the value will be 5.

 

The worst of it is that this resultant array doesn't actually seem to be used anywhere.

 

Thanks for the assistance.

0 Kudos
Message 5 of 5
(2,771 Views)