|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
How to force break a loop
Not a problem, just a question:
In my autonomous independant VI, I use a while loop, and have the "false" constant tied to the conditional terminal. (It's set to stop if true) From what I can tell, the robot should be stuck in Disable once the DS switches to teleop, because the code should be stuck in autonomous (it doesn't look like there's anything to stop the autonomous code and allow Teleop to proceed). How does Labview force that loop to break execution? Or am I using a very inefficient coding technique in that Labview doesn't actually stop the autonomous code, it just ignores it? I'm not running into any problems, it just seems like a very useful thing to know. |
|
#2
|
||||
|
||||
|
Re: How to force break a loop
if you look at the get robot mode virtual instrument you can find where it switches between modes. before it switches out of autonomous it uses a labview control vi to stop the independant vi execution.
[edit] the loop itself isn't stopped nor paused, the whole independant.vi is closed/stopped. [/edit] Last edited by Burmeister #279 : 11-04-2009 at 18:39. |
|
#3
|
||||
|
||||
|
Re: How to force break a loop
normally to "pause" a loop without terminating it (which would imply that you cant start it up again), youd use a sync vi to have the loop constantly waiting for that vi to return something (like a semaphore). the reason the loop "pauses" is because a loop is programmed to not continue until all inner vi's have outputted something
Last edited by Uberbots : 11-04-2009 at 18:25. Reason: i r caveman |
|
#4
|
||||
|
||||
|
Re: How to force break a loop
Quote:
|
|
#5
|
||||
|
||||
|
Re: How to force break a loop
basically yes.
|
|
#6
|
|||
|
|||
|
Re: How to force break a loop
The puzzle has been solved. I'll just add that aborting running VIs is not something you should do on a regular basis. We are doing it here to make the framework simpler to use. The normal way of exiting a loop is for the code in the loop to say "I'm done". It can include info from anywhere else in the program to make that decision.
Using the Run and Abort methods on a VI is a way for you to spawn and kill a task similar to an OS thread. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to tune a PID loop? | steve d | Programming | 3 | 11-02-2007 20:49 |
| Need a little help with how to break out of the box | amateurrobotguy | Programming | 6 | 16-01-2006 12:56 |
| How long is one stamp loop | yangotang | Programming | 3 | 23-01-2003 20:36 |
| How much force to push the ramp? | archiver | 2001 | 1 | 23-06-2002 22:44 |
| How Can You Make A Closed Loop System???? | GRR_340 | Pneumatics | 6 | 21-03-2002 12:27 |