roboRIO not holding code

As we were testing the robot every single time the robot is out of range of communications it acts as if there wasn’t a program on it. The driver station says “No Robot Code” this also happens every time the robot is power cycled and every time the driver station application is closed then restarted. Is there a reason as to why the program does not stay on the roboRIO until a new program is uploaded? All of the firmware is up to date.
Thank you in advance.

“No Robot Code” just means the program isn’t running. If you’ve deployed code to the roboRIO, that means the code is crashing. This usually happens if you declare multiple sensors or motors using the same I/O port or CAN ID, or if you’re trying to use an uninitialized variable. If you look at the driver station message area, it should display error messages that will tell you what the problem is.

It sounds like your code is crashing. Can you please post a zip or a link to your project in the thread?

We actually found the problem. When starting up the RoboRio in our game bot, cycling it and even restarting the driver station, the Robot Code went from red to green. I did not have to upload the code for this to work. It worked on its own. We think we have found the problem. Thank you so much for your help!

Yes we definitely found our problem. Thank you all for your help!