View Single Post
  #2   Spotlight this post!  
Unread 04-03-2014, 10:41
Greg McKaskle Greg McKaskle is online now
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Robot Mode Global Variable in LabView

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
Reply With Quote