Advice on breaking up Stacked Sequences in 6.1?

I've dived right into an old but functional
test system ~300 VI's. Flow and structure is pretty hard to follow and
I'm thinking of breaking it up into state machines.
Any ideas on how to approach a stacked sequence beast in 6.1? Flat sequence seems crucial to the method described here.
Rough layout of main vi attached:
Attachments:
main.PNG ‏46 KB

Open your VI in LV 8.x and use the method described in your linked thread ;-)
You can copy the sequence and remove it while displaying frame 0 in the original and frame 1 in the copy. If you have controls/indicators they will be duplicated. Also, wire connections via sequence locals will be lost. So you will have to rewire and clean up your code. But I think there's no straightforward solution because flat sequences didn't exist in 6.1.

Similar Messages

  • Stacked sequence inside for loop question

    Hi everyone,
    I am new to LabVIEW and I just want to make a for loop with a stack sequence inside. I want it so that when the for loop executes for the n-th time, the stacked sequence is at the n-th frame (because each frame contains different tasks to be carried out). Is this possible? or is there an alternative equivalent method? Please help me out! Thanks!!

    Thank you Norbert for the words of advice.
    Try to avoid Stacked Sequence Structures at all cost.  They are a nightmare to deal with when maintaining the code and they do not offer simple scalability, especially if you need to deal with parallelism.
    As Norbert suggested, State Machines is the way to go.  Try to avoid naming covention such as 1...2...3...4...5.......9999.  Give the name of each case based on what that case does.  Create a TypeDef Control for the state selector (you'll thank me after having changed it for the 5th time   ).
    There are probably 100's of examples in this forum.
    RayR

  • Data between stacked sequences

    I need to transfer a large array from one sequence to next sequence in stacked sequence structure. I made a property  node in next sequence, it works. But I did not feel it is the best way to do it. Please advice if any better way to do this job. Thanks

    You already received the correct answers above...
    Still, your question is not clear at all. Please try to describe the problem in more detail, maybe attach a simple VI that shows the main points.
    detech wrote:
    I need to transfer a large array from one sequence to next sequence in stacked sequence structure. I made a property  node in next sequence, it works.
    Are you trying to transfer data between "frames" of the same sequence structure or between two different sequence structures that are data dependent?
    As has been mentioned, to retain data between frames of the same sequence, use sequence locals.
    Anyway, I am absolutely sure there is a better way to do all this. If you show us your code, we can point you in the right direction.
    LabVIEW Champion . Do more with less code and in less time .

  • Index the output of a stacked sequence

    Hi everyone,
    I'm writing some code in which I instantiate many objects when I first start my code and place the objects into an array that is used as a lookup table later on in operation.  This takes up a lot of space on the block diagram and makes it difficult to understand for the user that is not familiar with the code.  Is it possible to create something like a flat sequence that can have a single indexed output tunnel?  I want something like what you would get when having a tunnel out of a for loop I just want each itteration to be unique (unlike the for loop).  I've included an image of what my diagram currently looks like for reference.  You can see that I create all of the objects with unique information (ID, control reference, etc.) and then build an array with them.  I would like to instantiate each of these objects in a frame of a stacked sequence with a single indexed output (if possible). 
    Thanks for the advice!
    -Eric
    Solved!
    Go to Solution.

    Option 1: use a subVI
    Option 2: Use a FOR loop as a sequencer.  Instead of the stacked (or flat) sequence structure, put a case structure inside of a FOR loop and wire the i to the case selector.  Then in each case you can initialize a different class.  The output can then be autoindexed.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Community Nugget 2-19-2007 "Stacked Sequence Exterminator"

    I am sure everyone with even casual familiarity of LabVIEW has run across older (or newer) code that is just peppered with ...
    Stacked Sequences from Hell.
    Stacked sequences (especially the one's containing sequence locals) are the hallmarks of confusing, unreadable and unmaintainable code. Data flows in all directions (mostly right-to-left), a large percentage of code is hidden at any given time, and it is almost impossible to debug and follow what going on. Often there is clear data dependency (or execution order does not matter), so the sequence serves no purpose. Better programmers don't use stacked sequences at all and even keep flat sequences at a minimum.
    Here is an example:
    Since the code seems to work "sort of", and trying to rewire things manually will probably lead to accidental errors, we have no choice than to leave things in place...
    ... or do we???
    If we try to right-click on the sequence, we can only remove individual frames, breaking everything in the process. No go! A dead end!  Sigh!
    But let's not give up just now.... We can easily convert the stacked sequence to a flat sequence, so lets do that as a first step:
    At this point, we can remove the flat sequence and all connections remain in place. Now we can just cleanup the elements and wires and everything look much better. Ahhh!!!
    In summary:
    An easy two-step procedure allows us to exterminate unnecessary stacked sequences without any danger of breaking the code. This method should lower the fear to remove these monstrosities. Try it today!
    This is a Community Nugget. If you want to contribute, please sign up here: http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=3379#M3379
    Message Edited by altenbach on 02-18-2007 10:43 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SeqToFlat.gif ‏15 KB
    SeqStackedA.gif ‏10 KB
    CannotRemove.gif ‏12 KB

    Tomi,
    Aren't you asking for a good reason to use a "bad" construct?
    Your suggested code construct would look like this.
    After wondering how to make it faster, you would concider this.
    But the revised version is not possible with a stacked seq. With a State Diagram you have a lot more flexibility, and you have it now.
    Now don't get me started because the next thing you know I will be talking about the SDE* and this thread is about exterminating Stacked Sequences..
    Wait, I think I just did.
    Ben
    * With a State Diagram you have a lot more flexibility, and you have it now. If you use the SDE the graphic documentaiton comes along for the ride.
    Message Edited by Ben on 02-19-2007 07:59 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Stacked Seq.JPG ‏20 KB
    Stacked Seq Rev1.JPG ‏23 KB

  • How to get current sequence in a stacked sequence

    Hello,
    I am trying to implement a progress bar for a stacked sequence; as the sequence increases, the bar increases etc... This may be trivial but I cant figureout how to determine the current sequence number.  There is no property node for a stacked sequence structure...
    I am using labview 8.5 
    Regards
    hvo

    First, what proces are you doing using teh sequence structure? In general, you should avoid using sequence structures, esspecially stacked sequence structures. I assume you are new to LabVIEW and data flow programming. Take some time to learn how to use data flow programming and you will find you rarely ever need to use sequence structures. There are lots of discussions which cover the negatives about sequence structures.
    Now, given that you will need to develop your own variable which is used to update the progress bar throughout the sequence. The brute force method would be to wire a value through and use sequence locals. However if you went down this path you will quickly see why sequence structures are not recommended. A more generic method would be to create an Action Engine (search for action engine for lots of explanations on those) which would control the progress bar data. Each frame would need to call the action engine to update the progress bar.
    Since it sounds like you are writing a fairly complex sequence I would recommend you do one of two things. First and probably the easiest would be to create a subVI for each frame and then simply use dataflow to wire these together in the order you want to execute them. The downside here is that you are creating subVIs which may or may not ever be reused. It is still a valid approach though. The second and more flexible approach would be to use a state machine to control your processing. This is much more flexible and easier to maintain than a stacked sequence.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Is there a way to automatically jump to a certain frame in a stacked sequence?

    I am working with stacked sequence structures.  I would like to have a condition in some of the frames, such that if the condition is false, the sequence proceeds normally, and if the condition is true, the sequence jumps to a certain frame.  Is this possible?

    Hi D. Luprek and drewsky,
    besides "sequence structures are generally frowned upon": JUMPing around in code is generally frowned upon!
    Long long time ago I used BASIC for programming and heard comments like "BASIC is spaghetti code" or "using JUMPs (aka GOTO) isn't programming"
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • [Help]: Exit stacked sequence in advance

    I am using a stacked sequence structure. Within one sequence, if I find a condition is met, I want exit the whole sequence structure without executing following sequences. Is there a simple way to do this?  Thanks a lot.
    Dejun

    Simple is a relative term.  I would highly recommend not using sequence structures as, usually, it can hide code (stacked) and the same can be accomplished using data flow.  If you cant get around using it (or just dont want to) then the below would be one obvious solution...
    Attachments:
    NoSequence.jpg ‏57 KB

  • Stacked sequence does not trigger

    I am reviewing Pull-down Menu.vi in Labview BasicsII: Development Coarse Manual. When I go through Exercise 2-7, I never get the dialog boxes. I have the Get Menu Selection wired to the stacked sequence where it connects to the box containing the question mark. When I choose "Test 2" or any of the menu choices, it does not trigger the frames.
    I ran the program in solutions on the disk, and this program runs correctly, showing the dialog boxes.
    I have had this problem before. I connect a wire to a stacked sequence where it shows the question mark. But the stacked sequence ignores the information coming to it.

    First, I think you're refering to a case structure and not a sequence structure.
    Second, you are probably not defining your cases properly. You can use probes to examine exactly what data you're sending to the case structure selector terminal (that's the question mark). If you are using strings, the strings have to much exactly to the strings in the case definition. If they don't match, the default case will execute. If, after using a probe to see what data you are sending the case structure, and after making sure you defined the cases correctly, you still don't see what's wrong, you should post your VI.
    I realize saying this is a bit unnecessary, because you already started, but...
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • Question about stacked sequence structure

    Hi,
    I made a numeric control outside a stacked sequence structure, and connect the control both to frame 1 and frame 2. In frame 2 there is a while loop structure. And now I start the labview program with the control A. Then, after frame 1 finished, frame 2 started, now I want to change the control to B and deliver B into frame 2. But the indicator in frame 2 shows that the control is still A. So I wonder how can I change the control and deliver it to the frame after the frame has started? Thank you!
    NI Software :  LabVIEW  version 7.1
    OS :  Windows XP
    Regards,
    jackauden

    Dataflow dictates what you are seeing. The control does not get read once the sequence starts. This is as expected.
    Some possible solutions:
    Just don't use stacked sequence! I don't and never feel limited by this choice.
    Create local variable of the control and read from it inside frame 2.
    Do you REALLY need a stacked sequence? Why???
    LabVIEW Champion . Do more with less code and in less time .

  • Question on stacked sequence

    Hi,
    I have a question regarding stacked sequence.
    I have a stacked sequence with 5 sequences (0,....,4). I would like to execute these in this form
    0, 1, 2, 1, 3, 1, 4, 1  then again 0,..
    I don't want to duplicate the 1 section since it contains many objets, variables,...One possibility would be to move out the objects then duplicate the sequence and use shift registers but I don't want to use this because in 1, I have some real time graphs to plot..
    Is there another (easy) way to do this ?
    Thanks for ideas,
    Regards
    Solved!
    Go to Solution.

    nitad54448 wrote:
    I have a question regarding stacked sequence.
    Sequences MUST execute in order until all frames are complete, and there is no escape. Don't use stacked sequences, they are too limiting.
    nitad54448 wrote:
    I don't want to duplicate the 1 section since it contains many objets, variables,...
    You don't need to duplicate it. Create a simple state machine with cases 0,2,3,4 and add the code of state 1 right after the case, so it executes at each iteration of the loop after any of the states.
    Here's a quick draft (LV 8.0) that would cycle through the states as you specified forever. See if it can give you some ideas.
    Please show us your actual code, maybe we have a few better suggestions.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RepeatStates.vi ‏14 KB

  • Using same string indicator in different stacked sequences

    Hi guys, I want to use the same string indicator in different stacked sequences. I tried to wire the output of every string constant through the sequence to my string indicator outside the sequence block but then I get an 'Wire connected to an undirected tunnel' error. What is the best way to use the same indicator for all the sequences?
    Solved!
    Go to Solution.

    GerdW wrote:
    GerdW wrote:
    @TiTou:
    Problems with copy&paste?
    not even :-o
    GerdW wrote:
    @TiTou:
    Problems with copy&paste?
    not even :-o
    see : http://forums.ni.com/t5/Feedback-on-NI-Discussion-Forums/Text-lines-and-images-get-duplicated-when-I...
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Go out from stack sequence when there is an error

    Hi All,
    I have a small code that used to do the simple testing. I used all stack sequence to control the equipment sequencely. What I want to do is if there is an error (either failed to control equipment or any error that can occur) in any sequence, the code will make it go out rather than loop thru all the sequence then go out, is it possible to do this kind of feature ? I do try to using the event to raise the error but it failed cos I have no idea how to do it.Anybody please help.
    Thanks 

    But the problem is there are too many VI (about 20++
    Are you running 20 different test sequences ?  Or 20 instances of the same test?
    If it's the same test, or even a similar test, then make it a subVI, feed it parameters to customize it, and be done.
    If they're really that different, then the mistake was to write 20 different test sequences without handling errors.
    If that's the case, I know of no way to automatically replace the things. 
    Message Edited by CoastalMaineBird on 07-16-2009 05:14 PM
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • How to break a flat sequence structure ...??

    How to break a flat sequence structure into two flat sequences structures......i am a student learning labview....help me..

    To accomplish what you want you need to basically write some really ugly code. This is a side effect of using the flat sequence structure in the first place. This is exactly why they are not recommended.
    First and foremost you will need to place your frame structure inside a loop. This will control how many times you execute the code.
    Now you have a few alternatives to skip the first three steps which are kludging but time is of the essence.
    1. Place a case structure around the code within the first three frames. Each frame will have a case structure. You can use the loop count to control only executing the code the first time through the loop.
    2. You could combone the code of the first three frames into a single subVI and then use the same approach described above to skip executing that subVI.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Proper use of stacked sequence structure

    Hello
    I have been reading this forum up and down, trying to figure out what the proper use of a stacked sequence struckture is.
    The reason i ask was that almost evryone in this forum thinks it is miss used / and or hides code. And that there is berrer ways of doing it.
    I ask this question, wondering what is the PROPER use of SSS?
    attached is the code so you can see what i am doing. As you will see, the code in the SSS are all the same for each frame, only channel number and numeric indicator is different, making upscaling more efficiant.
    Faster readings is not an issue since i will be slowing it down later on, so we get a visual value evry 5-10 seconds or so.
    keep in mind i am a novice at LabView, and all input is much appreciated.
    Attachments:
    r read 1ch.vi ‏52 KB

    TorbH wrote:
    I tried using array as you showed, but i fail to get it to work properly, well it works as it should but i want it to be able to stop with a button, when i did that only channels 202 - 206 stopped. 201 kept going.
    The reason for me to have this opportunity is that later i will connect channels 207-212. and they also will need to be started/stopped seperatly.
    Put the stop button inside of the loop.  The button is read with the terminal.  The terminal is read outside of the loop, so it will have the same value for every iteration of your loop.  By moving the terminal inside of the loop, your terminal will be read every iteration and you can therefore abort the loop.
    TorbH wrote:
    Also, frome here on out, how would i go ahead and use the data? Can i in a "state machine" use several for loops to perform the same tasks as i had in my previous version?
    A state machine is actually just a single loop.  You can use a state macine with other loops, you just need to be careful of how you pass the data around.
    State Machine
    Producer/Consumer
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for