FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

limit switches and labview

I am part of the FRC competition,

       Does anyone know how to program two limit switches using a jaguar to control a linear slide using labview programming?

       I have researched as best I can and I can't find any examples anywhere and I am not sure how to program the switches.

       I need all the help I can get so anything will help, Thank You!

0 Kudos
Message 1 of 3
(8,455 Views)

I would suggest you look at two examples and one tutorial.  The Compressor With Cylinder example uses a limit switch.  The front panel of this example shows how to wire a limit switch, and the diagram code shows how to read it using WPI_DigitalInputGetValue.vi.  Notice how the limit switch is used to change the solenoid direction, but you will want to use it to decide what speed value to pass to your motor.   The Motor Control example will show you how to wire and run a motor.  It defaults to a Talon motor controller, but can be easily changed to a Jaguar.  Tutorial 7 - Integrating Examples into Robot Code will teach you how to take example code and merge it into your existing robot code.

You can launch the NI Example Finder by clicking Find FRC Examples on the Support tab of the LabVIEW Getting Started Window.  And you will find the tutorial on the Tutorials tab of the Getting Started Window.  If you already have LabVIEW running with VIs open, you can choose View>>Getting Started Window...

0 Kudos
Message 2 of 3
(4,008 Views)

Some really good example code to get you started programming something new can be found at Team 358's website.

I know my team was extremely grateful to their help in setting up our "Team Code" project because this was our first year with LabVIEW and not many teams in the area program with LabVIEW.

http://team358.org/files/programming/ControlSystem2009-/LabVIEW/

They have example code for any FRC module you may ever need.

Hope this helps!

0 Kudos
Message 3 of 3
(4,008 Views)