LabVIEW Idea Exchange

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

When a For Loop is Dropped Around a Node, Use Shift Registers Instead of Auto-Indexed Tunnels for Matching Scalar Inputs/Outputs

Status: Completed

Implemented in LabVIEW 2014

I think it would be nice if LabVIEW was smart enough to know that when I drop a For Loop around scalar inputs it doesn't auto-index output tunnels - but rather uses Shift Registers - for matching inputs and outputs.

The common use case for this is with the Error input/output - it annoys me how it becomes an Array output.

 

As it is already wired, inline and not broken, dropping a For Loop around it should not break my code! 

 

Reference or Class inputs are other use case too - I want to pass the same thing around not create an Array

Shift registers are better than non-auto-indexed tunnels (other option) as they protect the inputs on zero iterations.

 

21826iFF181EE2E7ECE408

 

This would remove one step required for most use cases, speeding up my development experience.

Certified LabVIEW Architect * LabVIEW Champion
14 Comments
Intaris
Proven Zealot

I would suggest a slight change.  If the wires connected to the VIs being surrounded are broken (Due perhaps to an array input not being compatible with a scalar input on the VI) the for-loop should have indexing elements.  If the wires are OK, then it should insert shift registers.

 

There ARE some times where I want a loop with indexing inputs this way.

jgcode
Active Participant

Yes I totally agree with you.

The following comment was to cover that requirement:

 

"As it is already wired, inline and not broken, dropping a For Loop around it should not break my code!"

 

 

 

Certified LabVIEW Architect * LabVIEW Champion
Intaris
Proven Zealot

Oh, OK.

 

Spoiler

We're losing him.  I need 200mg of Caffeine stat!

 

Comment to self.  Read BEFORE commenting......

jgcode
Active Participant

Actually I did I minor edit to include this straight after I posted - to make a more clearer point.

So you may have read the first one and commented on it whilst I was doing the edit.

 

What do they say.. great minds....

Anyways I couldn't let you be that hard on yourself - I'd feel terrible 🙂

Certified LabVIEW Architect * LabVIEW Champion
Intaris
Proven Zealot

Nice of you to give me a get-out-of-jail-free avenue.

 

On mature recollection I think you're right.

Spoiler

I'm not going to say what you were right about, that would ruin the getaway..... Kudos either way

jgcode
Active Participant

Vote for this related Idea here

Convert valid Shift Register to Non-Auto-Indexed Tunnels 

Certified LabVIEW Architect * LabVIEW Champion
Jason_Harrigan
Member

I'd state it this way: if there already exists an input of the same data type, at the exact same vertical position (same pixel count), then output should index if the input was indexed, or be a tunnel if the input was a tunnel.

NJKirchner
Active Participant

https://decibel.ni.com/content/groups/labview-apis/blog/2013/04/01/for-loop-pass-through-utility

 

This might help a little, although not everything you've dreamed of

G-Money
NI Employee (retired)
Status changed to: In Development
 
Darren
Proven Zealot
Status changed to: In Beta