Autonomous Program Testing

First year LabView programmer and just wanted to confirm one thing.

First, I’m using a case statement in Auto with one case for each Auto Program we may want to run and selecting that case from the Driver Console. That’s all good.

Then I used a stacked sequenced in the case to make the robot do sequential things for that program.

The question is lets say I have a 7 step sequence in one of my cases and I Auto Enable the robot but then manually disable it during Step 4.

When I go back to Enable should the program resume at Step 4 (or maybe 5) or does hitting Enable ALWAYS start the fresh.

The reason I ask it that is seems sometimes the sequence will start from the middle if it was not allowed to continue to the end.

Second question, should my last step always be an endless while loop? I thought I read some where that ending before the FMS commands it to can cause issues and that an endless loop resolves that potential issue.


The way it works (from my understanding) is the gets called from the robot main, when it finishes it returns to the calling vi. I don’t think you want an endless while loop, we have ended our autocode in 7 seconds and never saw any issue.

If your not rebooting the robot, or running the robot through a full auto test using the drivers station you may see some weird stuff.

So, if you don’t run through a complete sequence in Auto Enabled mode and if my sequence has an error, like it drives straight forever until I disable it, then what is the best way to reset and test again?

This is not correct. If you look at Robot you will see how the auto is actually called.

In the main loop you see the ‘Start/Stop VI’. This takes the VI reference for Auton (your actual auton code) and a ‘call context’. The first time you start Auton the call context is ‘Init’ and your Auton VI starts in the background and returns. The main loop is still retrieves every packet. When auton is disabled the call context is ‘Stop’ it kills the auton VI (quite abruptly).

If your VI does not fully execute by the end of auton it is stopped.

Got it. Thanks for the info. I haven’t looked at any FRC labview code in over a year and I forgot about that part. Thanks for the clarification.