View Single Post
  #2   Spotlight this post!  
Unread 23-02-2011, 16:06
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Buttons for controlling Extender

It looks like you took a Motor example and called it from Teleop. As you have discovered, this does not work. There's a tutorial you can view from the LabVIEW Getting Started window that tells you how to integrate examples into the robot framework.

In your case, you need to do a couple of things to make the code work the way it looks like you are asking it to. Put the Motor Open in the Begin vi, and wire its device reference output to a Motor Refnum Set, giving it a memorable name. Put the Motor Close in the Finish vi, taking its device reference from a Motor Refnum Get with the name you chose. In your Expand and Retract functions, remove the while loop and take the Motor Set's device reference from a Motor Refnum Get just like the one you put in Finish.

Once you do that, the code should run. However, you don't appear to have any way to stop the motor. That might be a problem.
Reply With Quote