In Labview, is there a way to load multiple autonomous programs for different situations onto the cRIO, maybe even include it in the robot main? If this is possible, is there a way between matches that you could choose which one you want to use from a computer hookup?
You might want to wire some switches up to the digital input headers on the drivers station. Then you can just have control blocks that run one piece of code if switch 1 is active, another for switch 2, etc.
Just make sure when wiring the switches up you use a pull-up resistor! A forum search should enlighten you on how to do this.
Then simply set the switch before the match, and you’re good to go.
Could always make a sort of jumper if you have unused I/O ports, then read which one is closed to decide which autonomous code to use with a case structure. Or, just have a constant in the code and change it/redownload based on what you want to do
In Labview, is there a way to load multiple autonomous programs …
Absolutely. In the basic framework there is the static reference to the Auto Independent. In the Advanced framework, this is in the Begin VI. The approach will be to make a VI reference to an additional VI. The one wired out and going into the Get Mode will be the one selected when the DS transitions to auto mode.
To make another VI for autonomous, open the Auto Independent VI and Save As… to a new file leaving the existing stuff alone. Drag a copy of the static VI reference (a container with a tabbed corner) and place it near the current one. Drag the new VI on top of the static VI reference node. Now you should have two static refs one pointing to each VI. You now need to have some logic to select which one is wired out. You can use a text file, a dip switch, a digital switch on the robot, etc. If you want to use the data coming from the DS, you should wire all of the VI refs into the loop and select inside of the loop.
If you want to, you can even use VI paths and have a full directory of stuff to run. The static VI ref is an easy way to make sure that the VI gets deployed to the cRIO and loaded into memory. But if you update the project build spec or use ftp, you can put as many VIs on disk as you like. Then instead of using the static VI ref, you use the VI Open node with a path to the VI on the cRIO. Now you need a way to select which one runs. Again, you likely want to put this inside the loop that calls Get Mode.