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.
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]
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
So that’s why Begin.vi requires a VI reference to the autonomous mode?
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