Coding in LabView. Ok SO we have autonomous code written and teleop written. We are using Main.VI as our startup code on the cRio. Teleop is running correctly when the DS is switched to Teleop Enabled. Here is the problem, autonomous is correctly running on the block diagram on our laptop however the code is not running on the bot when the DS is switched to Auto Enabled. :ahh:
Are you feeding the watchdog?
First, are you using the Basic framework, or the Advanced framework? The advanced framework has Begin.vi, Finish.vi, and many others.
Second, are forgetting to feed your watchdog or something in auto? Are you (improperly) trying to Open motor and drive refs in your autonomous code?
Lastly, posting your code would make helping you a good bit easier.
We are using Basic framework and yes are feeding the watchdog. I am posting our Basic framework for you to look at. Ok, hang on have to compress as we are 3 kb too big for attaching fileā¦
Nevermind, the screenshots are too bigā¦give me a little bit and I will go somewhere where I can get WinZip to compress the files. Be back in a bitā¦:eek: :mad:
Finally made it to a computer with compression software. Here is our Basic Main.VI The programmer finally got it to work but in an unconventional method which you will see in the code. Heās got the code in a loop for āotherā but is calling the Autonomous VI outside the structure (as it was in the default). If you have any advice as to what we may have done wrong it would be much appreciated!
Basic Robot Main.zip (55.6 KB)
Basic Robot Main.zip (55.6 KB)
your autonomous independent.vi is the second thing wed need to help you out.
EDIT: I think your problem may be that youāre trying to run your autonomous code in the āOtherā section of Robot Basic Main. You really shouldnāt be trying to do much in this section. Although it looks like the code is currently commented out with that False constant.
Anyways, your autonomous code should go in your Autonomous Independent.vi file. Donāt worry that it doesnāt look like it gets run anywhere. The Basic Framework takes care of that for you, and will run that vi whenever you enter autonomous mode. Specifically, the Basic Robot Mode.vi takes care of this for you.
First of all you have to have it running from Autonomous.vi to run effectively and correctly. Second, is it possible we could see what your Autonomous.vi looks like? It could help drastically in diagnosing your problem.
Edit: Darn, beat to the punch. 
(v-8 slapping forehead)ā¦Itās been a dayā¦it started with letting the magic smoke out of our extra two Jags this morning (literally)ā¦feels like a Friday 13 and Monday all rolled into one. Canāt get to the auto code until tomorrow morning but will get it posted as soon as I get to school and tget access to the laptop that it is on. Thanks for staying up and looking at it and Iāll be in touch in the morning.:o
Let me just offer up this chunk of autonomous code. Itās super easy to program to do whatever you want, and it should drop right into the basic framework. Hereās how it worksā¦
On the far left, youāll see an array constant. This is your autonomous āprogramā. The first number in each array element is how long a particular move will last. The next two columns are joystick commands that you send for that length of time. X/L is the virtual X or Left joystick position, in Arcade or Tank drive, respectively. Y/R is the Y or Right joystick position.
So the program thatās currently in there does this:
- For 3 seconds, move the ājoystickā to Y=-0.75. (This makes you drive 75% speed forward in arcade.)
- For 12 seconds, move the ājoystickā to X=-0.75. (This makes you spin around in arcade mode.)
- Stop.
To add more steps, you just add more elements to the array. To change the program, you change the numbers in the array.
In your case, youāre using Tank drive, so youād want to change that arcade drive to a tank drive. To do this, right click on the arcade drive vi, select āReplaceā then āRobotDrive Paletteā then the tank drive vi. Then change the numbers in the program to something that makes sense for your tank drive style.
Autonomous Independent.zip (11.8 KB)
Autonomous Independent.zip (11.8 KB)