How to turn on Flat Sequence Structure based on a Boolean input?

Hello,
I trying to write a VI ( attached) that will sample an analog voltage coming through a an analog MUX. I using a flat sequance structure to change the select signals outputs to change the channel being sampled. I am wondering if I can turn on the structure only when my Sample boolean input is TRUE?
Solved!
Go to Solution.
Attachments:
Analog MUX.vi ‏52 KB
Analog MUX VI.JPG ‏87 KB

malbaloo wrote:
Thanks to your comment, I realized that this VI will not do what I want. What I want is this:
if (sample is true)
output=00
take a sample
then:
output=01
take a sample
then:
output=10
take a sample
Any Idea on how to implement this?
That sounds like a simple FOR loop with Set Output and Take Sample inside, autoindexing on the output value.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • 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

  • How to execute a frame of a flat sequence structure for a specified amount of time?

    Hello,
    I have a timed loop measuring a resistance value every 2 seconds. I would like to have this timed loop execute for a specified amount of time (e.g. 5 minutes). The timed loop itself is placed within a flat sequence structure so I am concerned that the measurement will be taken once and the next frame will begin to execute, without waiting 2 seconds for a successive reading (and not looping for, say, 5 minutes).
    In other words, is it possible to have a frame of a flat sequence structure execute for a specified amount of time before moving onto the next frame?
    Thanks for your assistance!
    JFK_Aero
    Solved!
    Go to Solution.

    All code in one sequence frame must complete before the next frame can execute.  So as long as your timed loop is setup correctly, the next frame cannot run until your 5 minutes is up (N = 5 minutes/2 seconds/measurement = 150 measurements).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can i create a dynamic structure based on my input from a select-option

    Hello,
    This is to develop a custom report in FI for G/L Balance based on company code.
    I have an input select-option for Company code.
    Based on the range of company code my output layout should be modified.
    I am not very much sure to create a dynamic internal based on the input from a select-option.
    Can any one please let me know how can i do this.
    I would appreciate for anyone who turns up quickly.
    Thank you,
    With regs,
    Anitha Joss.

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

  • How to get field values in ALV based on user provided input

    Hi,
    In my ALV grid, I have 2 fields:
    1. Material ID
    2. Material Description
    When user provides input to Material ID field, the material Description field should get populated immediately.
    Note: Curretly I am able to do it based on the sy-ucomm = 'Enter', i.e. when the user presses "Enter" outside the ALV grid, I retrieve Description from Mat Table and populate this in Mat_Desc in ALV grid.
    I want to do the same operation whenever tab is pressed (not when user presses enter outside the ALV grid).
    Please provide your inputs for this.
    Thanks & regards,
    Ravish

    Hi Ravish,
    Check <b>BCALV_TEST_GRID_F4_HELP</b> program for F4 help on ALV Grid.
    Thanks
    Venkat.O

  • Execution time of a flat-sequence

    Hello there -
    Is there any way to get a measurement of how long each part of
    the flat sequence takes to execute?  Anything like matlab's "tic" and "toc"
    commands in labview?  I have been playing with it for a while now and
    have yet to discover if Labview has this functionality.  Anyone know of
    anything like this?
    I currently have a VI that controls the realtime acquisition of a CCD camera via Firewire and a USB spectrometer.  The VI collects data from each of these devices (triggered by an external source at 10Hz), and dumps them into a Matlab script which does analysis on the CCD image and spectrum.  The bulk of the VI sits inside a while loop, which continues to run until the user presses the stop button.  Inside this main loop is a flat-sequence.  The sequence goes:    ACQUIRE DATA --->  PROCESSING DATA ---->  MATLAB SCRIPT ----> PLOTTING GRAPHS -----> OUTPUT DATA TO FILE.   
    The problem here is that the VI runs at 5Hz, while we are triggering it at 10Hz.  Originally, it was my thought thought that the matlab algorithm was to blame, but I used the matlab commands "tic" and "toc" to determine that the matlab algorithm runs in 15-20ms.  I did this by putting a "tic" command at the top of the matlab algorithm and a "toc" command at the bottom.  The problem, as I have now discovered is that the rest of the labview code takes ~180ms to execute.  (This was discovered by putting the "tic" at the bottom of the program, and the "toc" at the top of the program, thereby measuring the execution time of everything except the matlab algorithm).  Each time a trigger signal from the external source comes in, it starts the flat-sequence structure (which takes ~190ms), and then waits for another trigger signal, always missing every second signal.  My eventual goal is to reduce the bloat, and get the algorithm down to less than 100ms, so that I can run the VI and acquire data at 10Hz rather than 5Hz.  If anyone can offer some help with this, it would be much appreciated!
    Eric
    P.S. - I have attached a copy of the VI that I am working on, but unfortunately, it most likely will not run on your computer....the VI will not run unless it is connected to a triggered spectrometer and CCD camera....but I have attached it anyways incase anyone who can help might want to take a look.
    Attachments:
    RTSpider.vi ‏376 KB

    can we divide the program into 2 parts and use background process for acquisition and front end process for analysis?
    I mean, create 2 VIs from the present VI and then launch the acquisition program dynamically as a background process and fire events in Main VI from acquisition VI and process it.  not sure how much it is going to reduce. lets give a try....
    Anil Punnam
    CLD
    LV 2012, TestStand 4.2..........

  • Metronomes​, while-loop​s and flat sequences

    I'm making a loop that is supposed to write a poll message to the serial port once every minute and read a message from the same port once every 256 ms. It is supposed to proceed untill a stop button is hit. It is based upon a while loop that contains two different flat sequence structures that each contains a metronome ("wait until next ms").
    The intention of thisis that the program goes through the loop and every 256 ms it reads the serial port and every 60 000 ms it sends a polling message. However, the indicators I've connected to the metronomes doesn't seem so show a linear increase in the ms timer. The poll timer occasionally increases a little (in two minutes it might increase 20 ms). The read timer does not increase at all. Poll count increases very irregularly.
    Does the flat sequences interfer with each other? Can this loop be changed in any manner in order to work properly?
    Attachments:
    poll_loop2.GIF ‏13 KB

    The loop is dominated by the "minute" timer, what will happen is that it will wait the minute, write, go to the 1/4 minute timer do it's read, the back to the minute timer. This is because LabVIEW is a data-flow language. There are a number of different ways to do this, one being having two loops, one writing, one reading, but with out some synchronization between the two they might drift. Another method would be to have an event structure, with the timeout value set to 250 mS, putting the read and write into a case structure in that timeout event. Having a time check, or even a resetable counter (use a shift register on the loop) to determine whether to write or read, with an event for the operator to stop the whole thing. I do a diagram, but have a meeting in a couple of minutes :-)
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Continuous loop for flat sequence

    Hi, I currently using LabVIEW 8.2 and still learning about LabVIEW. I’m doing a project on a FMS model using USB 6501 to run the program and I’m required to run the program continuously. I was given a program from a previous student and I’m supposed to modify the current program.  The purpose of the program is to gather stock from the warehouse and place it in a different slot.
       I have a sample of the program and layout of the model where the lift is to move to the left and back to the right. I’m currently stuck as I can’t figure out how to run the flat sequence continuously.
      Firstly, it would just run once and stop at the right even when I’m using while loop.
      Secondly, when pressing the stop button it wouldn’t stop the program midway, it would continue to run until the frame ends. Is there a way to stop the frame when an error occurs?
    Please advice. Thanks.
    Attachments:
    LIFT LOOP.vi ‏288 KB

    You definetly have to switch to a reliable architecture!
    I think that your application must have several security features to prevent damage of hardware or even humans. So you must not use a program which just moves the lift from startpoint to endpoint without any chance to break the movement!
    That being said, i see two approaches:
    a) Statemachine
    b) Producer/Consumer
    The backdraft of Statemachine is its polling character. So you can only react to "worst cases" only within your given timeframe. The timeframe is the polling time plus all latencies including signal delays and similar. This can easily add up to about 1s and more.
    Producer/Consumer can possibly react a little faster if it is event based. The backdraft is that you need a rather good knowledge of LV in order to implement this properly.
    Another thing for applications like this are latencies created by the OS. Maybe it is necessary (not only recommended) to switch to a RT system or even FPGA in order to keep proper reaction times.....
    Maybe it is a good idea to talk about this application with an NI Alliance Member .
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Measure the time in a specific frame of a flat sequence

    Hi I have a labVIEW program with a flat sequence and I would like to stick in a small SubVI which measures how long it stays within an individual frame to confirm the delay I have used. Does anyone have any code or any tips on what I could add which sets a timer going when I enter the frame and spits out the answer to a numeric indicator when it goes to the next frame.
    Any help would be appreciated 

    srikrishnaNF wrote:
    hi mr_nice,
      Use time elapsed vi...
    Thanks and regards,
    srikrishnaNF
    Please add where you find this vi.
    Check out this video here. It might be useful for you when he talks about the flat sequence structure and how to get elapsed time from it. It starts at about 7 minutes into the movie. He's using Tick Count.
    Also here you can find useful information
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway

  • 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

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

  • Flat sequence bug

    Good morning.
    I was working on a report generation vi for my project, and it has grown way too stacked. Loop within case, within sequence etc.
    To keep a large VI tidy I was using the cleanup feature.
    After another cleanup my 2 stacked sequences and 1 while loop became "bugged".
    I tried to restart both labview and, later, the PC. Bug did not disappear.
    Is there any way to fix the bug? I tried to replace structures with alternatives from right click menu. After few conversions the problem is not seen, but shortly appears.
    Any way maybe with HEX editor?
    Flat sequence thinks it has a stacked sequence wall on the right side. Mouse can't be seen on screenshots though.
    Attachments:
    PIC2.jpg ‏139 KB
    PIC3.jpg ‏165 KB
    PIC4.jpg ‏142 KB

    I tried to move your structures around, but this happened:
    Clearly this happens because of the massiveness of your VI. Luckily I was able to see the whole thing on my 1789 inch TV
    A usefull tip: Don't create a blockdiagram that is bigger than your monitor, preferable not over todays 22 inch standards. Now-a-days I'm working on a rather big project and to be able to have the block diagram of my main VI within my screensize of 22 inches, I had to create more than 100 sub-VI's. But it's way easier to have a clear view over the whole program, than a 16k+ pixcel block diagram that can only be viewable on my 1789 inch .
    I also believe many of the flat sequence structures can be removed. You should use the error wire for dataflow control and use sub-VI's if you got repeating code. Use logical icons for you're sub-VI's. Here is an example, which I prefer to use:
    Red icons to easily see my Sub-VI's from standard LabVIEW icons, and also some text that I can refer to with comments so that other people understand what the sub-VI's do. This way my main VI does not have a block diagram larger than my monitor.
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway

  • How to Create Hierarchy From Flat file Structure

    Hi Gurus,
    There is a scenario for me regarding the Hierarchy.
    Required Hierarchy structure - Region>Director>Manager-->Sales id
    I have flat file which gives the info like user id , sales id , manager id, director id.
    But the transaction data Flat file has structure with sales id, region id, sales amt, sales qty.
    Note : Region id is another Master Data.
    How i can create hierarchy from the first flat file which doesnot have region info in that but it is available in the transaction data Flat file.
    Is there anyway we can create hierarchy based on the first Flat file structure which contains more that 1,00,000 records.
    Try to Suggest me in this regard .
    This is urgent.
    Regards,
    Mano

    Hi Mano,
                    Defining the source system from which to load data
    Choose the source system tree File  ® Create.
           2.      Defining the InfoSource for which you want to load data
    Optional: choose InfoSource Tree ® Root (InfoSources) ® Create Application Components.
    Choose InfoSource Tree ® Your Application Component ® Other Functions  ® Create InfoSource 3.x ® Direct Update.
    Choose an InfoObject from the proposal list, and specify a name and a description.
           3.      Assigning the source system to the InfoSource
    Choose InfoSource Tree ® Your Application Component ® Your InfoSource ® Assign Source System. The transfer structure maintenance screen appears.
    The system automatically generates DataSources for the three different data types to which you can load data.
    &#9675;       Attributes
    &#9675;       Texts
    &#9675;       Hierarchies (if the InfoObject has access to hierarchies)
    The system automatically generates the transfer structure, the transfer rules, and the communication structure (for attributes and texts).
           4.      Maintaining the transfer structure / transfer rules
    Select the DataSource for uploading hierarchies.
    IDoc transfer method: The system automatically generates a proposal for the DataSource and the transfer structure. This consists of an entry for the InfoObject for which hierarchies are loaded. With this transfer method, the structure is converted to the structure of the PSA during loading, which affects performance.
    PSA transfer method: The transfer methods and the communication structure are also generated here.
           5.      Maintaining the hierarchy
    Choose Hierarchy Maintenance, and specify a technical name and a description of the hierarchy
    Hope this helps
    Regards
    Karthik
    Assign points if Helpful

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

Maybe you are looking for

  • Error FRM-30312 while compiling a custom pll library on forms 11g weblogic

    hi, this is my case: Im trying to upgrade a forms 10g application to 11g, using FORMS 11g v11.1.1.3 and WEBLOGIC server v10.3.3. Forms files compiled correctly, also webutil.pll was correctly compiled. but if I try to compile my custom pll I can see

  • Solution Manager too Slow

    Dear All, We are running SAP Solution Manager 7.01 on Oracle 11g in AIX. This central Solution Manager system is connected to more than 150 satellite systems. The response of the system is too slow while we take transactions like solman_workcenter, R

  • How to create a PDF form with multiple approvals?

    Hello , I am trying to add approvals to a pdf I created . I am trying to add approvals such that once the form is filled up by the user and emailed to the concerned person (admin) , they approve the form , this action inturn sends the pdf to the next

  • Photoshop CS6 scratch disk on hard drive or SSD?

    I've purchased a Windows 7 PC with 16 MB RAM, 2 terabytes and a 250 GB SSD. I'm going to load Photoshop on the SSD and the OS on the hard drive. Where should the scratch disk go?

  • Help! Applications won't open

    This is looking bad. So far, I've noticed iTunes, Pages, Journler, Safari, Growl, Miro (formerly Democracy) and iStumbler won't open on my PB. I'm getting error messages like the one below: 2007-08-22 13:30:28.048 Miro[423] * -[NSBundle load]: Couldn