Robot Mode Global Variable in LabView

I’m curious as to what other teams are setting this variable to in the We have seen a few cases were our robot has done strange things (motors running and such) when first enabled in Teleop mode. We tried different settings for this variable and haven’t figured out what is really causing the problem, though I highly suspect it has something to do with this, just trying to work through why it is doing it.

If you right click on the global and choose Find>>Global References, you’ll find that it is assigned in two places and never read. The global is there so that periodic code, vision code, etc. can have an easy way to make code conditional. You don’t really need to set the global. If none of your code is reading it, it won’t have any affect. If you are reading it, do you want the value set by the DS in Robot Main, or your value?

You jerking when teleop begins likely has to do with the values that the motors are set to while the robot is disabled. When enabled, those values are “live”. Shortly after that, your teleop probably reads joysticks and buttons and sets things to zero.

It is a reasonably good idea to set your motors to zero in the disabled function, but be sure that you aren’t getting into a race with Periodic tasks.

Greg McKaskle

The problem seems to be more than just a quick ‘twitching’ of the motors and such. It seems that some motors try to run a sequence, turning on for a couple of seconds, off for a bit and so forth.

Still working to figure out what is going on, but it is almost like the autonomous code is running, but not our code or only parts of it.


If you run interactively, hit the run button or Robot Main, you can open panels and see what is running. Also, the charts tab and log file will show you if the auto code is running. It shows up on the graph as a green line, or actually as tightly spaced green dots.

Greg McKaskle