04-24-2012 04:07 PM
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?
Solved! Go to Solution.
04-24-2012 04:22 PM
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.
04-24-2012 04:25 PM
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
04-24-2012 04:29 PM
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?
04-24-2012 04:35 PM
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.