LabVIEW Idea Exchange

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

Shift registers for Stacked Sequence Structure

Status: Declined

The Stacked Sequence Structure was removed from Quick Drop/palettes in LabVIEW 2014, and NI has no plans to include it in LabVIEW NXG.

The one place I use Stacked Sequences is for setting up various parameters at the start of a vi. I usually have several frames, especially if the setup is complex, with each frame performing a different class of operations (reading from config files, checking for hardware, setting control appearances, etc.). And often, I find that multiple frames need to plug values into clusters at different points in the setup sequence. Sequence Locals for passing these clusters from frame to frame are terrible since wires have to backwards to come out of the locals, and the result is ugly and non-intuitive. So why not not have Shift registers, just like in loops. Much nicer. It might make Stacked Sequences more acceptable.

 

48 Comments
David_Ferster
Member

"you just let the subVI find the control refnums itself"

 

And how might you do that? I can think of passing the main vi's ref, getting all its CtlRefs in the subvi and then searching by name. Is there a better way?

SteenSchmidt
Trusted Enthusiast

For true reuse you could let the subVI get the caller's (or the Top-Level VI's) VI refnum from the call stack, and then you would get to the control refnums by name, by data type, by location, by basically any other property you could think of to identify the proper control. If you for instance are already providing the control's value in a config file, you could in the same file have that control's name (or some other trait) which would decouple your configuration subVI completely from wired references.

 

Decoupling the configuration subVI like this works against dataflow of course, so it's a balance between readability, maintainability, and code robustness. It's a fine line, but one drawn better with subVIs than with a stacked sequence IMO.

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
lvABC
Member

I understand the sentiment of lots of people who are against “Stacked Sequence Structure”.
I wouldn’t go as far as saying it’s useless, it serves the purpose sometimes.
I think it can be improve by adding few features
    1)Sequence Name
    2)Allow Shift Register

 

-lvABC
Sequence.png

Ray.R
Knight of NI

I agree with tst's first post.

 

I don't like Stacked Sequence Structures.  The lead to horrible coding practice and should be removed from LabVIEW.  Providing additional features for such a bad structure will simply lead to more horror code.

 

Bad idea. 

 

lvABC, why not use a state machine implementation?  Why design something bad when something good already exists?  Why do you insist on using a structure that leads to bad coding practice?  It does not make sense.  Two bads do not make a good!

David_Ferster
Member

I don't see why stacked sequences are so "horrible". What's the difference if I group a series of unrelated actions that are performed in a sequence in a set of "hidden" frames, or in a set of subvi's, which are also hidden. It is actually more convenient to flip through the frames of a sequence then it is to laboriously open each vi to examine its code.

Ray.R
Knight of NI

Why do you compare the structure with having to open various VIs?

 

You're not suggesting that this horrible structure be used to replace sub-vis, are you?  😮

David_Ferster
Member

As I said in my original post, only in this one circumstance of initializing my vi before I enter the state machine. But, hey, if the experts say frames are bad, I'll shun them. I'm just trying to understand why.

SteenSchmidt
Trusted Enthusiast

If you are entering a state machine anyway then it's totally straightforward to use that for initialization as well?

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
Ray.R
Knight of NI

I agree with Steen, otherwise you'll earn an entry in the Rube Goldberg thread  😉

 

Have you read the "LabVIEW Development Guildlines"?  I will search for a link to them.. They used to be posted in the Knowledge Base..

David_Ferster
Member

There's this, which says little about stacked sequences and why they are bad.

 

http://www.ni.com/pdf/manuals/321393d.pdf