When I test autonomous mode, using the “independent” vi, something weird is happening. I wired all the motor speeds and times and such to controls (rather than constants) to make them easy to change on the fly. However, after about five times of enabling, watching it run, adjusting the values, and enabling again, enabling doesn’t do anything until I reload the code (click the finish button, then hit the run button again).
I suspect that it might be an error in how the autonomous code is called and aborted. This is because, when I open up the start vi function (in the init case of autnomous), it has a comment saying,
"The BIG problem with the VI refs.We are using a static VI ref to make sure the AutoInd VIis on the controller and doesn’t require users to deploy to debug.
We open a new independent ref each time we run because we need to let the AutoInd VI own the ref, or it will be invalid when the agent is closing things down. Because it is owned by the AutoInd VI, it also means the clone ref goes bad when the AutoInd VI finishes. Next time we want to run we need to clone again."
If the controller is taking multiple clones of the vi, would that cause it to stop working after a while? I’m not really sure of what exactly clones are, either.
Also, the comment seems to say that it’s not necessary to redeploy to modify the autonomous code. Whenever I try to change something in the block diagram, even when it’s disabled and the vi isn’t “running”, the driver station immediately says that robot code was lost. This isn’t such a big problem, but should that work? Is it working for other teams?
I also remember the head programmer from last year saying that autonomous independent was messing up then, which is why we used iterative.
Right now, I’m planning on just using an autonomous iterative vi (like last year) and putting that inside the autonomous enabled case.
If there’s any other teams that have had similar problems, solutions, or questions about what’s happening, please respond. Thanks!