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.

Similar Messages

  • Continuing a loop for a set amount of time

    Hi,
    I'm am trying to alter a previously written program have run into a problem.
    The program is set up so that when the input exceeds a set level an output voltage to a buzzer is created; the buzzer continues as long as there is an input.  What I need it to do is to continue this output for a set amount of time.
    I've been searching the forum and found this straight forward solution from adamsjr.
    "The easiest way to do this is to use a two Tick Count functions. The first
    one is outside of a While loop, the second one is inside of the While loop.
    Wire the first one through a tunnel into the While loop, add on the appropriate
    ms (5*1000), wire the sum to one input of a compare function. Wire the
    other input of the compare function to the second Tick Count function. Exit
    the loop when the compare shows the second Tick count value is greater than
    the summed value."
    I've got placed the output subVI into a while loop and followed the above directions and this doesn't seem to work. I'm wondering if I would also have to include the input subVI into the loop or is there another possible solution
    Thanks ahead of time,
    Kristen

    Hi Kristen,
    You have the compare function implemented incorrectly.  You need to make sure that the first terminal of the "Greater than or equal" function connected to the output of the sum, and the second terminal to the tick count in the while loop.  The first terminal corresponds to x parameter and the second terminal is for the y parameter.  So if x is greater than or equal to y, then the loop will need to exit.
    You can see how long a subVI is taking if you put a flat sequence structure within your subVI around the entire subVI code.  The first frame would only have a tick count going into an indicator, the middle frame your normal code, and then the final frame would contain another tick count wired into another indicator.  Then you can subtract the second indicator value from the first and get hold long it took to execute the middle (core) of your code for that subVI.
    I highly suggest using the highlight execution and probes and other debugging techniques such as breakpoints to diagnose where the data is being held up.

  • 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

  • Creating a movie for a web page and making it continuously loop

    Hi all! I have a client who wants me to create a slide show with 7 images at a specific size for his web page. He wants it to continuously loop. I don't know much about this. Where can I go to learn how? I can make the movie... but I'm not sure what to export it as... and what the settings should be to enable me to make it the correct size and so that it loops. Thank you!
    I'm using iMovie '08 on my iMac.
    PS: When I looked up online for help, all I found was how to make a movie loop on one's computer. Not on web pages.

    .gif files are supported in all browsers and do not need any special "player". They are very limited in their support of colors and most Web pages rarely use them anymore.
    QuickTime .mov files can be set to "loop" (as explained above). Much more colors (millions).
    iMovie is the wrong tool to make your file (and it doesn't create .swf format).
    QuickTime Player Pro is the tool you need. It can import an "image sequence", set the frame rate (up to ten seconds per frame) and save the file in the .mov container.

  • 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

  • Timed loop inside a flat sequence not terminatin​g

    Inside a while loop there is an event structure.  Inside that there is a flat sequence.  On one of the frames there is a timed loop that quits after so many iterations.  The timed loop finishes but the flat sequence doesn't execute the next sequence.  What am I not doing right?

    First, you have too many local variables.  This could be leading to race conditions.
    I think you have a couple problems in the use of event structures.  It is a bad idea to put any long running code inside an event case.  It will prevent the Event Structure from handling any other events in the mean time.  You have several timed loops running that in that one sequence frame.
    But the bigger problem is the next sequence frame.  You have a while loop that only ends once all the queues are empty.  Can you guarantee that all the queues get emptied?
    You have laid out the code very neatly, but you have used a lot of odd things in there.  (Number to boolean array, to cluster, to unbundle the cluster to individual indicators.)  Why not just go from Boolean array to and index array function.  No need for the intermediate cluster conversion.  Why not set up the indicators as an indicator array and just write to them directly.
    The code is so much intertwined between when queues are created, filled, emptied, destroyed, events happen...  And this is all multiplied by at least 4 times for each camera.  And there are 4 major event structures going on.  This is a very ambitious project for an inexperience LabVIEW user.  You need to step back, get one thing working right, and design so that you can scale the architecture upward.  Many of the structures you have essentially duplicated and belong in subVI's.

  • Nobody get back to me on my other question, so I'm going to try again. I am making a PowerPoint for a meeting and I want to take a 3D PDF and have it spin or rotate on a continuous loop. How can I accomplish this?

    Nobody get back to me on my other question, so I'm going to try again. I am making a PowerPoint for a meeting and I want to take a 3D PDF and have it spin or rotate on a continuous loop. How can I accomplish this?

    Please ignore PowerPoint comment, I can make the 3D PDF no problem with my converter plug-in for AutoCAD. Once it is made though you can spin it by hand/mouse in Adobe. but I want a video like scene with the object spinning by itself for modeling purposes?

  • Warning for Continuous Looping External flv or f4v as2

    Malfunction issued in Continuous Looping External flv or f4v in as2 from containers created in Flash Professional CS6 with code
    on (complete){
    this.autoRewind=true;
    this.play();
    solution: always make a new document!
    Mystic problems with x times resized documents, at media 2 or 3 times play and then not playing external fly/f4v

    use:
    kglad wrote:
    if all your buttons are attached to the same parent:
    on(press) {
      s = new Sound(this);
        s.setVolume(100);
        _parent.mcPlayer.seekToNavCuePoint("pict1");
        mcPlayer.play();
    on (release) {
        i = -100;
        s = new Sound(_parent);
        s.setVolume(0);
        gotoAndStop("reset");
    on (release) {
        i = -100;
        s = new Sound(_parent);
        s.setVolume(100);
        gotoAndStop("hold");

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

  • Producer loop and 2 consumer loop for acquisition and process images

    Hello everybody,
    I'm quite a newbie in Labview 2011 on Windows 7.
    Those are what I want to do :
    Step 1: When the objects fall with velocity around 2 to 5 m/s, images of these objects will be acquired continuously from PCIe 1433 with Basler spL4096-39kc.
    Step 2: The processing of the images continuously in the same time with step 1 will find the datas of the objects in images as colors, patterns and locations. If the patterns and colors at location are as the same sample, the elements in Boolean data array are true.
     Step 3: Every 01 millisecond, values from Boolean data array will be read, the valves of nozzle will be opened if the values are true.
     My question is what is the best way to do my tasks ? I couldn't find any example of program in Labview and I think I use producer/consumer architecture for step 1 and 2 but I don't know how can I set up producer loop for step 3 and transfer Boolean data array from step 2 to step 3 ?
    Thank you for reading and help me !

    Dear Eric-J,
    Thanks for your reply. I want sort the pellets that have 6mm diameter. The pellets were fed in a single layer by a vibratory feeder with a flat-bottom trough, 400mm wide that was supplied with the feeder . The pellets dropped off the end of the feeder onto a chute with 40 parallel U-shaped grooves. Images of these pellets will be acquired continuously. I make the sample from image that was acquired. I use NI Vision for processing  of the images. If the patterns and colors of pellets are as the same sample, the elements in boolean data array are true. As you thought, I would like to interpret data every millisecond and open/close a valve based on the boolean array. The air valve sends a burst of air for 2 - 3 milliseconds to an air nozzle that diverts the pellets into the appropriate channel.
    What are your ideas for this task ? Could you explain more clearly about "a real time system" and "determinism" for this task ?
    Thanks and best regards

  • 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

  • I have GarageBand for iPad 2 and noticed that there are far fewer loops for iPad than for apple laptops. Is there a library available of apple loops? I haven't been able to find any if there are. Any help would be greatly appreciated.

    I have GarageBand for iPad 2 and noticed that there are far fewer loops for iPad than for apple laptops. Is there a library available of apple loops? I haven't been able to find any if there are. Any help would be greatly appreciated.

    Update: An Apple rep called me today to update the status of my return. I was told that the replacements for the BLACK iPad 2's was still another 3 weeks out (at least) so they offered me a brand new WHITE 16GB iPad 2. I could have that or continue waiting. I opted to go ahead and accept the offer of a new white one. Worst case scenario if I don't like the white one I have buddy that just bought a 16GB black one that he would be willing to swap it.

  • How to execute a loop for every 15 minutes

    how to execute a loop for every 15 minutes or 30 minutes constantly...

    I need to insert a number into an array for every 15mins continuously..and the array need to hold all datas for example in 0th position i insert a value 10 by 10.00am, after that at 1st position i need to insert 11 by 10.15am, next at 2nd position i need to insert 12 by 10.30am and so on...how this can be done

  • How do I loop a QuickTime sequence 7 times?

    How do I loop a QuickTime sequence 7 times? Am using QT Pro. Thanks

    A simple, inelegant approach: In QT Pro, copy the movie and paste it six times to extend the track.  Resave.
    Another approach (if you have Snow Leopard or above): Automator's Play Movies action has a looping option, though it uses QT 10 rather than QT 7 for playback and the playback isn't as seamless as the first method.

  • How to save 7.0 VI's flat sequences properly as Labview version 6.1

    Labview 7.0 has a Save for previous option that allows the vi to be saved as 6.1 vi. In attempt to
    do that with a VI that has flat sequence, a stacked sequence got added in the VI and a lot of things
    got screwed up. Is there anything out that that will allow me not to happen, rather than manually change
    the whole VI, which is going to be very time consuming?
    Any help will be greatly appreciated.
    Ratin

    Since LV 6 does not support a flat sequence, I'm afraid you are stuck with making the modifications yourself.  Have you tried going to the 7.0 block diagram, right clicking on the flat sequence, and selecting Replace with Stacked Sequence?  If this is successful, then you could save to previous version.
    - tbob
    Inventor of the WORM Global

Maybe you are looking for

  • Adding second display

    I recently purchased a Viewsonic VX2260wm monitor: Resolution: 1920 x 1080 This monitor handles Vga, DVI-D, and HDMI inputs. I will be using the monitors in extended display mode and run FCE alot. What would be the recommended input route I should ta

  • Print is too small

    Hi, When I try to print photos they come out too small. I preview them and they are shown small in the preview. I select the proper size in the print mode but they come out small in a corner of the paper. What am I doing wrong? I have printed before

  • Can this UI rendering can be created in DynPro?

    Hello, I would like to create the following UI: A table which will contain X Rows. Each row has a title and a liitle triangle at it's side. Pressing this triangle will open Y Rows, pressing the triangle again will hide these rows and show the title a

  • Does modifying a webform in the backend effect implementations of that form on the site?

    I need to modify a secure zone payment form that already exists and is accepting payments. We will now potentially be collecting user address details - My boss want to then split test two versions of the form (the existing one and the modified one) -

  • Converting video files to iPOD

    I have an iPod 30Gig. When im converting video-files in iTunes to the format that the iPod can view, the player plays the files with no sound. I use the newest version of iTunes..does anybody know what to do to get sound when playing videofiles on my