LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone help me find this???

Solved!
Go to solution

Hey people, I am trying to recreate an Array function but got stuck in this tool. Thanks in advance who are spending their time. 

0 Kudos
Message 1 of 5
(705 Views)
Solution
Accepted by topic author Archer_Longleaf

That is the "build array" block.

 

The feedback node is passing the output array back into the build array function of every iteration of the loop.

Essentially every new value of "PV" is being added to the end of the existing array of PV values.

Message 2 of 5
(695 Views)

If you look carefully at the Block Diagram whose (partial) picture you posted, you might have noticed a "thin wire" (representing a Float) was on one input, and a "thick wire" (representing an Array of Floats) was on the output.  This might have clued you to look at the Array palette and see if any of the functions pictured matched the Build Array function in the Palette.

Build Array methods.png

 

I would have expected you to ask about the Feedback Node (which, I confess, I still try to avoid).  Here are three ways to build an array consisting of the integers 1..10.  The first uses an (uninitialized) Shift Register and Build Array to gradually build an Array of [1], then [1, 2], and finally [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], which is the final Array 1 output.  The second, which is basically your code, uses a Feedback Node to make a sort-of "local Shift Register" and does the same thing.  But my favorite method, the simplest (if you don't need to actually use the partial Array within the While Loop) is to use an Indexing Tunnel to "hide" the building of the Array until the function exits.  Notice how the code inside While Loop #3 is much simpler and (in my opinion) easier to understand.

 

Bob Schor

Message 3 of 5
(640 Views)

Many functions dynamically change their appearance depending on what's wired to it, including the "build array" node you circled. Your question seems to be specifically about that, so I won't talk about things that have not been asked.

 

Here are a few examples how it changes its look based on what is wired to it. (All inputs can differ only by maximally one dimension order and mismatched sizes will be padded to the largest input with zeroes as needed)

 

altenbach_0-1700672883539.png

 

 

Since you only show a truncated diagram I will refrain from commenting on the sanity (or insanity) of the rest of the code, we can't even see the initializer terminal of the feedback node! If you want help to cleanup the rest, please attach your entire VI and explain what it is supposed to do.

Message 4 of 5
(609 Views)

Thank you for the explanation...

0 Kudos
Message 5 of 5
(563 Views)