What is the best way to stop parallel loops at the same time, from any loop?

If there is a vi with two or more parallel while loops, what would be a good method to simultaneously stop parallel loop execution, from any of the parallel loops? My intent was to try and do this without local variables, so I used notifiers. This seems like an ok method for two loops, but how about for n loops?
In addition, my code has a flaw. I use an OR block to compare the stop status of each of the loops. This works fine most of the time, but if both loops are triggered to stop at the same time,the boolean result will be false, causing the loops to never stop. How can this be avoided?
Thanks,
Curt
Attachments:
parallel_loop_w-stop.vi ‏54 KB

I think you have the right idea, notifiers are one of the better ways to stop parallel loops. You can simplify things by using 1 notifier for everything. I modified your VI to use 1 notifier, it will set the notifier to True ONLY if the loop is stopping, then it stops. The other loop will read the notifier status, and stop based on it the next time it executes.
I also changed the second loop to stop and notify if it has an error (that is usually a good idea, especally if you have I/O or other things that can cause problems)
I also changed the switch mechanical action, that will eliminate the problems for your second question.
The VI's attached are written in Labview 7.0
P.S. If you have 7.1, the Queues are polymorphic, meaning that the typecast operat
ions are NOT needed!
Attachments:
parallel_loop_w-stop7_0.vi ‏45 KB

Similar Messages

  • What's the best way to stop motion if Windows crashes?

    I am using Visual Basic 6.0 to program some motion moves. I am trying to figure out the best way to stop all motion and turn off all I/Os in the event Windows crashes or stops responding. I have the following:
    NI PCI-7344
    NI UMI-7764
    Windows 2000
    Visual Basic 6.0

    We implemented an interlock solution using two digital lines from the PCI-7344-UMI-7764 to an Opto22 G4PB4, 4 place SSR backplane, with Brentek G4 NO and G4 NC dry contact modules wired in series to supply +24V to a larger relay contactor's coil. Also in series with the relay contactor's coil were a machine guard and machine e-stop switch.
    The Relay contactor supplies 120VAC power to the servo drives and other devices on the machine.
    The LabVIEW application software has to turn one bit on and the other bit off in order to power the relay contactor's coil.
    We found that if the PC power is off or the PC looses power, then the contactor will drop out and kill 120VAC power to the drives.
    However, if the LabVIEW application or the PC hangs then the 7344's digital
    lines remain in the state that they were set before the PC hung.
    To totally failsafe this also required a watchdog timer relay where the LabVIEW application has to keep
    resetting the watchdog relay with a heartbeat pulse.
    If the LabVIEW application fails to turn on it's heartbeat pulse then the watchdog timer relay will also
    kill power to the drives.
    There are probably better -simpler solutions to be applied but this worked for us.

  • HT3819 I have 2 Ipod touch's, one a 64gb and one an 8gb.  Whats the best way to use them both on the same itunes account?

    I have 2 Ipod touch's, one a 64gb and one an 8gb.  Whats the best way to use them both on the same itunes account?

    Click here for options.
    (64410)

  • What is the best way to protect my macbook on the internet

    what is the best way to protect my macbook on the internet, using mobile broadband?

    against what ? malware ?
    on Macs, all that's needed is common sense.
    Mac Virus/Malware Info

  • What is the best way to connect my ipad to the high-speed Internet connection in a hotel room

    what is the best way to connect my ipad to the high speed inernet connection in a hotel room

    every connection is a bit different. Generally, connect to the wifi, then you may need to open Safari, and may even need to try to get to one of your bookmarked pages to trigger the 'agree to our terms' page to come up.
    As to it kicking you off every so often, there are sometimes glitches with the wifi on iPads, you can also be subject to any programming the hotel has. Like I've noticed various places that only allow you to log on for a period of time before having to relogin.
    most hotels have 1-800 numbers, so you can always try calling that to see if their tech support has any tips for the frequent disconnection issue.

  • What is the best way to connect my guitar to the usb port on my IMac

    This is for use with Logic Pro X
    what is the best way to connect my guitar to the usb port on my
    I-Mac

    As has been said really, the less you pay the less quality, and flexibility you'll have on your sound.
    For example, you could run on a 'Rocksmith Real Tone Cable' if you just wanted a cheap way of getting your guitar into the computer for some fun.  Probably cost you $30 (I live in UK so can't be sure).  If you're starting out then this could be considered the best option for dipping your toe in the water without spending too much.
    You won't get a really nasty sound out of that if you can process it yourself in Logic afterwards to clean up, but it won't be great either.  I imagine it could get quite noisy so you'd need to get heavily gating your guitar sound, if you're playing something clean that's not ideal.
    Longterm, you're far better getting a decent audio interface, as you need something to play sound back through, if you have different input sources you usually have to create an aggregrate device on osx to use multple sources at once esp if you're using the built in audio chip on your mac to listen. 
    All this can add latency and possibly sync issues (i.e. drum tracks not in time with audio etc.), although generally it's not too bad, but it's something worth knowing if you want to do things on the cheap without buying a dedicated interface.
    What kind of money did you want to spend? Are you thinking super duper cheap, and then see how it goes and maybe spend more in future if you enjoy it?  Personally i would say £100-150 would get your something good to start with, like that Presonus audiobox, there's a lot of options like that available.
    My local music shop always push the alesis io2 on new users, gotta say i'm not that overly impressed with it.  Line 6 stuff will be good however, but limiting.  Although i beleive you get their software for free with it?

  • What is the best way to zero a 'custom voltage with excitation' sensor from the front panel?

    What is the best way to zero a 'custom voltage with excitation' sensor from the front panel?
    Thanks for any help

    Hi Donavan,
    There are two options for zeroing with the NI-9237.  You can perform offset nulling and shunt calibration with a strain task, or if you use custom excitation you can use software compensation.
    See the Bridge Balancing, Offset Nulling section in  the Load, Force, and Torque Measurements tutorial. Take a measurement before the strain is applied and subtract this from all subsequent measurements.  See the above tutorial to consider the tradeoff in accuracy between these two options.
    Hope this helps,
    Jennifer O.
    Applications Engineer
    National Instruments

  • What is the best way to find a file on the servers disk without using web.xml?

              What is the best way to find a file on the servers disk without using web.xml?
              I want to find a configuration file not contained within the war file I have
              created. Is there a way to pass information into the ServletContext with out
              rebuilding the ear or war files? Tomcat 4.0 can do this in its server configuration
              files. Does BEA have the equivalent?
              Regards,
              Eric
              

    You can specify the path to the file as a system property
              eg
              java -Dconfig.file.location=./mydirecotry/myfile.txt com.test.MyApp
              "Eric White" <[email protected]> wrote in message
              news:[email protected]..
              >
              > What is the best way to find a file on the servers disk without using
              web.xml?
              > I want to find a configuration file not contained within the war file I
              have
              > created. Is there a way to pass information into the ServletContext with
              out
              > rebuilding the ear or war files? Tomcat 4.0 can do this in its server
              configuration
              > files. Does BEA have the equivalent?
              >
              > Regards,
              > Eric
              

  • What is the best way to manage multiple ipods using the same itunes?

    Hi Everyone
    i am trying to manage three different ipods through the one Itunes, all with very different tastes, not sure if I am doing it the best or easiest way so does anybody have a simple solution on what you're supposed to do, to keep it all simple!
    Cheers
    Liv

    If you have created a new Windows user account you need to log out and then log back in with your original user name. By default each Windows profile will have an independent iTunes library.
    If instead you managed to create a new library within the same profile. click the icon to start iTunes and immediately press and hold down the shift key, keep holding until asked to create or choose a library. Click Choose and navigte back to your original which should be at <User's Music>\iTunes.
    Your question as posed was:
    What is the best way to manage multiple iPods using the same iTunes {library}?
    in which case Selected Playlists is probably the best approach. Simply create a playlist for each device, Alice's iPod, Bob's iPhone etc. and sync the device with the appropriate list.
    tt2

  • What is the best way to make video and audio the same lengths for posting on Web?

    YouTube recommends doing this to avoid sync problems. Maybe it will also make my videos run more smoothly. I'm talking here about random pauses I see in my movies on YouTube, not the uniform stuttering problem which I pretty much solved by redoing the movie at 30 fps instead of 24 fps. (Original is 18 fps Super 8 movie film.)
    Anyway, there is no sound during my titles. The soundtrack starts about 17 seconds in, and ends when the ending titles begin. So what's the best way to add silent audio? The best I can figure is to take some existing sound, put it in where the titles are, and turn the volume down to zero. Seems real workaround-ish, so to speak, to me. It seems to work. I even cranked it up on headphones to make sure there was no residual noice. But I'm curious if there's a better way? No biggie if not.
    Thanks.         

    I should have included the following:
    1.) Why can't I make a silent project in GarageBand? I have to instead find a project with a long enough song, make an "iLife preview" of it (see (2) below), copy it from the iMovie Music and Sound Effects browser to the end of the movie, and then open the audio panel and turn the volume to zero. And all this so that video websites don't get confused by a soundtrack that starts in mid-movie.
    2.) Why do I have to "render" them by the following process: Double-click a song in the iMovie Music and Sound Effects browser. You get a dialog box saying "The project "The Great Race" cannot be used because it was not prepared with an iLife preview. Would you like to open "The Great Race" in GB so you can save it with an iLife preview?" What I don't understand is why this new thing was introduced and why I have to do it via iMovie.

  • What is the best way to hookup my airport extreme with my time capsule ?

    what is the best way to hookup my airport extreme with my time capsule ?

    It sounds like you have the AirPort Extreme configured as the "main" router on your network.
    If that is the case, connect an Ethernet cable from one of the LAN <-> ports on the AirPort Extreme to the WAN "O" port on the Time Capsule
    Power up the Time Capsule
    Connect another spare Ethernet cable from your Mac to one of the LAN <-> ports on the Time Capsule
    Open Macintosh HD > Applications  > Utilities > AirPort Utility
    Click on the Time Capsule, then click Manual Setup
    Click the Wireless tab below the row of icons and make sure that the setting for Wireless Mode = Off
    Click the Internet icon, the click the Internet tab
    Insure that the setting for Connect Using = Ethernet
    Insure that the setting for Connection Sharing = Off (Bridge Mode)
    Click the Update button at the lower right of the window and wait a full minute for the Time Capsule to restart
    Then power cycle the entire network by powering everything off....order of power down does not matter
    Wait a minute
    Power up the modem first, and let it run a few minutes by itself
    Power up the AirPort Extreme next and let it run a full minute
    Power up the Time Capsule next and let it run a full minute
    Keep starting devices one at a time about a minute apart until the entire network is back up
    You will need to reset the backup path from your Mac to the Time Capsule to get backups going again
    Open System Preference (gear icon on the dock)
    Open Time Machine
    Click Select Disk
    Click the Time Capsule to highlight it
    Click Use for Backups or Use Disk and backups should begin again in a few minutes
    If you do not want to leave the Mac connected to the Time Capsule by Ethernet, remove the Ethernet cable from the Mac to the Time Capsule, then log on to the AirPort Extreme wireless network

  • I have an iPhone 4 with iOS 5.1. What is the best way to update my phone to the latest iOS platform?

    I have an iPhone 4 with iOS 5.1. What is the best way to update my phone to the latest iOS platform?

    you can update over the air with strong wireless signal, or by connecting to a computer running iTunes.  Either works well.  If you do the update over the air, be sure and attach your iPhone to a wall outlet so you have a solid power supply and don't risk the battery dying during the update.
    The iTunes approach installs a much larger file because of the connection, but if you have not updated since 5.1 that might be a better approach...replace the entire operating system instead of patching. 
    Either way, backup the iPhone yourself just for your own protection in the off-chance something should go wrong...a little paranoia while updating is a good thing

  • Whats the best way to transfer all my pic and vid files from Mac Air to back up drive to free up space on hard disk?

    whats the best way to transfer all my pic and vid files from Mac Air to back up drive to free up space on hard disk?

    Get a third drive if needed, open the Time Machine pane of System Preferences, set it not to exclude that drive, and drag the files to it. If you're moving an iTunes or iPhoto library, launch the application with the Option key held down and choose the moved library.
    (118789)

  • What is the best way to avoid latency when using the io plug in?

    What is the best way to avoid latency when using the io plug in?

    Hi colin a.
    Welcome to the Support Communities!
    The article below may be able to help you with this.  Click on the link to see more details and screenshots. 
    Logic: About I/O buffer size and monitoring latency
    http://support.apple.com/kb/ht1314
    Cheers,
    - Judy

  • What is the best way to use wi-fi to transfer pdf files from an ipad to a mac mini, not using an internet, just wi-fi.

    What is the best way to use wi-fi to transfer pdf files from an ipad to a mac mini, not using an internet, just wi-fi?

    If the Mac use Lion (10.7) you can use Airdrop for that.
    With Mac's not using Lion you may set up a computer to computer (ad hoc) connection.
    How to --> http://docs.info.apple.com/article.html?path=Mac/10.6/en/8339.html
    Lupunus

Maybe you are looking for