LabVIEW Idea Exchange

Showing results for 
Search instead for 
Did you mean: 

Compact Stacked Shift Registers

Status: Declined

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

Stacked shift registers are very handy in some cases, but they create a lot of clutter on the block diagram. I think making a "compact form" of stacked shift registers would make the block diagram much easier to read, easier to keep clean, and faster to code when using stacked shift registers.



-----What we have now-----

Curenntly, if you use stacked shift registers you end up with something like this:

Original Stacked

-----Two Alternatives----- 


-----Alternative One-----

My first proposed compact form would look something like the following picture. In this case, the five shift registers are represented by a "shift register" with the number 5 in it. The "5" indicates that there are five stacked shift registers. The output is an array that outputs the values of the five shift registers in order.


New Stacked1

 -----Alternative Two-----

Another compact form is shown in the the following picture. In this case the last value passed around is kept out of the array and the other elements are kept in the array in order.

 New Stacked2.PNG

-----Other Thoughts-----  


With two alternatives, you can manipulate the shift register values using for loops or any other array operation. This would be much more compact than having some number of shift registers and then bundling them into an array or trying to perform some compound operation on the values. 


I imagine implementing this ideais probably more complex than the two examples I gave, but I think the main point in my examples is clear: make stacked shift registers compact.


Also, I feel this should be an option that is selectable by right clicking a shift register to toggle between the compact form and non-compact form.

AristosQueue (NI)
NI Employee (retired)

I played around with your suggestion for a bit. 


You didn't finish your diagrams ... if you did, I think you'd see some ugliness emerge...


Having the Index Array makes this a much bulkier syntax than it would be otherwise. Yes, I know that you could just wire the entire array into a Sum Array primitive, but I presumed that the Add operation was merely representative of "do various things on the diagram with the values", which might very well require you to index the individual elements. 


Having the left hand shift register's output type be different from the right hand shift register's input type is weird. I don't think it invalidates your proposal, but some people would find it strange and I suspect would decline to use this syntax for that reason. Just a guess on my part. 


Also, your case of starting all the left side values at the same amount is unusual in my experience. Usually the first value is set and the others are zero, something like this:


Your proposed syntax would make these two similar situations look different on the diagram. I'm not sure that the ease of programming the former case when writing the diagrams warrants the visual distinction between these two cases when reading the diagrams.  Thoughts? 

Active Participant

You are correct you'd see ugliness emerge if you end up indexing individual elements from the array. However, that is why I noted at the end of my post that this feature should be an option than can be toggled on/off in the right click menu. In some cases you may need to index individual elements so in that case you would use the classic stacked shift register. In cases where you can use an operation like Sum Array it will significantly clean up the wiring and reduce the time required for the wiring. Additionally, even if you did have to index individual elements and you wanted to use the array it could be done cleanly by using a for-loop.


I can see that the left hand shift register's output type being different than the right hand's might be a little confusing. Off the cuff I'm not sure if there is anything that can be done to ease this confusion, but I agree that it probably doesn't invalidate the idea.


Even though I didn't show it, the reason I created the second alternative is to address initializing the first value to something different than the others. In my second alternative I showed the first register as a regular shift register and the remainder of them in the compact form. My intention there is that the "regular" shift register can be initalized to its own value. Then, the compact shift register could be initialized to something different. Perhaps the best way to initialize the compact shift register is with an array of elements so, if needed, each can be set to its own unique value.

Trusted Enthusiast
If the look/feel of stacked SR's changes, that's fine with me. However, I would be opposed to having two views - either go solely with the classic, or solely with the new view. Fewer options means less code for NI to maintain in the LabVIEW IDE, and less chance for the end-user to be confused by the two different methods.
Proven Zealot
Status changed to: Declined

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