View Full Version : Need help with programming double solenoids
noah10001
16-02-2015, 21:34
Hello, I am new to Labview programming and I was trying to program a double solenoid using an example code. Their code is from 2011 and I ran into trouble with wiring it to the "boxes" the attachments are my code and the sample code i used. I also cannot find how to get the joystick "box" etiher
Mark McLeod
16-02-2015, 21:46
Use this example updated for 2015 (http://www.team358.org/files/programming/ControlSystem2015-2019/labview/index.php#DoubleSolenoid) instead.
If you save the example picture, then drag and drop in on your block diagram it will generate the code.
jSchnitz
16-02-2015, 21:47
To get a joystick value now you'll need to use the Index Array function rather than Unbundling by Name, like so
http://puu.sh/g0lRV/4aa91483b1.png
noah10001
17-02-2015, 07:53
Thanks! but how do I set what button is forward and which is reverse
Alan Anderson
17-02-2015, 08:24
how do I set what button is forward and which is reverse
Use the "Sticky Solenoid Example" on the page Mark pointed to. The integers connected to the Index Array function select which button values come out of the function. It's a zero-based array, so "1" is actually the second button.
noah10001
17-02-2015, 09:24
Alright I am very close I have a xbox controller and I want it so Y is up and A is down. here is what i got. Even trying all buttons it doesn't work
Mark McLeod
17-02-2015, 10:28
The enums in Teleop are incorrect for Solenoid Set. That's why they have red dots.
Get a correct Solenoid Set Enum by
Deleting the wire into Solenoid Set (the one with the red dot)
Right-click on the now vacant Solenoid Set input node and choose Create->ConstantThat's the correct Solenoid Set enum type.
Now make copies of the correct one and replace all the others
Finally, remove the enum you created into Solenoid Set and wire Solenoid Set into the Select as it was before.
If done correctly all the red dots should be gone.
noah10001
17-02-2015, 16:49
Alright this worked! Now when i push a button my air cylinder goes all the way up or all the way down. Is there any way to have an in-between..I attempted to code the right stick on the xbox controller but said there were two different data types
Alan Anderson
17-02-2015, 17:07
Is there any way to have an in-between..
Simple answer: no. Pneumatic solenoid valves are two-state devices. There is no middle ground.
Complicated answer: with sufficient analysis and design, one can devise a way to use multiple solenoid valves and flow restrictors to cause a pneumatic cylinder to retract or extend an arbitrary amount. It will move in a spring-like fashion due to external forces, so some sort of feedback on its actual position would be helpful.
noah10001
17-02-2015, 17:23
When i click the buuton it is one-and-done.We want the button while pressed to flow and when released no flow anyway for this?
Mark McLeod
17-02-2015, 18:19
Do you mean like this example?
The solenoid here is Forward only as long as the button is held.
http://www.team358.org/files/programming/ControlSystem2015-2019/labview/DoubleSolenoidExample.png
noah10001
18-02-2015, 07:53
So is there a way to lift a joystick to lift the cylinders some and then let go and it will hold that pressure until i move to joystick again?
Alan Anderson
18-02-2015, 08:04
So is there a way to lift a joystick to lift the cylinders some and then let go and it will hold that pressure until i move to joystick again?
You can't do it with a double solenoid valve connected to a typical pneumatic cylinder.
It is possible to do something like what you are asking by using multiple solenoid valves connected in creative ways, but it is not something you will find an off-the-shelf solution for. However, it will be very difficult to make it meet the pneumatics rules, which require that the working pressure never exceed 60 psi.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.