LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
cy...

Shift Register - Retain value if unwired (right terminal)

Status: New

Good day forum

 

Proposal: add "retain value if unwired" option to shift registers. particularly useful to reduce wire clutter inside and outside of loops.LIX.png

Have a great day

 

 

CY (expired CLAD)
60 Comments
Intaris
Proven Zealot

So you want it to behave as a read-only shift register?

 

Sounds kind of weird to be honest.  Why use a shift register at all then?

cy...
Active Participant

for example, the case of a for loop within state machine, it allows the value to pass by the for loop "straight", rather than a tunnel and another parallel wire hugging the for loop. reason for unwired option is to pass it through without the for loop wires cluttering, also to address the issue of N=0 for for loop or auto-indexing. it can make wire tracing much friendlier

 

 

CY (expired CLAD)
Intaris
Proven Zealot

So something like the Event registration refnum terminal on the Event structure, it retains the input value if unwired..... and wired cases overwrite.

 

Should it also be applicable to case structures, conditional disable structures and so on and so forth? Cases wired to the output overwrite and cases unwired retain the value?  This would really make is just like the event registration refnum terminal of the event structure.  It seems that in conjunction with such structures, the wiring benefits would be much greater as some cases may be wired and some not.

 

Almost sounds like a new primitive, not an extension of the shift register.

wiebe@CARYA
Knight of NI

Simply change your style guide to allow wires behind structures. Problem solved Smiley Surprised.

Shift Register - Retain Value.PNG

Not trying to stat a flame war, I'm actually considering if I like the idea or not. Might actually be something to it...

 

I think I'd prefer a specialized linked tunnel, as it would be useable in all structures, not just loops:

Shift Register - Retain Value 2.PNG

 

EDIT: That crossed Intaris' post, I think we're saying more or less the same thing from totally different perspectives...

Intaris
Proven Zealot

Wiebe, yup. I think we've converged on pretty much exactly the same idea.

cy...
Active Participant

Special tunnels may work too... but may be problematic when used with For loop's auto-initialize or N=0 cases. But is there any underlying concerns with it being a shift register?

CY (expired CLAD)
wiebe@CARYA
Knight of NI

Yes, shift registers don't exist for case structures, sequence structures, event structures, etc. (all non-loop structures), that have the exact same issue.

wiebe@CARYA
Knight of NI

>Special tunnels may work too... but may be problematic when used with For loop's auto-initialize or N=0 cases

 

That's a matter of implementation... It should return the value that was put into it (what else, and why?).

 

I agree that the shift register is a bit more descriptive, or closer to what you want. But the fact it's only there in loops is a deal breaker. Adding (those special) shift register to every structure seems a bit far fetched. And since they all have tunnels, that seems more logical (to me).

Intaris
Proven Zealot

Shift registers do some things normal tunnels don't

 

1) Exist only in pairs

2) Provide the last output value on the next iteration

3) Only work with FOR loops and While Loops

 

I would argue that the mode of operation "retain values when unwired from within the structure" only makes sense when pairs are defined which I think is why the OP has chosen Shift registers.

 

But having said that, for me, the real value of this operation would come when we extend the functionality to other structures with conditional execution modes (Event, Case etc) which is incompatible with shift registers.

 

I remain the opinion that this proposal is a slightly different beast, separate from tunnels or shift registers (or Feedback nodes).

wiebe@CARYA
Knight of NI

The "exist in pairs" could be a feature of those special new tunnels.

 

One problem with tunnels is they don't automatically stay at the same height, something shift registers do.

 

A completely different solution would be a specialized structure or an in place element structure with a new "wormhole" element:

Shift Register - Retain Value 3.PNG

This would be useful for me in complex state machines or elaborate event structures, where you'd typically have a lot for shift registers passing through the cases\events.