01-25-2009 07:31 PM
We are attempting to use the joystick trigger to start two motors when pressed (and stop them when not pressed). We do not want to use the axis. (I think)
We are using the get joystick vi.
From the get joystick vi we created a control and have unbundled with name to access the buttons.
We wired button 1 to a case structure. True contains a set motor vi for each of our two motors. (We opened communication with the motors in basic robot main. One we wired and one we did not.)
When running the project, the front panel indicates the trigger pull, but we get no response from the motors. (We have tested the motors with other projects so we know the problem is not there.)
When running in highlight execution, even though the indicator shows the trigger is pulled, the result is false. We would really like to have a true.
Any suggestions?
01-25-2009 11:16 PM
This would be easier to help you if you posted your VI.
01-26-2009 11:04 AM
Good idea. 🙂 Here they are.
01-26-2009 02:45 PM
Dear DebK,
See the attached VI for one possible solution. It's very "rough and ready", but it works. Just replace the Basic Robot Main in the Basic cRIO Robot Project with the VI below to test it out.
Let me know if you have any additional questions!
~Nate
NI FIRST Support
01-26-2009 04:45 PM
Your problem is pretty simple - you just need to remove the cluster constant (on the block diagram), and instead connect the wire that actually has the data you want on it. Connect the same wire that goes to the Button indicator to the Unbundle node. You'll probably find it helpful to use "Unbundle By Name" in place of "Unbundle."
What you have now is an indicator that shows you the button states, and a separate (and unrelated) constant cluster of all false values. You're using that cluster of false values, rather than the values you actually read from the joystick, to control the case structure.
02-03-2009 07:00 PM
Thanks all. We are up and running... unbundle by name did the trick.
02-09-2009 01:51 PM
For all those who are interested there is now an example program on working with buttons:
Joystick Button Control (Using a Functional Global Variable)
Best Regards,
~Nate
NI FIRST Support
12-16-2014 03:33 PM
Hi! Did you install any additional libraries to work with the joystick? When I try to load your VI, I see some interrogation signs instead of the functions. I'm very new to all these labVIEW stuff.
01-06-2015 04:31 PM
Hi Juanita,
Do you mean that his VI contains functions that are white squares with black question marks?
This is because the VI's back in 2009 were located in D:\Program Files\National Instruments\LabVIEW 2009\vi.lib\Robotics Library\WPI\ If you hover over one of the functions with the question mark, and toggle on Context Help (hit Ctrl+H), you'll see that it is trying to find the VI within the location above.
The new VI's are located in D:\Program Files\National Instruments\LabVIEW 2014\vi.lib\Rock Robotics\WPI\ Do you have such a directory? (It might be on your C: drive rather than D:)
I would recommend starting by checking out "Tutorial 4 - Developing a Robot Project" and "Tutorial 5 - Editing Team Code VIs". These are available from the Tutorials tab when you open LabVIEW for FRC 2015.
All the best,
Ryan
01-14-2015 11:53 AM
Hi Ryan
In the FRC 2015 robot project if you look in the teleop.vi joystic section, in 2015 project they use the WPI_Joystick_GetValue.vi while in the FRC 2014 they use WPI_Joystick_Get.vi. in FRC 2015 they use Index Array while in FRC 2014 they use Unbundle by name to connect Axis or Buttons to Robot drive.
My question is how to connect joystick buttons using the index Array in the 2015 robot project, is it by just numbering the indexes with a constant values (index0..index9) to reflect joystick button numbers ? and use the corresponding output on the subarray to connect to the Robot drive )?
thanks
macro009