How do I make something happen only once on a true condition in a loop

So I have a way of doing this, but it uses a dreaded local variable, and seems to me that it might be unreliable.
What I want to happen is to have something happen only once on a condition that will remain true. What I need is to set something after a given amount of time, but I only want to set it once after that time has been reached. Problem is, if I use a range, it could be true more than once, if I use a greater than, it'll be true every time after the set time, and if I use an equal, there's no way to know that the particular millisecond value will even appear in the loop.
Maybe I'm wrong in even using those comparison functions... Any ideas would be greatly appreciated. See the attached vi for a better look at what I'm trying to do... (v7.0)
Thanks,
Geoff
Attachments:
Question.vi ‏16 KB

The "Idle" state that the help file refers to is the "non-running"
state. The Top Level VI must end execution before any "First Time" VIs will
return TRUE after being called initially.
Therefore, if your application calls a subVI at the beginning of the
Test portion, on the next iteration of the loop it will return FALSE
from that subVI, since your main VI never stopped running, and received
a TRUE from the "First Time" on the initial test loop.
If you have code that you want to execute only on the first run of your
entire program, "First Time" should work fine. If you have code that
you only want to execute on the first iteration of just the Test loop,
the "First Time" VI is not ideal.
I think that shift registers are going to provide the best solution,
however you mentioned that for your particular application that is not
ideal. Could you describe a little bit more why shift registers are
problematic?
Thanks Geoff, let us know.
DWeiland
Applications Engineer
National Instruments
www.ni.com/support
Dan Weiland

Similar Messages

  • Once 10.9.1 is loaded onto my MacBook Pro and it has accessed all my files; is there anyway to back out of the relationship?  I don't want my data on iCloud - how do I make that happen?  Many thanks for any help.

    Once 10.9.1 is loaded onto my MacBook Pro and it has accessed all my files; is there anyway to back out of the relationship?  I don't want my data on iCloud - how do I make that happen?  Many thanks for any help.

    Sorry but I know of no way of not backing up for a PC.

  • Normalizing. How To. Or Make It Happen When Bouncing

    I had to create some new tracks because the old tracks were damaged.I use only one track for voice overs, not several. I noticed when I record on these newly tracks and bounce it as an mp3 to my desktop, it doesn't do a normalizing and convert action. The old tracks always did. How can I make this happen with these new tracks.
    Logic Pro 9.1.8 Mountain Lion

    yeah, thanks, I found it by viewing youtube tutorials. Thanks for your reply

  • I have two IMacs and I want to set them up so i can use one keyboard and mouse-   How do i make this happen?

    How do i make it happen so I can use two seperate iMac computers as one set-up with one keyboard and one mouse?

    If the keyboard and mouse are wired, then a USB KVM switch will work.
    If they are wireless, you should be able to connect the wirelessly via Bluetooth settings. discover the same keyboard and mouse on each iMac.
    However, you cannot use them on each iMac simultaneously. I think it would be rather difficult for you to switch between them (disconnecting and reconnecting them over and over again).
    Most iMacs come shipped with a keyboard and mouse by default. How come you only have one keyboard?
    Keyboards and mice are not that expensive either.

  • Is there any solution to make getter called only once?

    In my application i can see getter is calling more than once. I know this is due to JSF life cycle, but can i avoid that?
    is there any solution to make getter called only once? what will happen if i use immediate ="true"
    thanks in advance

    debdutta wrote:
    In my application i can see getter is calling more than once. I know this is due to JSF life cycle, but can i avoid that?
    is there any solution to make getter called only once? what will happen if i use immediate ="true"
    thanks in advanceTake whatever you need out of the getter method(s) and put it in the constructor method of your bean. Then it only get called once. The getter method should only return the value and nothing else i.e. no database calls, calculations or anything else.
    Off topic, perhaps a sticky thread for this topic should be created as I see it being asked numerous times in the last four months.

  • HT1420 If I have a lot of music on one apple ID account/device and I want to also have it on a seperate device with a different apple id, how do I make it happen

    I want to have the music I bought on 2 devices each device has a different apple ID (one is much older than the other).  How can I make this happen?

    Sync it from your computer to the ipod.

  • How do I make one (and only one) device use my Apple ID and iCloud account?

    How do I make one (and only one) device use my Apple ID and iCloud account? I currently have an iPad mini, iPhone 5, and MacBook pro attached to my apple accounts, but I want only my iPhone 5 to be assosiated with either one. Whenever I use any of the three devices, I get a notification on the other two telling me that these devices are now using these accounts from these services, etc. and I want these notifications to stop, along with the devices using to them. How do I do this? I completely reset the iPad mini so I don't know how I'm still getting notifications from it, and I deleted and signed of of all of my accounts everywhere I could find on my Mac. So, to restate exactly what I want to do, I want ONLY my iPhone 5 to use ANY of my Apple/iCloud accounts and ONLY it can receive emails, iMessages, and FaceTime calls. Thanks!

    If you want to disconect your Mac from iCloud, go to System Preferences>iCloud and click Sign Out.  If you only want to stop using iCloud email, just uncheck Mail.  To stop iMessage, open the Messages app, go to Messages>Preferences, click the Accounts tab, click your iCoud ID on the left-hand side, then to the right click Sign Out.  To stop FaceTime, open the FaceTime app, then click "Apple ID" then click Sign Out.
    On your iPad, go to Settings>iCloud and tap Delete Account (or if you only want to stop using iCloud email, turn Mail off).  For FaceTime, go to Settings>FaceTime, tap the ID and sign out.  For iMessage, go to Settings>Messages>Send & Receive, tap the ID and sign out.

  • I keep Mail open on my MacBook Pro and prior to Mavericks items would open on my 27" secondary display. How can I make this happen in Mavericks?

    I keep Mail open on my MacBook Pro and prior to Mavericks items would open on my 27" secondary display. How can I make this happen in Mavericks?

    In System Preferences > Mission Control, uncheck mark Displays have seperate windows. This should bring you back to the secondary display you had before the upgrade. You may have to open Mail, the first time and place it on your secondary display. You also won't have the advantages of the dock and menus on the secondary display.
    I keep my own secondary display with these settings because I need the ability to expand a window across both displays.

  • My Iphone5 won't switch to landscape view when I turn my phone to the side...what am I missing and how do I make this happen

    My Iphone 5 won't turn to landscape view when I turn it to the side...what am I missing and how do I make this happen...it used to happen automatically...I thought.

    I had the same problem but it wasn't because the orientation was locked .
    Mine was some kind of glitch that was resolved by holding down the home key and the button on top until the white Apple appeared on the screen .

  • How Could I Make Something Like This.

    http://www.youtube.com/watch?v=vlRdjAwEzbU
    I Am Wondering How I could make something like this in AfterEffects CS4.
    Any Help Would Be Appreciated.

    dx394 wrote:
    Is There A Tutorial Anywhere About It?
    You could contact the animator or whoever posted the clip.
    Deconstruct the sequence. observe the moves and decide, with your present level of familiarity, how you would approach it. Scaling of the ten or so different layers is simple enough but acquiring the contents of the layers is not something you will do in AE.
    As Todd says, start small, figure it out one step at a time, move on to more advanced functions. Animting 3D layers is 9 times more difficult than 2D. when you add lighting and camera moves you raise the complexity level and rendering time to another power making your project about 27 times more difficult.
    bogiesan

  • New windows don't open on top of each other in Firefox. How can I make that happen?

    New windows don't open on top of each other in Firefox. How can I make that happen? That is, every time I open a new window, it won't open on top of the old window, and instead is positioned to the right of it. I'm on a mac. Please help.
    == This happened ==
    Every time Firefox opened
    == Today

    I see. I'm not aware of how to fix this in Firefox. Usually you want to tweak your Winow Manager preferences for opening new windows.
    Example: sawfish preferences for Linux.
    Since Mac OS X doesn't have any preferences, you have to use Applescript or another technique. I found [http://amitp.blogspot.com/2006/08/mac-os-x-window-management-spooky.html Spooky], maybe there are others. I haven't tried it, but here is the [http://www.doernte.net/spooky.html Spooky Download and Description].

  • How can I make my computer only recognize my network and not that of one of my neighbors?

    How can I make my computer only recognize my network and not that of one of my neighbors? This is for when I am at home, and everytime the computer goes to sleep it essentially loses the connection, only to pick up my neighbors network when it is awaken.
    I am on Comcast (Xfinity) Highspeed Cable wireless modem/router
    Thanks in advance!
    Mark

    You can make your network the preferred network.
     > System Preferences... > Network > Advanced... > Drag your preferred network name to the top of the list.

  • When I send an email notification that the form has been sent I want the receiver to get a copy of the actual filled out form not a ling to the data, how can I make this happen?

    When I send an email notification that the form has been sent I want the receiver to get a copy of the actual filled out form not a ling to the data, how can I make this happen?

    Hi,
    you can find documentation for Designer under this website
    http://help.adobe.com/en_US/livecycle/10.0/documentation.html#task=4,5&module=2
    In Designer you can use the JavaScript API of Acrobat.
    So the Devnet for Acrobat is also a good source.
    http://www.adobe.com/devnet/acrobat.html
    http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf

  • How to make something happen when an object touches another

    In my game I'm making (actionscript 3.0), I need the game to gotoAndStop once a circle goes "out of bounds". Is there a syntax or something about on impact or something? Please help I'm a begginer.

    that's working, but the problem is I only want it to be triggered when it hits the outline, not the fill. The circle is within a maze. How do I make it so that if part of the circle goes outside the inside area it triggers a gotoAndStop command?

  • How do I call create a public function to make something happen in another .swf

    Hi guys,
    I am trying to create a public function, i have a decument class with all of my variables in it, I have worked out how to bring in external .swf files, now  I need a way to have an even trigger something on a separate .swf
    So at the moment I have a flunction that works on the parent
    stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePosition);
    function mousePosition(event:MouseEvent) {
    if(mouseX>=125)
    navigator.visible=false;
    trace(mouseX);
    So now how do I make this function public?
    When I try to put it into my document class I get errors because the navigator MC is only on the main timeline. (not in the other swf's that I am opening)
    I am trying to work out how to call the function using a string in my doc class
    public var nav1:String="navigator";
    Then the function
    public function resetnav() 
                         String(nav1+".visible=false;");
    Which seemed like a good idea, but it doesn't work..
    Can you guys help me out here?
    Cheers
    sub

    Hey sorry I spoke too soon, I thought my code was working but my mouse tracking code is actually working off the main timeline.  I sill wan to be able to use your examples though, what is the go with psuedo code? SWF1ToSWF2Connection what is the correct dot syntax for this?
    Cheers
    sub

Maybe you are looking for

  • Weird Error while Updating my iPhone :'((

    So tonight i connected my iPhone 3GS to my MacBook and went to update it to the new software. this turned out with my MacBook repeatedly saying that there was an error and to reconnect my iPhone. i kept doing this everytime it said this. then when it

  • How do I install an HP Officejet 8600 Plus on my Windows 8.1 computer?

    I am trying to download the install software for the HP Officejet Pro 8600 Plus to my Windows 8.1 computer (Lenovo Yoga). When I click on the link to go to the page in downloads, I get a blank page that never populates. How do I get this information?

  • AS 2.0 Control Movie Via Dragable Clip

    I was trying to see if I could get a scrubber-like button to control movie playback. For instance I want to place button that you can drag along a bar to move the movie along frame by frame. I think I have seen this done somewhere but I was wondering

  • Problem facing while creating DataSource through visual admin utility

    Hi, I have created my database on shw6ur-3\tdemand_1 machine where shw6ur-3 is machine name and tdemand_1 is database instance. Still now we used to create database on the sqlserver machine without databaseinstance . This is first time we have instal

  • No Print Color

    I cannot get the color to print.  This is a new HP 8610 printer.  Are  there seals on the cartridges that should be removed? Thank you for your help...