LabVIEW Idea Exchange

About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
cancel
Showing results for 
Search instead for 
Did you mean: 

Add a "Concatenate Indexing" option for arrays leaving loops

When an array leaves a loop with indexing enabled, you get an array which has one more dimension, but quite often you want to concatenate the data to an array with the same number of dimensions.

 

If the subarrays have the same length, you can use reshape array, but usually they don't and you need to do something like below.

 

It would be very useful if output tunnels for arrays had an "Enable Concatenate Indexing" option as well, as depicted below, which would do this.

 

 Concat Indexing.PNG

 


___________________
Try to take over the world!
24 Comments
Proven Zealot

Never thought of that, but it would indeed be a nice idea.....

 

Shane.

Knight of NI Knight of NI
Knight of NI

Even better, if NI combines this with conditional auto-indexing, the tunnel would also have a boolean input which would determine whether the current array gets appended or not. This would be equivalent to placing a case structure around the Build Array primitive in the above picture.

 

 


___________________
Try to take over the world!
Proven Zealot

Tst,

 

this would mean the boolean would toggle between "concatenate" and simply outputting the last iteration.  If it switches between concatenation and indexing then the output datatype is dependent on the state of the boolean which can only be determined at run-time....  I don't see how that would work.

 

Shane.

Knight of NI Knight of NI
Knight of NI

this would mean the boolean would toggle between "concatenate" and simply outputting the last iteration.


No, my intention was that the boolean value wired into the input will determine whether the subarray IN THE CURRENT ITERATION will be appended or not (assuming you've enabled concat indexing at edit time). As I mentioned, this would be equivalent to placing a case structure around the Build Array primitive in the above picture.

 

This is a very common use case when concating arrays, because you often don't want the values from every iteration of the loop, but only from iterations that fulfill a certain condition.


___________________
Try to take over the world!
Knight of NI Knight of NI
Knight of NI

I realized I never did an illustration for the conditional concating. Here's how it could look, compared to the existing situation:

 

Conditional concat.PNG


___________________
Try to take over the world!
Member
I don't like this. It would add another possible behaviour for loop terminals, completely different from current possible behaviours for loop terminals, that new users would have to get to grips with before they could understand simple LabVIEW programs. I don't think the minor saving in time and diagram space is worth it.
Active Participant
Nice idea. I would like a terminal that I can differentiate better from the current automatic indexer.
André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
Member
I like this idea since I use looped arrays in much of my code.  I think the graphic indication needs to be a bit larger and distinctive from the normal dimentional array.  However, I think this is a major time and space saver.  Great Idea!
Member
I love it!  This would be useful for while loops as well.
Robert Mortensen
CLA, CLED, LabVIEW Champion, World's Fastest LabVIEW Programmer
Principal Systems Engineer, Endigit
Member
Another big advantage to this is rather than potentially allocating new memory each time the build array primitive is called in the for loop, new memory can be allocated only one time once the for loop has finished executing and the final array size is known.