LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
DanielMurmann

Permit to replace Stacked Sequence for a For Loop....

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined. 

It would be interesting if the replace option when selected a "Stacked Sequece" had available the option of replace with a for loop. I think this feature will save lot of time due that at the moment lots of cables get broken.

7 Comments
RavensFan
Knight of NI

There is an option to replace a stacked sequence with a case structure.  That makes sense.  From there you can wrap it with either a While Loop or For Loop.

 

You can't replace a stacked sequence with a For Loop.  Every frame of a stacked sequence is different.  Thus it closely correlates to a case structure where every case is different.  A For Loop is a single structure where the code inside of it is the same for every iteration of the for loop.  There is no logical correlation from a stacked sequence to a for loop like there is between stacked sequence and a case structure.

DanielMurmann
Member

I Understand your point of view, but what I really ment was a Stack Sequence of only one frame, thanks for the correction.

RavensFan
Knight of NI

If it's only one frame, then you just wrap it with a for loop and remove the sequence frame.

DanielMurmann
Member

I know that trick, but the problem of this are the default tunnels and default indexing in the forloop (Lots of clicks = Time), maybe it would be great with default shift registers at the replace im proposing dont you think??

RavensFan
Knight of NI

I believe there is a message idea somewhere suggesting that the tunnels that are picked when dropping loops be smarter based on what the datatypes are. When a For Loop is Dropped Around a Node, Use Shift Registers Instead of Auto-Indexed Tunnels for Ma...  In other words, don't create an autoindexing tunnel on a boundary when obviously the wire is the same number of array dimensions going into the loop as well as out.  Whether it would be an ordinary tunnel or a shift register, what you might want to have as a default may not be what someone else wants as default.  The tricky part about a shift register is that in order for LabVIEW to create it, it has to be smart enough to figure out which wire on the other side of the loop should be the matching wire when there could be many choices, or possibly zero choices.

 

Overall, I see this idea as falling into the same category as the comments Aristos Queue makes in this idea Copy Cases Between .vi's.  That it is used so rarely, and that the amount of work that goes into developing it to make it work correctly isn't worth the time.

 

I think anytime you are going to clean up code to eliminate sequence structures, the programmer has to take some amount of manual effort to make sure it works property, wires are cleaned up, tunnels are fixed, etc.  If you only need to fix a few sequence structures, it won't take that long to do this.  If you need to fix so many sequence structures that having such a tool really benefits you, you are probably in the boat where you should scrap the whole VI and start from scratch.

 

 

altenbach
Knight of NI

> I know that trick, but the problem of this are the default tunnels and default indexing in the forloop (Lots of clicks = Time), maybe it would be great with default shift registers at the replace im proposing dont you think??

 

Sequence structures don't have shift registers, and shift registers come in matched pairs (input, output), thus repalcing tunnels with shift registers automatically is not possible, because the computer cannot know what to mach up and there could be millions of combinations.

 

If you don't want autoindexing of arrays at the loop boundaries, place a WHILE loop first, then replace it with a FOR loop right after.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.