Incrementing sequence structures

I am sure there is an easy way to do this, but I can't quite get it to work properly. Any help would be appreciated:
I have a while loop that runs for 40 seconds. When those 40 seconds are up, it triggers a dialog box to pop up. That dialog box is in a sequence loop that contains 30 different frames. Each frame has a different dialog box message. This entire portion is surrounded by a for loop.
What I am trying to do is have:
1. the while loop run for 40 seconds
2. the first frame of the sequence with dialog box #1 to pop up
3. the original while loop to run again for another 40 seconds
4. the second frame of the sequence with dialog box #2 to pop up
5. the original while loop to run again for ano
ther 40 seconds
6. the third frame of the sequence with dialog box #3 to pop up
and so on....
I have a for loop around the entire thing so that it can repeat the same while loop structure multiple times. I have a 30 wired into the N input of the for loop so that it will run the entire portion 30 times (corresponding to the 30 different dialog box messages that have to pop up).
How can I get one and only one frame of the sequence structure to pop up after the while loop finishes its 40 second period of running?
I would gladly email you this portion of the code for you to take a look at if it will help. Just let me know where to send it.
Thanks.

This does seem to be a good application for a case statement. If you do
need to keep the sequence format for some reason, could you put the while
loop in vi that you can drop into each of the sequence frames?
Dan.
"Koen" wrote in message
news:[email protected]..
> It seems to me that it would be much easier to use a case instead of a
> sequence and wire the increment (i) of the while loop to the selector
> of the case. In this way loop 0 will execute case 0 ,1 executes 1 and
> so on each after the 40 sec wait.
> Is there any particular reason for using the sequence?

Similar Messages

  • Can you move back to a previous frame in a sequence structure?

    I have a VI that contains a sequence structure with seven frames. I would like to add a button on the front panel to allow the user to move back to the previous frame. Is this possible?
    Thanks

    I don't think that's possible. Try replacing the sequence structure with a
    state machine.
    A state machine is a case statement embedded in a while loop. Each case
    outputs at least an integer to indicate the next case to be executed and a
    boolean to indicate if the while loop should continue. The integer is wired
    to a shift register. The input side of the shift register is wired inside
    the while loop to the conditional terminal of the case statement. Outside
    of the while loop, the input side of the shift register would be wired to a
    constant indicating the first case to be executed.
    To mimic a sequence structure, each case would take the incoming integer and
    increment it by one. To move back to the previous frame, the integer would
    be decremented instead.
    "Jeff - PP
    L" wrote in message
    news:[email protected]..
    > I have a VI that contains a sequence structure with seven frames. I
    > would like to add a button on the front panel to allow the user to
    > move back to the previous frame. Is this possible?
    >
    > Thanks

  • How should I set up my VI so that I can use the linear fit coefficient data analysis program, when my values are coming from while loops within a sequence structure?

    I'm attempting to create a calibration program, using the printer port, and a Vernier Serial Box by modifying a calibration program designed for the serial box.
    There are six calibration points, and to collect them, I have it controlled by while loops so that the numbers are taken when a button is pushed, and this is inside a sequence structure so that I can get the six different points. I feed these numbers into two different arrays (for x and y values) and then try to use the linear coefficient analysis on these points, but the values for the slope and intercepts it returns are not correc
    t.
    If I cut out the array and coefficient analysis, and feed the same numbers in directly without the while loop and sequence structures, it produces the proper values... I don't know why the numbers it is producing are different, and I'd really like to know.
    Thanks,
    Karinne.

    I would use a data manager sub-vi that would be called by each from of the sequence structure that produced a data point. The data manager sub-vi could auto append new items or could place items in a specific entry of an array. Later on when you want to calculate the linear fit, call the sub-vi to return the array of values.
    Stu

  • Elapse vi in sequence structure

    Hi Guys
    I know there a thousand way to implement a time elapse funciton, but i am curious the reason it does not work
    I set first elapse vi tartget time 5 seconds, second 2 seconds and third 3 seconds in a for loop
    It works in first and second iteraion. after a few iteration, the second and third elapse vi do not count time any more( I seems that the elapsed time is overwritten by first one. If you probe the three time elapsed output, it  is always 5. 
    Attachments:
    sequence timer.vi ‏104 KB

    Well, if there are a thousand ways to do it, there are probably about 995 better ways to do it. 
    That being said, I believe you have to put a condition for each elapsed time that resets the timer on the first iteration of the while loop.  And get rid of the elapsed times with nothing happenning.  And learn how to use dataflow instead of sequence structures.
    One FYI, too.  Leave everything at the defaults except for the stuff you are changing - i.e., the reset and the time target.  BIG HINT: i can = 0 only once.
    Dataflow basics here.
    Another BIG HINT:
    Error in and Error out are inputs and outputs that could be used to enforce dataflow.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Control references and sequence structures

    My supervisor and I were discussing one of his programs, and he asked
    me if I knew why he kept getting "Object reference is invalid" on a
    property node that was using a reference.  I couldn't figure it
    out either, and eventually I said to try moving the actual control
    itself (on the block diagram), into the first pane of the sequence
    structure, and just feed the wire through.
    This solved all of our problems...  however both of us were
    stumped with why what I suggested actually made it work.  Anyone
    know why this is?
    Oops...  I just realized that I made this on the breakpoint board
    instead of the LabVIEW board...sorry.  Although I suppose that the
    people who frequent this might be the best to answer this...
    Message Edited by Novatron on 07-14-2005 05:24 PM

    There should be no difference between the two code versions IF you adhere to proper dataflow.
    (Of course it is conceivable that the program is a mess and there is a race condition, e.g. if the reference is initially invalid and you set it elsewhere in the code via e.g. a local variable of the reference. In this case, a subtle change (e.g. the sequence structure) can rearrange the execution order for it to suddenly work by accident.)
    I would be very curious to see a working example that demonstrates your described behavior.
    LabVIEW Champion . Do more with less code and in less time .

  • 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 .

  • Why does a sequence structure execute if a while loop is to the left of it?

      I have a while loop in a case structure whose boolean is wired to a sub vi.  To the right of this structure I have a sequence that executes regardless of the while loops condition.  I assumed that the program would not continue to the case structure until the while loop stopped.  Then it would proceed to the case structure.
    Thank You

    jemengineering wrote:
      I have a while loop in a case structure whose boolean is wired to a sub vi.  To the right of this structure I have a sequence that executes regardless of the while loops condition.  I assumed that the program would not continue to the case structure until the while loop stopped.  Then it would proceed to the case structure.
    As others have mentioned, you have to familiarize yourself with the core idea of dataflow programming. One of the great powers of LabVIEW is the fact that things can occur in paralell unless there is data dependency.
    A good start would be the LabVIEW beginners online tutorial:
    http://www.ni.com/swf/presentation/us/labview/aap/default.htm
    The quiz #1 on slide 11 deals with the above issues. Try to answer it. 
    In your particular case, you need to force execution order. This can be done by creating a data dependency (preferred) or by the use of a sequence structure. You could e.g. create a 2-frame flat sequence and place the loop in the first frame and the case structure in the second frame.
    The picture shows a few scenarios for comparison. Can you spot the differences?  Understanding dataflow is crucial for writing any LabVIEW program.
    Message Edited by altenbach on 07-31-2006 06:49 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ExecutionOrder.png ‏19 KB

  • Making sequence structures a state machine

    Hey I would like some help I need to work on changing my code and get rid of the flat sequence structure and replace with a state machine I have attached my code at an earlier state but would like some input on changing it over to a state machine in the sequence at the bottom of the code this program is used to cycle a valve and the sequences need to be done in order .any input would be great.
    Attachments:
    valve Cycles with temp.vi ‏132 KB

    Right click on the Flat Sequence and pick Replace with Stacked Sequence  (never would have thought I'd say that.)
    Right click on the Stacked Sequence and Replace with Case Structure.
    Now a lot of wires will wind up broken.  So you'll need to hunt them down and fix them.  Those wires will probably need to go to shift registers so there values are maintained for the next loop iteration.  Keep a copy of your original VI so you have something to refer back to.
    Create a Typedef Enum and define what your states will be.
    Start wiring the Enum into a shift register at the left of the loop, then into the selector of the Case Structure.  Rename all the cases to what their respective state should be.
    Wire enum constants in each case to direct what the next case should be.  It will run out of the case structure to the right hand shift register.
    Keep working and cleaning still everything is fixed.
    Try running your VI to see if it behaves like it originally did.
    Now you are safe to start making modifications to make it behave like you really want it to.

  • Question about the sequence structure

    Hi,
    If we want to get best performance when programming a sequence of functions or calculations, we should choose 'Stacked sequence structure' or 'Flat sequence structure'? or they have the same performance?
    Thanks.

    To the best of my knowlege there is no performance hit, the "Flat sequence structure" was a fairly recent addition to try and overcome one (of many) complaints about sequence structures in general, that stacked sequences obscure what is happening in the code. If the various sections of your calculation or functions have data dependency, i.e. the output of a calculation is fed into the subsequent calculation or function, then a sequence structure is probably not needed as, with data flow, the calculation that is "dependent" won't executed until all its inputs requirements are satified. If the "functions" are in the form of sub-vi's the method that is more "proper" is to inforce a dependency between subsequent vi's. This can be as simple as adding error in and out controls to the sub-vi's, even if they are only passed through the vi without actually performing an error function. This allows you to wire them together in the execution order that is required. Doing this on some of the early "built-in" functions that have remained in LabVIEW (the original timer functions) sometime requires putting a wrapper around them to make them sub-vi's with error passing, but in the latest versions of LabVIEW the compiler seems to do a good job of minimizing any performance hits this might appear to cause.
    Putnam Monroe
    LabVIEW Evangelist since 1992
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • 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

  • Auto increment sequence

    Can I do something like auto increment sequence in planning so that whenever a user adds new asset it takes a number from this sequence.
    Thanks,
    foksh

    Hi,
    Create a member called Counter in Accounts.
    Increment the value everytime you add an asset and assign the value after update to asset number:
    -Make sure member combination for the Counter values is fixed to one combination only
    Counter->BegBalance->NoYear->(one member from all dimensions)=Counter->BegBalance->NoYear->(one member from all dimensions)+1;
    "Asset Number" = Counter->BegBalance->NoYear->(one member from all dimensions);
    Cheers,
    Alp

  • Auto Increment Sequence Custom Field

    Hi All,
    I was wondering if it is possible
    to have a custom field defined as an auto incrementing sequence number?  E.g. Let’s say I go in and create a project for the first time, this field will show the value 1.  The next project I go to create, the field shows the value 2 etc. etc. 
    If possible, how can this be implemented using customization?  Can it be done in Project Online?  Any help would be greatly appreciated.  thank you!

    Hi JSimoni1,
    You can generate a project unique ID using a webpart, even with Project Online.
    Please find below the procedure in EpmExpert blog:
    http://epmxperts.wordpress.com/2012/05/21/generate-unique-id-for-project-using-a-webpart/
    Note that the code might need some adjustments to stick to your business need.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Feature Film Editing in Premiere CC - Sequence Structure

    I am looking to set up my sequence structure so that each scene has it's own sequence and then next each scene into a Master Sequence.  My question is this:
    Is there a way for Premiere to update the Master Sequence if the length of the Scene Sequence changes.  As of now, I am not having much luck.
    I know there will be small tweaks to the scene once I get feedback (Delete a line of dialogue, etc.) and would hope I wouldn't have to touch the Master Sequence for the continues outputs until the picture is locked.
    And while we are at it, can some of you suggest how you set up your sequence structure for narrative features.  Perhaps I am not approaching it in the best manner.

    Perhaps you are not understanding the role of an editor. It is our job to create the sequence of material that tells a story. (Please excuse my snarky attitude)
    As a scene lengthens or shortens, simply ripple edit the in or out points as necessary. The best method is the checker or a variation to the checker method; I often assign scenes with similar characteristics to a particular track, for example, all scenes that take place in the garden will live on track 3, all the kitchen scenes live on track 4. Or for story line 'A' you can designate tracks 1-3, then you can put the supportive / alternate story 'B' on tracks 4-6 also using the checker method.  Again, excuse my attitude: don't be lazy.

  • Interrupting sequence structures

    Say, for example, I have a case structure with two cases. In each case, there is a sequence structure. If case 1 is true and the program is running that particular sequence, would switching to case 2 immediately cut off the sequence from case 1 and leave it incomplete in favor of executing the sequence from case 2?

    I've seen a lot of your posts.
    Here's the problem.  There's no such thing as a project where this is unavoidable.  If he needs to abort his sequential tasks in the middle, the solution isn't to further muddy the architecture.  It's to fix the architecture.
    Most of your posts are trying to find a way to use tools poorly in the fear that helping them choose the correct tool won't go over well.  You're not helping anyone when you do this.  You're essentially saying "it's not recommended to use a hammer with your screw, but maybe if you use your left hand instead of your right it'll work alright?"  That doesn't make sense.  Don't advocate for bad design.  Don't find workarounds for bad design and suggest the bad design can't be avoided.  That's a terrible habit.  Instead, show people the tools that are available that solve their problem.  Not only is it possible to change the architecture here, it's REQUIRED.  Pointing me to your other posts won't change this.

  • Are sequence structures the right approach here?

    Hi everyone,
    The attached VI shows the endmembers in case structure form of a relatively simple task I need to perform.  It takes a bank of 6 digital outputs and toggles between true and false logic.  Between the endmembers, I need to change the logic on some ports sequentially and after time delays.  For instance, changing the case from true false, I need to change line 2 from false to true 2 seconds before I change lines 4 and 5 to true.  I want the user to see only one button to toggle between states, and I want the states to be discrete and not continuously changing.
    Are sequence structures the best way to do this?  If I put those into the case structure, won't it re-iterate the sequence over and over?  Or do I need a case structure initialized with shift registers so that it stops after one interation until the next time the user toggles the control?
    Thanks for any help on this,
    Brad
    Attachments:
    ValveBankEndMembers.vi ‏56 KB

    I have a couple suggestions.  Most important, have two cases in your case structure.  One for the toggle, one for the quit.  Otherwise you will have to wait for a toggle in order to process the quit.  I also lumped the controls into a cluster.  You are converting from array to cluster anyway, this saves you the unbundle.  Finally, since you are toggling each boolean, you can just apply a NOT to the entire array and use a shift register to pass the array from one loop iteration to the other.  This last will save a lot of debugging headaches if you ever need to add/remove bolleans.
    Message Edited by jasonhill on 06-14-2006 09:05 AM
    Attachments:
    Toggle Trap 2.PNG ‏14 KB
    ValveBankEndMembersEvent2.vi ‏16 KB

Maybe you are looking for