01-28-2014 07:47 PM
I am trying to make the shooter arm withdraw after launching and hitting a limit switch. Upon hitting the limit switch, I want the shooter controls to be disabled while the arm is moved to its original position. How would I program this?
(Program image in the attachment below)
01-28-2014 08:00 PM
The best method to do this is to develop a state-machine and only react to the joystick button press when it is in the "Fire" state.
www.frcmastery.com has a great example video creating a FRC state machines found at
http://www.frcmastery.com/labview-for-frc/2010-videos/state-machines/
The video was created using the 2010 template but it is still very well done and the concepts are still relevant.
Hope this helps
Mark
01-28-2014 08:18 PM
Which function(s) would I be using? WPI Robotics Library->I/O->Digital Input ?
01-28-2014 08:43 PM
Unfortunatly the answer is not that simple.
The WPI Library contains vis that read sensors or set outputs.
In order to acomplish your goal you will need to build code that inteligently sets outputs based on joystick and sensor inputs.
To do this you will use Case Stuctures, Shift Regiters, TypeDefs and other functions to build the inteligent code.
A state-machine is a combination of functions called a pattern that helps a programmer create inteligent code to do what you are asking. The video link explains what a statemachine is and how you would create one in the FRC environment.
Mark
01-31-2014 05:42 PM
How do I know what DIO Channel the Limit Switch(es) is/are?
01-31-2014 06:42 PM
If you go to Help>>Find Examples..
Go to the Browse tab
Open the FRC Robotics>> Digital folder and select "Simple Digital Output.lvproj"
When you open it you should see the front panel.
You will need to select a set of DIO pins on the side car to connect your limit switch.
The row that the limits switches are connected to will be the DIO number you select in the DIO channel drop down.
Example:
We talked about wiring limit switches in posts last year found here.
https://decibel.ni.com/content/thread/16301?tstart=60
https://decibel.ni.com/content/thread/16068?tstart=0
01-31-2014 07:15 PM
How do I run it? I'm new to this, so how would I run it while connected to cRIO?
01-31-2014 07:41 PM
If you haven't setup your cRio and driver station yet start by following all the instructions in the LabVIEW Quick start guide
found at
https://decibel.ni.com/content/docs/DOC-34661
02-03-2014 05:36 PM
I already had cRio set up; what I meant was: do I just open the vi and click, "Run"?
I did that, and got this
02-03-2014 09:19 PM
You are going to have to give step by step details of what you have done so far in order for me to help you further.