LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
ASInc

Auto-indexing Tunnels and Multi-Dimensional Arrays

In their current form, Auto-Indexing tunnels only operate on a single dimension of an array.  For example.  If you input a 2D array, through an auto indexing tunnel into a for loop, and display the resulting 1D array in an indicator inside the for loop as below, you will always get the last row.

 

I'd like to see a feature where you can right-click on the tunnel or something, and set it to auto-index by column, instead of by row, and get the last column instead.20773i86B483107F51CD3820775i651136B201680B64

 

It could be as simple as an option in the context menu for the auto-indexing tunnel to say "Index by rows" or "Index by columns"  It gets more complex with 3D 4D and moreD arrays, but you could do something like a submenu flyout that says "Index By Dimension" > "1", "2", "3" etc

 

9 Comments
RavensFan
Knight of NI
ASInc
Member

I think if nothing else, I made the idea more clear.

Dennis_Knutson
Knight of NI

Try this 'workaround'.

 

20783iAAA7FB95C0B60E67

ASInc
Member

The only thing with that, is that it creates a memory copy of the 2D array at the transpose array node.  With very large arrays (such as those in the program I ran into this problem in) memory copies are a VERY bad thing.  Also, its not expandable to support 3D, 4D, and moreD arrays. (not that I can think of any reason to need a 5D or 6D array.  Thats just sillyness.)  Even 4D arrays seem like a bit much for most things.

Dennis_Knutson
Knight of NI

All valid points and I kudoed the original suugestion. My point was that I expect that the vast majority of users will never use anything greater than a 2D array and the transpose is sufficient.

JackDunaway
Trusted Enthusiast

@ASInc wrote:
The only thing with that, is that it creates a memory copy of the 2D array at the transpose array node.

Maybe, maybe not. Check out AQ's comment, and Andrey's benchmark. Intuitively, one might assume a memory copy is made (and Show Buffer Allocations supports the theory a new allocation is made), but perhaps a flag is set on the 2D Array only to transpose the index interpretation? I would love to hear R&D jump in an give a definitive answer for whether Transpose 2D Array requires a new memory allocation.

ASInc
Member

I expect that it is as posted in AQ's comment.  The transpose only ACTUALLY transposes the data into a new memory allocation if shoved into certain constructs, or into a subVI.

G-Money
NI Employee (retired)

I am going to decline this idea since there is a duplicate and it has more kudos. Please refer to the other idea to add kudos and raise the idea up the food chain.

G-Money
NI Employee (retired)