Deploying stand-alone program on crio.

What is the procedure for creating a stand-alone program on the crio that runs when the crio is booted. LabView provides a procedure to do this in the LabView Environment. Have been unable to find similar procedure for Java. Can someone point me in the right direction or explain how to do it? Thanks.

Do you mean like an Init class?
If so you would do something like this,


public void RobotInit() {

}

When you image the cRIO for java use, the labview software sets up the squawk VM to run your code. Netbeans automatically configures your code for use on the cRIO when you build the code. (F6)

Gordo,

I’m not sure what you are trying to do.

Are you trying to run your robot app?

Are you trying to run another app in addition to you robot app? If so, why do you want them to be two apps? Can you use Java threads to run them separately? If you really want to get tricky you can run to “Isolates” in Squawk, which are a lot like processes. But that probably isn’t really needed.

Trying to get the robot application to be loaded and run when the crio is powered off and powered back on. LabView provides a procedure for doing this, referring to this as running in stand-alone mode, have not found anything similar for Java. I assume this is needed for the competition.

Initially thought that the way netbeans loads the code this was basically done but is not. Powering off the crio and back on does not run the robot application. Have to load via netbeans again.

So far none of the suggestions has helped. Thanks.

OK,

Java always downloads the code to the the cRIO’s file system, then always reboots the robot. So if you’ve ever seen you code run from netbeans, then you’ve seen it run in “stand-alone mode”.

So the problem is - why does the robot not seem to run when you don’t start it from NetBeans.

Before power-cycling your robot, try one of these things:

  • Run the NetConsole application on the driver station or a development machine
  • Run “ant echo” from a development machine that’s networked to the cRIO:
  1. cd to your robot project directory

  2. type “ant echo”

One thing to keep in mind is that if you are power cycling your robot (vs resetting the cRIO), it can take the new wireless access point 40 seconds to reconnect. In the mean time your robot program will have started up so you will miss any messages that you print during initialization.

Thanks for your help, problem resolved.