LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW feature request: tunnel array concatenation

I am requesting a LabVIEW feature that would be very convenient. The following situation is very common: I have a source of information, say an array of numbers, in a for-loop. When the for-loop has finished, I normally end up with a 2D-array (because of the index operation at the tunnel). Now, in many cases I would instead like to concatenate the arrays inside the loop, so that I end up with a 1D-array of numbers after the loop.

It is easy to remedy the problem: use shift registers or feedback nodes together with the 'concatenate arrays' VI. An easier approach, from a programmer's point of view, would be to right-click on the loop tunnel and select an option that, instead of adding the data from each iteration into a new array dimension, would concatenate the arrays. The tunnel could have the + symbol instead of [].

I wish I could find a more convincing argument for this feature than just convenience. But the reason for this request is just because of convenience. I find myself using the feedback nodes and the 'concatenate array' VI again, and again, and again, and again, and again, and again, and again, and again, and again... and I always need to create empty array constants for the initial value. It feels really unnecessary.

I think this feature would make LabVIEW an even more convenient programming environment.

I am using LabVIEW 7.1.

BR
Patrick
0 Kudos
Message 1 of 6
(3,771 Views)

I think I agree.

To make a product suggestion, go to the Product Suggestion Center. You can also try the LAVA forums wishlist.


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(3,762 Views)
Hello Patrick,

you can also use "Reshape Array" after the loop to form a 2D array into an 1D array... And at least this operation doesn't need to move any memory blocks around.

And yes, this may be a nice feature.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(3,759 Views)
There is one problem with using Reshape Array. If the 1D arrays are not of equal length, some padding will occur when making the 2D array, something that doesn't happen if you build the 1D array inside the loop.

___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(3,754 Views)
I have used Reshape Array as well. Quite a few times. So yes, there are three methods all yeilding the same result. But none is really as neat as the suggested method.
 
Reshape Array is useful if the wanted result is a 1D-array. In the general case, I have an k-dimensional array inside the loop (k fixed) and want an k-dimensional concatenated array when the loop is finished. In my example, I used a 1D-array because it is the most common case.
 
BR
/Patrick
 
0 Kudos
Message 5 of 6
(3,749 Views)
I agree this option would be great to have built in automatically.  It might also be nice to allow auto-indixing of 2d (or more) arrays going into for loops where it will iterate through all dimensions an grab the (i,j) single elements and add an i and j index inside the loop, instead of nesting loops inside of each other.  I guess these features cater to the power users who want to save any amount of coding possible.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 6
(3,742 Views)