From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Quick Drop Enthusiasts

cancel
Showing results for 
Search instead for 
Did you mean: 

Should Ctrl-D on a For Loop include the "N" terminal?

It's really handy to use the Ctrl-Space, Ctrl-D shortcut to create indicators on loop tunnels (and shift registers). Take this code for example:

parse.png

I can select the For Loop, and very quickly create indicators for the error, style array, and label array by pressing Ctrl-Space, Ctrl-D:

parse2.png

But notice that it also creates a control for the "N" terminal of the loop. I *always* end up deleting this terminal right after it's created.

So the question is, should Ctrl-D on a For Loop ignore the "N" terminal? Here are the potential changes I can think of to make in LabVIEW 2014 to address this issue:

  1. No change. The "N" control will always be created (and I'll always end up manually deleting it).
  2. Never create a control off the "N" terminal of a For Loop with the Ctrl-D shortcut.
  3. Conditionally create it or ignore it, depending on some string typed in the Quick Drop text box before pressing Ctrl-D. For the sake of coding speed, I would prefer this option just be a single character (like "f" for For Loop).

Option (3) is the safest option to satisfy all use cases, but also the least discoverable. Let me know what y'all think.

0 Kudos
Message 1 of 10
(9,820 Views)

Screw safety, this is a development tool that has no impact on previously existing code. Option 2 all the way!

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 2 of 10
(5,027 Views)

Could you detect if an input tunnel is autoindexing?  If so, only create a control for the N if a autoindexed input tunnel is not detected.  I guess you could call that option 4.

If that isn't possible, I say you have more important things to do, so option 1.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 10
(5,027 Views)

While you're fixing the loops with Ctrl+D, can you make it work with just the tunnels selected? That might make changes to the "N" unnecessary. I've tried numerous times to select a tunnel on the loop and Ctrl+Space Ctrl+D with no results .

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 4 of 10
(5,027 Views)

crossrulz wrote:

Could you detect if an input tunnel is autoindexing?  If so, only create a control for the N if a autoindexed input tunnel is not detected.  I guess you could call that option 4.

If that isn't possible, I say you have more important things to do, so option 1.

I have more important things to do than improve the usability of productivity features in LabVIEW that I also happen to use every day?

I do like option 4, and I don't think it would be that hard to do.

Charles_CLA wrote:

While you're fixing the loops with Ctrl+D, can you make it work with just the tunnels selected? That might make changes to the "N" unnecessary. I've tried numerous times to select a tunnel on the loop and Ctrl+Space Ctrl+D with no results .

Yeah, Ctrl-D doesn't look at tunnels today. I guess it could. It should be fairly easy for me to add support for the outer (source) terminals of all tunnels...and maybe shift registers too.

0 Kudos
Message 5 of 10
(5,027 Views)

Darren wrote:

I have more important things to do than improve the usability of productivity features in LabVIEW that I also happen to use every day?

Hey, we need some way to slow you down.  How else can one of us finally catch you?

The more I think about it, the more I like my option 4.  The only time I use the N is when I am not autoindexing an input.  So it makes complete sense.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(5,027 Views)

If you get the tunnels working, I'd be happy to alpha test it for you

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 7 of 10
(5,027 Views)

Ok, alpha testers, here you go. Copy this VI to your LabVIEW 2013\resource\dialog\QuickDrop\plugins folder (backup the VI that is already there in case I screwed something up). This update to the Wire All Terminals shortcut implements the following functionality:

  • If a For Loop is selected, all tunnels get constants/controls/indicators created except for the 'N' terminal, provided there is at least one auto-indexing input to the loop.
  • Including tunnels and shift registers in your selection is now supported.
  • Password protection for this plugin VI has been removed (due to a previously-private method becoming public/scripting in 2013).

Let me know what y'all think!

Message 8 of 10
(5,027 Views)

Quick initial testing looks good.  Will continue to play with it though.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 10
(5,027 Views)

Looks good! no issues thus far. Thanks Darren!

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 10 of 10
(5,027 Views)