Autonomous Independent Can Only Get Called a few Times

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!

I have not had the problem of autonomous not running after several calls. I have had the problem with the robot disconnecting when I modify the autonomous.

Cloning a VI duplicates the dataspace and a small VI header, but not the code. The dataspace is normally reclaimed when the refnum is closed. I suppose that RT could be different, but if that were the case, that wouldn’t work very well for round-the-clock industrial use.

If you believe there is a leak, you should be able to see it using the RT System Manager. I’d probably flip to the VIs tab and turn off the checkbox, then flip back to memory and CPU and start it. You can watch memory usage over time and see if it climbs and climbs each time you rerun autonomous.

Greg McKaskle

This happens to us too. I assume the reason for this is that if you modify the code in the vi (which not only means modifying the block diagram but even dragging a control around on the front panel) this means that the version you have on your computer is now a different version from the one running and you will need to re-download to make them current.