default autonomous code won't work

Okay, our robot’s already shipped, but this is bugging me.

I could never get the autonomous code working at all on our robot; I could see the sensors working and the indicators for them on the dashboard changing as I moved the sample line below them, but the robot would never move. I was using the default code given when you select “framework with game code”, which I thought (and read in many places) would follow a line as is. I changed absolutely nothing in the Main or Auto Independent vi’s, but they never worked. I was hoping to add more to the end of the code so that we could score, but it seems we will have to sit still for 15 seconds.

I attached images of the code (which should be 100% default), does anyone see what’s wrong with it?

the default code does not open the dio references in begin, you have to add them and specify which channels they are plugged into. in your case even though the sensors where powered and responding, the robot was not “seeing” them.

I actually did have those added to the, with the same names as those in the autonomous vi, I just didn’t add a picture of that, but just to make sure I did it right, I’ll add a pic.

I’m not an expert at LabView, but I do know programming, and after perusing the code I can’t find anything wrong with it myself. Hopefully I’ll have time to play with it and figure something out before we actually compete.

Were there any errors printed to the diagnostics screen on the driver station software?

If you run the code on the robot by clicking the run arrow, you can use breakpoints and probes. Can you verify that the auto loop is running for eight seconds? You can look for errors at the DS diagnostics tab, or probe on the diagram.

Greg McKaskle

It’s impossible to be sure from looking at a picture, but it looks like the constants you added might have a space at the end. That would be a problem, as the refnum registry is extremely picky about the names having to match exactly.

Nice catch Alan! There were spaces after the names, so hopefully that was it. But like I said, we already shipped the robot so I can’t test it out or do anything involving the robot until we get it back at the competition.

Hopefully that was the only problem, but I’ll be sure to check the diagnostics when I do get the chance. Thanks for all the suggestions!