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.

Similar Messages

  • For Photoshop CC download do I have to pay the £8odd a month forever or for a set amount of time?

    I want to know whether there's a set price to the deal or will I be paying £8odd forever?
    I'd rather buy the full application, then and there, if that is the case. Save Money.
    Is there a set price? Or are you paying it if off monthly for a set amount of time?
    Can't find answers anywhere.
    Thanks In Advance!
    J

    You pay for your Cloud membership as long as you want to use the software.
    When you stop paying the software stops working. You never own the software. There is no set time when you finally pay it off - because it's a subscription model, not a rent-to-own model.
    If you want a pay once, own forever deal then you may be better off getting the superseded CS6
    Creative Suite 6

  • How to generate a continuous sine wave for a given amount of time

    I am trying to output a continuous sine wave for a speaker, but I am having difficulty making it continuous rather than looping the signal for a given amount of time, which causes discontinuities. There is a VI in the Labview examples titles Continous Generation, but it produces a square wave. Is there a way to adapt this VI such that the amplitude and frequency can be used as inputs to create a sine wave?

    I found a VI that ships with labview(7.0)called continuous sound output. the output of this is a sine wave or you can change it to whatever you want.
    Sorry cannot help more
    Joe
    Joe.
    "NOTHING IS EVER EASY"

  • Setting up a Log File monitor to inactivity for a set amount of time

    I have set up a number of log file monitors to alert when certain conditions apply, such as the word "ERROR" or "exception".  Now I have a request to set up an alert if the log file has not changed for 20 minutes.  I have been
    searching and have not found any information on how or if this can be done.   Anyone???
    I am running Operations Manager 2012 SP1
    The log files are simple text files.

    Hi!
    You could create a timer reset monitor that reads the log file every 19 minutes for a wildcard pattern (everything matches) and configure the successful search to healthy. Further, you've to configure the timer reset to 20 minutes and configure the
    timer reset state to unhealthy (warning/critical).
    Keep in mind that SCOM reads from the last line from the previous run every time. If your file rotates (based on a schedule or size) SCOM will not read the lines until the latest line is reached. For more information refer to
    http://www.systemcenterrocks.com/2011/06/log-file-monitoring.html
    HTH, Patrick
    Please 'Propose/Mark as answer' if this post solved your problem. <br/> <br/> http://www.syliance.com | http://www.systemcenterrocks.com

  • How do I make a program wait for a set amount of time?

    Basically, I want there to be some amount of lag after a repaint, so how do I do that? I want it to wait a fifth of a second, basically. Is there a quick way to do this?
    By the way, the program is not running on a timer, so I can't just have the timer stop.

    didn't see that:
    you need to use a thread
    public class Something implements Runnable
    Thread t;
    public Something()
    t = new Thread(this);
    t.start();
    public void run()
    while(true)
    //your stuff goes here
    try
    t.sleep(200);
    } catch(InterruptedException exc) { ; }

  • Continuous averaging for a certain amount of time

    Hi
    In my program I have to use a start button to continuously average a value for a certain amount of time(lets say 3s) and keep and show the average the value. The state of the start button should return to off mode after that 3 sec so if the user hit the start button again it reset the array and calculate the average again.
    Would you please help me with this program. I have attached pic of what I ahev done
    With this vi I can take data after hitting start for 3 sec but I have these problems:
    1- I don't know how to calculate average value when finish getting data after 3 sec
    2- I would like the start button back to off mode after 3 sec so if I click on the start button again it reset the array and calculate the average again.
    Would u plz help me with this vi?
    Attachments:
    1q.jpg ‏169 KB

    Use mean function to average an array. And wire your time has elapsed boolean to a case structure and reinitialise your boolean control to default in the true case.
    Create invoke node as below, just in case you dont know.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • 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

  • Force learner to view a slide for a specific amount of time

    In Captivate 5, is there a way to force a learner to view a slide for a minimum amount of time -- and to grade them on viewing for that amount of time?

    Let's say that you need the user to stay on a slide for a minimum 30 seconds.  Here are two ideas:
    Idea One:  Delayed Navigation Buttons
    Set up the Captivate slide so that when the user initially lands on the slide there is no navigation on that slide.  (This means the playbar can't be on that slide either.)
    Set up the "next" button to appear when the playhead reaches 30 seconds on the timeline.
    This will ensure the user stays on the slide for at least 30 seconds because there is no other way to move ahead.  ( I'm a little unclear about how your grading system works, however, perhaps the "Next" button could also have points associated with it that you could use for grading purposes.) 
    Idea Two:  Points Attached to a Button
    When the user arrives on the slide, they are told they need to click a specific button in order to get points; however, that button will only appear when the user has been on the slide for 30 seconds.
    In this case, the button could also have a point value which you could use for grading purposes.

  • How do I insert a pdf file (image) into a project as a picture-in-picture clip that will run for a specified amount of time?

    I want to insert a pdf created from a ppt slide into a FCP X project that will run as a PIP for a specified amount of time. I was successful in bringing the image into the project as a clip but the default for the image is one second. When I try to change duration of the clip, I am able to enter a new time length but the actual clip doesn't change.

    You select the PDF image in the timeline. You use Control-D and enter the new duration. What happens?

  • Video content freezes for a certain amount of time on Lion

    After upgrading to Lion, I have noticed that video content freezes (though the voice is heard, but the picture is frozen for some seconds) for a certain amount of
    time when its starts playing (eg youtube videos) on Lion.
    I have observed this on my friends macbook pro also.
    I have a macbook (mid 2010 model)

    Stats Before playing a video
    Stats while playing a video in youtube

  • Do i have to charge my replacement macbook pro batter for a certain amount of time before using the computer?

    do i have to charge my replacement macbook pro batter for a certain amount of time before using the computer?

    First, if you have a Late 2008 or older MacBook Pro, you should calibrate the battery, as the battery for these MacBooks don't come precalibrated > http://support.apple.com/kb/HT1490?viewlocale=en_US&locale=en_US
    Then, the battery should come charged, so use it until the battery percentage is low, and then, charge it. You can use your Mac while your battery is being charged, and your MacBook will stop charging the battery when your battery is full, so you can unplug it at any moment

  • How do you set the alert time to default to a set amount of time in the calendar?

    How do you set a default alert time in my calendar so I don't have to set it every time?

    Go iCal Preferences/General and click the default alert tick box at the bottom. You can then adjust the amount of minutes before the event for the alarm. NB. ticking the tickbox means you get an alarm for every entry.

  • What is the behavior of items in an Exchange Online Inactive mailbox that were under a Litigation Hold for a set period of time.

    I am specifically asking what happens to the items in an Inactive Mailbox that was placed on Litigation Hold prior to Deletion when the Litigation Hold has say a '6 mo.' Retention Period assigned.
    Do any of those items 'expire' out of the mailbox?  Do only the items in the 'Admin' folders of the Deleted Items get removed, or none?
    I am not asking about recoverability of that mailbox, more of what the behavior is specifically when the Litigation Hold is set to expire after a certain amount of time.

    There is no expiration, check the blog post here:
    http://blogs.technet.com/b/exchange/archive/2013/03/21/preserve-mailbox-data-for-ediscovery-using-inactive-mailboxes-in-exchange-online.aspx
    All content in an inactive mailbox is on hold until you remove the hold from the mailbox.

  • What do I need to worry about when running a VI for an extended amount of time?

    Hi, I'm fairly new to LabVIEW as a program, but not new to programming as a whole.
    I'm attempting to build a VI which will, hopefully, be run continuously and take data for weeks-months at a time.
    I've never built a VI, let alone a program, which will be run continuously for so long, and so I'm unsure as to what I should be concerned about. I'm looking right now at optimizing, as best I can, memory allocation, algorithms, etc. but I suppose my main question is: What should I really be worrying about when programming a VI which will be run continuously for an extended period of time?
    Solved!
    Go to Solution.

    In the structure of your VI's, be certain that you are not repetively creating things such as references to queues, or file references, or DAQ tasks, or anything without closing them.  I was working on one application where a DAQ task was getting created every loop iteration and not being closed.  It crashed the PC hard with a blue screen of death after about 20 minutes of operation, through debugging and before I found the cause, I saw I had about 80,000 to 100,000 iterations of a loop fairly consistently before the crash.
    If this loop had run at a slower rate, it might have taken days or weeks before the PC would have crashed.  It would have seemed infrequent and would have taken longer to debug because I would never have seent the pattern.  If it takes a few failures before you discover the problem, it is a lot quicker to find the explanation after a few failures at 20 minutes per failure as opposed to 20 days per failure.  The problem was eventually found in a subVI several layers down and fixed.
    So if you pay attention to these things early enough, then hopefully they won't pop up and bite you weeks or months into a critical run of the program.

  • Can I "show" an image for a specific amount of time after a click?

    Hello,
    I would like an image to appear for only a specific amount of time after the user clicks a button.
    Is this possible?
    Thanks for any help!

    You cannot time with an advanced or shared action. Isn't a rollover image (which you can time) a valid alternative? You could use the timeline in combination with an action Continue, but I don't know the precise circumstances of your question.

Maybe you are looking for

  • Sending email using URL and URLConnection

    I have been having trouble trying to send an email using URL. I have specified the mail host using: mailHost = Options.getProperty("mailHost", "mail.myisp.com"); and tried to send the email using this: try try URL u = new URL("mailto:"+recipient); UR

  • IPhone 4 - Usage (Other) Varies Wildly: 4gb mysteriously disappearing

    Never had this problem before. I am using an iPhone 4 (16gb)  with iOS 7.1.1. I use iTunes Match to manage my music. Until recently, whenever my available space would start dwindling, I would go into Settings > General > Usage and delete the music th

  • Identifiers in Communication Channel

    Hi guys! We try to configure a B2B scenario with identifiers, however, have a troble. We have created a party to who messages will be sent. Also added their Business System. In the Party we have configured a new Identifier (for seeburger as2). I supp

  • Simple report generation problem

    how to list all stock position for a choosen material for a choosen storage location in a given plant?

  • Reset iphone and getting no content on music

    Hello,  I had to restore my iphone after a software update and now my music itunes folder states "no content".  I'm heading on vacation tomorrow and really want to be able to access my itunes. please help.