LabVIEW APIs Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: For Loop Pass Through Utility

Member

Ever want to drop a for loop around a chunk of code and Not have auto indexing created on all the terminals and have all terminals that you want to 'pass through' the loop be turned to Shift Registers?

2013-04-01_1915_001.png

2013-04-01_1916.png

2013-04-01_1919.png

Would you like something that acts like this?   http://screencast.com/t/jGDycjpVm

Download the attachment and check it out.

Feel free to make it into a quick drop shortcut and post online.

It's not bulletproof and due to time constraints, not robust error checking.

Presumed operation

*Drop a For Loop around a chunk of code

*Select that for loop only

*Run Scripting command

***************************UPDATE***************************

An updated version which is made for Quick Drop Keyboard Shortcuts is available at

http://lavag.org/topic/16701-for-loop-pass-through-utility-cross-post-link/?p=102354

========================================

Enjoy

~,~

Comments
Proven Zealot

Nice tool Norm, but I would almost bet that in the code you show in the screenshots the upper most VI should probably not have been included in the loop. It would seem that you "leak" object references that way that never are gonna be used in the program if the loop executes more than once.

But it's an interesting example that your wizard is actually very smart to only turn tunnels into shift registers that make actually sense. Personally I think a combination of the old behaviour with yours would be best. The uppermost object reference should most likely be autoindexed.

Rolf Kalbermatter
Averna BV
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
Member

Nice, but is it possible to have it in LV2011 or below.

Thanks

Member

Rolf, yes, good catch, it was only for example.

Originally the code only looked for it's mate by location, Which in the case of the upper information, failed.

So I put a type check inplace and that was simply the invocation of the test.

And most certainly I don't want the default behavior to change, I think that this one needs to exist in concert with it

Member

Saved to 2009 (untested)

Member

An updated version which is made for Quick Drop Keyboard Shortcuts is available at

http://lavag.org/topic/16701-for-loop-pass-through-utility-cross-post-link/?p=102354

Knight of NI

"Ever want to drop a for loop around a chunk of code and Not have auto indexing created ..."

A trivial solution to the first problem (sometimes all we want is no autoindexing!) is to place a while loop, then immediately change it to a FOR loop (right-click...replace).

Of course for many of the created tunnels, autoindexing makes no sense and LabVIEW should be a bit smarter about where to apply autoindexing. That's why we have this idea )


LabVIEW Champion Do more with less code and in less time