View Single Post
  #4   Spotlight this post!  
Unread 19-01-2011, 03:18
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: LabVIEW Autonomous Cases

I think he was inquiring about all the nested case structures for the "autonomous enabled" case, so I'll explain that as best I can.

Outside the main while loop is the autonomous independent vi. This vi can be programmed to have one big sequence structure with something like having the first be drive forward, then have a timer for 2 seconds, then raise the arm, etc. The wire it outputs is a reference to it.. kind of like a file extension, or a URL.

Inside the main while loop, there's the Get Robot Competition Mode.vi. That outputs the obvious "autonomous enabled, teleop enabled, blah blah blah, but it also outputs "Call Context". This is either "Init", "Execute", or "Stop." these go into the second layer of case structures (for most of the vis like teleop, the case structure is within the vi). When the robot mode output changes (you hit the "disable" or "enable" buttons on dashboard), it first goes to the "stop" case of the last one, and then the "init" case of the new one. For the autonomous case, it has the functions Start background vi and stop background vi in the init and stop cases, and nothing in execute, and each takes in the reference from the autonomous vi.

The start vi function, well, starts the autonomous independent vi. That means that the first loop in which the autonomous enable is called, it starts the independent vi, and that starts running. In the "execute" case, it just lets that vi run it's course. And in the "stop" case, it stops the vi the same way as if you pressed that red abort button.

I hope that makes sense, and is what you wanted