Retrieve iteration from stacked sequence structure

I have a stacked sequence structure with 15 iterations. Is there a functional equivalent to the "i" from the For loop or a way to make one?
I need to trigger some other events based on what iteration of the stacked sequence is running. 

Let me first reiterate what the others have said. Avoid stacked sequences like the plague!
I have found that except for very few situations there is always a better way then using a sequence structure.
That being said you could use a local variable to do this too...
Attachments:
it3.jpg ‏43 KB

Similar Messages

  • Remove the stacked sequence structure from LabVIEW.

    Remove once and for all the stacked sequence structure from labVIEW
                                           It's an absolute horror.

    > Sequence locals are sometimes (for very few cases) usefull if you know how to use them properly
    What does that even mean????
    (.. and you are repeating basically the same statement about four more times as if  the use of sequences and sequence locals is an advanced skill, only to be used by LabVIEW masters. Your post is so redundant that it could be condensed to 20% of the size without loss of information).
    It is clear that the stacked sequence can never disappear from LabVIEW, because of the need for backward compatibility. (It could be taken out of the palette, but why...).
    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 .

  • 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

  • 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

  • Retrieve data from recursive XML structure

    Hi,
    I had a XML which is something like below
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <Relationship>
    <Name>John</Name>
    <Age>99</Age>
    <Gender>Male</Gender>
    <Children ID='1'>
         <Name>Peter</Name>
         <Age>55</Age>
         <Gender>Male</Gender>
         <Children ID='1'>
              <Name>Winnie</Name>
              <Age>40</Age>
              <Gender>Female</Gender>
              <Children ID='1'>
                   <Name>Sam</Name>
                   <Age>20</Age>
                   <Gender>Male</Gender>
              </Children>
         </Children>          
    </Children>     
    <Children ID='2'>
         <Name>Mike</Name>
         <Age>50</Age>
         <Gender>Male</Gender>
         <Children ID='1'>
              <Name>Jessica</Name>
              <Age>40</Age>
              <Gender>Female</Gender>
              <Children ID='1'>
                   <Name>Harison</Name>
                   <Age>20</Age>
                   <Gender>Male</Gender>
              </Children>
         </Children>          
    </Children>     
    </Relationship>
    As you see, the node <Name><Age><Gender><Children> is repeated within every <Children> node
    My question are:
    1. Is is possible to retrieve all the <Name> value if we don't know how deep is the <Children> node?
    2. Is is possible to retrieve the father and son/daugther relationship, i.e. John --> Peter, John-->Mike, Peter-->Winne, Mike-->Jessica
    Thanks
    Vincent

    Hi Vincent,
    For 1, use a descendant axis, like this :
    SQL> var xmldoc varchar2(4000)
    SQL>
    SQL> begin
      2   :xmldoc := '<?xml version="1.0" encoding="iso-8859-1" ?>
      3  <Relationship>
      4  <Name>John</Name>
      5  <Age>99</Age>
      6  <Gender>Male</Gender>
      7  <Children ID="1">
      8   <Name>Peter</Name>
      9   <Age>55</Age>
    10   <Gender>Male</Gender>
    11   <Children ID="1">
    12    <Name>Winnie</Name>
    13    <Age>40</Age>
    14    <Gender>Female</Gender>
    15    <Children ID="1">
    16     <Name>Sam</Name>
    17     <Age>20</Age>
    18     <Gender>Male</Gender>
    19    </Children>
    20   </Children>
    21  </Children>
    22  <Children ID="2">
    23   <Name>Mike</Name>
    24   <Age>50</Age>
    25   <Gender>Male</Gender>
    26   <Children ID="1">
    27    <Name>Jessica</Name>
    28    <Age>40</Age>
    29    <Gender>Female</Gender>
    30    <Children ID="1">
    31     <Name>Harison</Name>
    32     <Age>20</Age>
    33     <Gender>Male</Gender>
    34    </Children>
    35   </Children>
    36  </Children>
    37  </Relationship>';
    38  end;
    39  /
    PL/SQL procedure successfully completed
    SQL>
    SQL> select x.*
      2  from xmltable(
      3        '/Relationship/descendant::Children/Name'
      4        passing xmltype(:xmldoc)
      5        columns name varchar2(30) path '.'
      6       ) x
      7  ;
    NAME
    Peter
    Winnie
    Sam
    Mike
    Jessica
    Harison
    6 rows selected
    If you want to include "John" in the result set, just replace the XQuery expression with '/Relationship/descendant::Name'.
    For 2, here's one way :
    SQL> select x.*
      2  from xmltable(
      3        'for $i in /Relationship/descendant::Name
      4           , $j in $i/following-sibling::Children/Name
      5         return element r {
      6           element parent {$i/text()}
      7         , element child {$j/text()}
      8         }'
      9        passing xmltype(:xmldoc)
    10        columns parent_name varchar2(30) path 'parent'
    11              , child_name  varchar2(30) path 'child'
    12       ) x
    13  ;
    PARENT_NAME                    CHILD_NAME
    John                           Peter
    John                           Mike
    Peter                          Winnie
    Winnie                         Sam
    Mike                           Jessica
    Jessica                        Harison
    6 rows selected
    Or the recursive approach :
    SQL> select x.*
      2  from xmltable(
      3        'declare function local:getChildren($p as element()) as element()*
      4         {
      5          for $i in $p/Children
      6          return (
      7            element r {
      8              element parent_name {$p/Name/text()}
      9            , element child_name {$i/Name/text()}
    10            }
    11          , local:getChildren($i)
    12          )
    13         }; (::)
    14         local:getChildren(/Relationship)'
    15        passing xmltype(:xmldoc)
    16        columns parent_name varchar2(30) path 'parent_name'
    17              , child_name  varchar2(30) path 'child_name'
    18       ) x
    19  ;
    PARENT_NAME                    CHILD_NAME
    John                           Peter
    Peter                          Winnie
    Winnie                         Sam
    John                           Mike
    Mike                           Jessica
    Jessica                        Harison
    6 rows selected
    Edited by: odie_63 on 24 août 2011 12:12

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

  • Problem for visualizing a frame of a stacked sequence

    When I want to change the frame of a stacked sequence structure, LabView sends me the following error: fatal internal error: datatype.cpp, line 3658. I do not understand because my program works but I can not visualize a frame.

    Hi Johan,
          If I understand correctly, it's possible to view the diagram and some specific sequence-frame, but when you try to select a different frame, the error occurrs(?)  In this case you could try mass-compiling all the VIs associated with the application then try again to view/edit the in-accessable frame.  NOTE: when mass compiling, any "broken" VIs will be listed!  Alternatively, if you know some or all of the VIs and typedefs in the inaccessable frame(s), try opening them individually, in the hope of narrowing the problem.  It's possible that the VI is hopelessly corrupt!    fortunately it still works!
    ...  As a last resort, you might try "hiding" all the typedefs associated with this VI before you open it (the VI will open-up broken).  It sounds to me like there's some mis-handled typedef descrepancy/ambiguity and you may be able to prevent LabVIEW from trying to resolve the descrepancy by hiding the data-type/typedef.  I'd MAKE A BACKUP copy before doing anything!
    Good luck! 
    Message Edited by Dynamik on 12-09-2005 12:30 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!

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

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

  • How to retrieve data from database to the structure(complicated)

    Hello everyone:
           I want to retrieve data from database to the structure. but the structure defined like this below:
    TOLERANZOB LIKE QAMV-TOLERANZOB
    TOLERANZOB1 LIKE QAMV-TOLERANZOB
    so how can I retrieve the data from the database ? make sure that the two fields contain data both.
    Thanks in advance .
    Regards
    Nick

    Hi Nick,
    To retreive data for TOLERANZOB from QAMV,
    If you know the key fields then use
    SELECT SINGLE TOLERANZOB FROM QAMV INTO TOLERANZOB WHERE keyfields.
    else, you can use
    SELECT TOLERANZOB FROM QAMV UPTO ONE ROWS INTO TOLERANZOB WHERE....
    Once you retreive the data using the select query, you can check if it is initial and if not move the data from TOLERANZOB to TOLERANZOB1.
    <b>Reward points for helpful answers.</b>
    Best Regards,
    Ram.

Maybe you are looking for

  • I cannot get my Imac G5 (1gb ram 1.8ghz) to update to anything above 10.3.9 as it ejects the disk on restart.. any ideas?

    I have an Imac G5 with 1Gb ram and a 1.8gz processor. its the original 17inch without iSight/ambient light many times i have treid to update the operating systems, but it always fails on reboot. I was told is was something to do with the Firmware sup

  • Mass processing of sales orders

    Dear All, The scenario is, we need to remove the delivery block from the sales order and the sales orders are huge in number. So is there a easier way to do the same or the only option is to use the transaction VA02 and change each one. What is this

  • JTREE LEAF...PLS help////

    Hm.. i got a problem here.I have created i JTRee and the sub item which is the leaves.How to extend all the leaf node once the Jtree is open

  • Not able to boot into Ubuntu live CD or USB - Satellite A300-13S

    Hi there, I hope someone can help me on this. I've just got a new A300-13S pre-installed with Windows Vista Home Premium. I've managed to create a recovery DVD (after having the same hassle about having to use a specific brand of DVDs, as mentioned i

  • QUERY ON USAGE OF INDEXS

    Hi, I have the following query SELECT * FROM (SELECT /*+ FIRST_ROWS(200) */ a.*, ROWNUM rnum FROM (SELECT DISTINCT t0.ENTITYID    AS a1, t0.ENTITYCLASS                AS a2, t0.STARTDATE                  AS a3, t0.NATIVEEMSSERVICESTATE      AS a4, t0