Perform each task for certain amount of time

Hey,
The program I'm trying to create is a very linear one and involves performing three different processes after one another, each for a set amount of time.
I originally tried using case statements and timers to do this, but everything got very messy very quickly. I then looked at sequence structures however have read some bad things about them.
Could anyone point me in the best direction to achive this?
Thanks,
Sam.

Sam_R, Yamaeda is right. Sometimes things are so simple that you do not need a state machine. But sometimes you end up adding features to your simple little program and it ends up growing out of control. Trust me
There are a million examples of state machines out there. This makes a million and one. It does not address the part of your question about performing an action for a certain amount of time. I wanted to keep it as simple as possible while also demonstrating programmatically determining the next state and error handling.
I don't mean to sound condescending with this basic example. But I know there was a time when it seemed like advanced stuff to me. Hopefully someone will find this useful.
=====================
LabVIEW 2012
Attachments:
State Machine.vi ‏12 KB

Similar Messages

  • Writing a file for prescribed amount of time in a while loop after the triggering condition is met

    Hello Guys,
    I am trying to program an application in which if the trigger condition is met it should start to write the file.
    I was able to do that, but if I want it to be written for certain amount of time, and once the trigger condition is met, it should continue to write the files for prescribed amount of time. I was not able to do this. The file name should also be updated accordingly.
    I tried to with some options by keeping the creation of the file outside of the loop, if I do that then if the trigger condition is not met it will stop writing and I dont want that, as once the trigger condition is met it should be true thereafter.
    So I cant keep any thing outside the while loop, bcaz then it checks the condition of the shift register for the trigger and I have it as a false constant.
    I am attaching my application which is kind of mess and I have written in the application where I am having problems. For every iteration of while loop it makes a new file, and i dont want that, I want to write specific amount of time data to the each file.
    Please take a look at my code and help me in solving the problem. Any insights and examples on how to do this thing will be a relief to me.
    Thanks in advance.
    Regards,
    Nitin
    Attachments:
    PXI_4462_Sync_and_Stream_trigger.zip ‏192 KB

    what i am saying is to keep track of how much data you have written and whenever you need to make a new file you make 1.
    here is a vi that i just made that should show you. let me know if you need any help understanding it.
    Attachments:
    new file exemple.vi.zip ‏21 KB

  • How do I get the page to refresh after a certain amount of time so it jumps back to beginning of one page site? Its for an exhibition

    Hi,
    I am in an exhibition space where I need to display my Muse website offline and locally on the desktop. I am looking for a way for the website to refresh after a certain amount of time so it can go back to the beginning of the page. Can someone help? Please!

    You can try the steps mentioned here :
    http://stackoverflow.com/questions/2787679/how-to-reload-page-every-5-second
    http://stackoverflow.com/questions/17886578/refresh-part-of-page-div
    http://crunchify.com/how-to-refresh-div-content-without-reloading-page-using-jquery-and-aj ax/
    Thanks,
    Sanjit

  • 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

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

  • 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

  • Is there a way to create a custom screensaver with pics/slides that display for different amounts of time?

    Is there a way to create a custom screensaver with pics/slides that display for different amounts of time? Or even add a "video slide" into the screensaver?
    My business has 3 TVs displayed in our lobby, each with its own apple TV and they are all linked to the same photo stream. Currently the Atv screensaver displays the photostream pictures of our products for the default 3 seconds. We just added pics/slides that now display messages and useful info for our customers but I want that info to be displayed for a longer period of time than the pictures to give people a chance to read it.
    I tried using flickr and powerpoint as a work around but no luck.  I created a slide in powerpoint with play length of 15 secs and saved it as a wmv file.  I added that file to a "screensaver" set in flickr and pointed the Atv screensaver to that flickr set.  It still displays everything, pics and the wmv file at the default 3 sec.
    I know I can increase the duration of all pics in the screensaver to display for longer but the goal is to have the pics display at 3 secs and the info slides to display at 15 secs.

    Welcome to the Apple Community.
    No that's not possible.
    If you have any suggestions that you think might enhance the Apple TV you can send Apple your feedback here 

  • Click event on a label doesn't work after a certain amount of time?

    I'm having a weird kinda a problem with my label.....I had given a click event on the label but the problem here is that...it won't take any event after a certain amount of time....i mean..it takes the event if you click on it when it is loaded but after sometime it won't take any event...
    And there's one more thing which is that...i've some images too on the page but the images doesn't show up until and unless my mouse gains focus on the page...i.e I've to move my mouse over the page once then only i'm able to see the image...
    Any help on how to solve this problem.....

    The problem is that...the project size is too big and i really don't know where to upload the project.....
    Any help and still thanks for the reply...
    Waiting...

  • Youtube videos freeze after a certain amount of time, but audio continues.

    As it says in the title, most Youtube videos freeze after a certain amount of time for me, but the audio continues.
    Happens on Firefox, IE and Chrome

    This happens mostly because of obsolate drivers.
    http://forums.adobe.com/thread/945765?tstart=0

  • Playing jpeg pictures for different amount of time

    hello everyone.
    i'm new to jmf and i have been reading a bit about it. so i tried the sample code at: http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.java (THIS WAS VERY HELPFUL)
    this program displays each image for 1 second each.
    now my problem is, i want to display these pictures for different amount of time... for example: display pic1 for 1 second, then display pic2 for 3 sec and so on.
    can anyone help me please. THANKS

    >
    i'm new to jmf ..>The [JMF forum|http://forums.sun.com/forum.jspa?forumID=28] is the best place to ask JMF related questions, but I am guessing you are also new to Java, and to programming, so this forum might be best for the moment.
    >
    ..and i have been reading a bit about it. so i tried the sample code at: http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.java (THIS WAS VERY HELPFUL)
    this program displays each image for 1 second each.
    now my problem is, i want to display these pictures for different amount of time... for example: display pic1 for 1 second, then display pic2 for 3 sec and so on.>Well.. given a run of [JpegImagesToMovie.java|http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.java ] might go..
    java JpegImagesToMovie -w 400 -h  300 -f 1
      -o the.mov pic1.jpg pic2.jpg pic3.jpg..you might instead try..
    java JpegImagesToMovie -w 400 -h  300 -f 1
      -o the.mov pic1.jpg pic2.jpg pic2.jpg pic2.jpg pic3.jpg
    Lines broken for clarity.  Instead have command all in one line.
    This simply repeats the second frame, three times. The .MOV format might 'optimize away' the second and third frame from the final file, but I would not count on it.
    Of course, a far better way to animate images (with transition effects, full control over time, and all the bells and whistles) is to load the images into memory and create the slide show using the Java 2D abilities, mostly found in the Graphics class.

  • Wait for undefined amount of time

    Hello All,
    I have a requirement, where in I would want my activity in the workflow to wait for an indefinite amount of time. Then when a certain activity occurs, I would like to complete the 'waiting' activity.
    So lets say I have the following process with 2 activities(A and B)
    ----------> A ----------> B(wait for undefined amount of time)------------->End
    B needs to wait for some time, which I do not know.
    Then when another event( PL/SQL activity) occurs, I need the event to trigger of the waiting activity B, to completion.
    How can I acheive this?
    Thanks in advance.
    PHK

    Luiz,
    Lets say I have the following:
    -------->A---------->B(needs to wait)-----No------>D----> END
    \ Yes
    C-------------->END
    B is the activity which needs to wait. It has a PL/SQL function assciated with it.Lets say I have a result type of YES/NO associated with activity B. As soon as the workflow engine encounters activity B, it will execute the function associated with it. Lets the function ends with a result_out => YES, then immediatly C will be executed.
    So setting a result type will not help. I need to wait at step 'B'
    Regards,
    PHK.

  • How do i set my ipod touch to automatically turn off after a certain amount of time?

    how do i set my ipod touch to automatically turn off after a certain amount of time?

    Please check "My Music Timer" app.
    "My Music Timer" can stop iPod touch or spotify playing music.
    https://itunes.apple.com/app/id787182095
    Thanks

  • Writing binary file for fixed amount of time

    Hello, I'm trying to write a binary file of multiple channels for a fixed amount of time before I perform my analysis. Does anyone know the best way to accomplish this?

    Here is an example of one way to do what I think you are trying to do. There may be a more elegant way of doing it, but this is pretty simple and straight-forward. It basically writes a 5-integer array for 5 seconds and then stops. Let me know if you have any questions.
    Attachments:
    timed write.vi ‏27 KB

  • Request: script to stream music for given amount of time

    I'm looking for a bash script (or anything that will get the job done) that will:
    -stream music from my favorite internet radio station (ie: di.fm)
    -play stream for a given time in increments of 1hr (ie: 1 hr, 3 hrs, etc)
    -at the end of the given time, fade out the music then terminate stream after fade out is complete.
    -terminate script (or application that is performing these tasks)
    Ideally, the script will take in the internet radio station and time as arguments. I have Rhythmbox which I currently use to stream.  I don't care if the script opens applications for use in this process.  Can anyone help me with this?  Or at least get me pointed in the right direction?
    PS: I plan on using this as my music to listen to while I'm trying to go to sleep, hence the time limit and fade out.  If the music stopped abruptly I would most likely wake up.
    Thanks guys.

    I know in mplayer, you can do most of that.
    For example, running this from console will play Lounging Sound radio for exactly one hour;
    mplayer -endpos 01:00:00 http://67.159.44.146:8002/
    I'm not sure about the fade out effect, you might have to Google for that information. I'd recommend the 'mplayer-svn-nogui' package in AUR (or check out the one here) if you decide to go this route.
    Oh, you might want to check out MPD too... it could possibly do something like this.
    Last edited by Pnevma (2008-07-22 12:56:30)

  • When I use my computer for any amount of time all of a sudden the fan starts up full blast and everything freezes

    Nothing works after this happens its happened 3 times now, the first I just forced shut down and re started, the second I force shut down and left it off for the night, the third time I let it run like that for a bit to see if it would control itself but after a small amount of time I forced shut it down again.

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter "BOOT_TIME" (without the quotes) in the search box. Note the timestamps of those log messages, which refer to the times when the system was booted. Now clear the search box and scroll back in the log to the last boot time after  you had the problem. Select the messages logged before the boot, while the system was unresponsive or was failing to shut down. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V). Please include the BOOT_TIME message at the end of the log extract.
    If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    Still in Console, look under System Diagnostic Reports for crash or panic logs, and post the entire contents of the most recent one, if any. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if present (it may not be.) Please don’t post any other kind of report — it will be very long and not helpful.

Maybe you are looking for

  • I am at a loss .... I can't get my printer to do anything

    Here is the scoop: I have a HP OfficeJet Pro 8600.  I purchased and installed it in February 2012.  It worked fine (printer, scanner, copier) until about a week ago.  I did all of the troubleshooting I can think of, plus sent data to HP website reque

  • Edit will not display content only background picture

    I have five pages linked - three work fine when I go to edit. the other two only display the background picture (two different pictures) but no content. I have tried all I know to fix it. Any ideas out there?  contribute CS4 Ver. 5

  • Snow Blizzard Emitter -

    I am working on an animation using the Snow Blizzard Emitter in Motion and was trying to find the control or Life Span of the emission. Basically what I am trying to do is make the snow appear to stop and remain on the screen, looking like it is pill

  • Renting from my itunes account on someone else's Apple TV???????

    Hi. I'm visiting my parents from overseas. They have a new Apple TV. If I want to rent a tv show on their apple tv, but pay for it with my itunes account, is that possible?? or is there some sort of maximum number of accounts you can use on one Apple

  • RV120W can't open web management, can't open SSH/http to server on LAN port

    Hi, I just buy cisco RV120W, but seem I found alot of issue. Hope some one can help. Topology: Internet------RV120W(192.168.1.1/24)--------(192.168.1.5/24)PC                       |---------------(192.168.1.2)L3switch(10.10.10.1/24)--------(10.10.10.