There are tutorials on NI.com/first and on the LVMastery.com sites. I'll admit that I didn't write them, and I haven't watched all of them for correctness, but they should show how to write the autonomous that works.
The other documentation on the framework is in the code itself. The green comment to the left of the loop in RobotMain states
Quote:
Robot Main implements the framework and scheduler for your robotics program.
It should not be necessary to modify the framework. You should be able to implement your code within the following VIs. ...
|
As usual, more documentation can be added, especially once we know what the misunderstandings are. Actually, no final decision yet, but we may look at some simplifications while we are at it. The initial framework was a widely cast net, intended to support many different programming styles and abilities. Now that we've seen what most teams prefer to use, I think it can be vastly simplified.
Back on topic, the auto was supported in two ways, independent and iterative. Iterative is basically the same as TeleOp -- called for each packet, expected to complete in under 20ms, and no easy support of sequences or repetitive code. Independent, on the other hand, is called once asynchronously, is automatically aborted when auto is over, making it east to do sequences and repetitive tasks. The way Iterative is called is pretty obvious, a subVI call for each packet. Independent is less obvious. In Begin, a VI reference is designated as being the AutoIndependent VI reference. Then the Get Mode VI in the Robot Main loop will automatically run the referenced VI when auto begins and abort it when the period completes. The syntax for calling and aborting was intentionally hidden in part because it is complicated by the different state transitions of the DS, and partly to prevent it form becoming broken by curious programmers.
By adding a subVI call to Auto Independent, the Run method will return an error. It is a little complicated, but VIs have a number of states they can be in (Broken, Idle, Active, Running, Reserved, Suspended, and I'm sure more that I can't remember off the top of my head) which define the operations that are valid on the VI. Run only works on Idle VIs. SubVIs are Reserved by their caller, so are not runnable because the are callable. Anyway, For that reason, I'm pretty sure the VI refnum was invalid so that Abort also failed. To be more sure what the value of the refnum was from the failed Run, I'll need to run that app.
Anyway, if there are any more questions or any more things to learn from this, fire away.
Greg McKaskle