02-26-2016 06:33 PM
Hello, the programmers in our team are struggling to program the Solenoids used for the control of the pneumatics with the use of joystick buttons. We have researched plenty about Solenoids and how to program joystick buttons but have not yet found a solution to our problem. It would be greatly appreciated if some one could show us some sample code or more information about this subject.
02-27-2016 11:59 AM
Assuming you are using LabVIEW go to
Help menu and select Find Examples...
Navigate to FRC Robotics -> Pneumatics -> Simple Solenoid.lvproj
The example shows you how to connect and activate a solinoid using the PCM.
The Voltage of your solinoid matters so make sure the correct the VSOL jumper is set for the voltage of your solinod.
This should help you figure out if your wiring is correct if you still need help putting this into your robot main let us know.
Mark
02-29-2016 03:50 PM
Thank you but our team already knew how to use the solenoids. What we need to know how to do is how to control the solenoids with the use of joystick buttons. Ex. (Pressing "A" on the joystick sends pressure from the compressor to the cylinders)
02-29-2016 10:28 PM
Ok Here is the basics on programming using the joysticks
First plug in you game controller and open you Driver station and select the USB symbol.
You should see your game controller highlighted and the axes, buttons and POV controls available for that controller.
Press the button you want to use and figure out what button number it is
Button 0 is the top left and it numerates going down Button1,2,3....
Next open the Teleop vi in your Robot Main
Next select Index Array from the LabVIEW array pallet and place it on the block diagram of the teleop vi
Wire the button array (Thick Green Wire) to the top left terminal of the index array.vi
Then wire a numeric constant to the lower left terminal of the index array.vi
Type the number of the button inside the constant.
The index array will extract the specified button value out of the joystick button array and the output is the desired button value
This value can then be wired into the set vi for the solenoid
Hope this is what you need
If not please give us more details about your issue and post screen shots or attach code so we can better help you
Mark
02-29-2016 10:40 PM
We finally figured out how to control the solenoid but instead did it by using an array to cluster function and worked fairly well. Thank you so much for your help!