Ok so our plan is to have a few different types of buttons for our solenoids. For some reason our code inst working and any advise would be appreciated. (the last one is the toggle.vi that is in our teleop)
Are the LED indicators on the cRIO solenoid module turning on?
These are Single solenoids you have defined.
Single Solenoids don’t go “Reverse”
yeah they stay lit green but when I click the button it dost change.
Single solenoids are true/false devices.
They are either “On” or “Off”
Double solenoids would use “Forward” and “Reverse”
Is there a way to do it with a single?
Please explain what you mean by forward and reverse. If you mean two states, a single solenoid also has two states.
Just change where you use “Forward” to “On” instead
and change “Reverse” to “Off”
I’m trying to have a cylinder push out and come back by using buttons on my controller. I was able to get the toggle to work by switching it to on and off instead of forward and reverse, but for some reason the two button is not working even though I did the same thing.
When you continue to hold both buttons 3&4 down at the same time the solenoid module LEDs aren’t changing?
ok it is working now but sadly it wasn’t what I was hopping it would be. The idea was to make it go out if I press button 3 and stay in that position, but then go back in when I press number 4.
Disclaimer - I’m not a programmer - but I understand the solenoid:
A solenoid has a normally open and a normally closed condition. If your steady state condition would be the closed (rod inside cylinder) then hitting the momentary button on the controller sends the command to activate and change that state - but when you let go, it will go back to steady state.
You could do a number of things to get what you want - use a joystick or switch on the controller rather than a momentary button - so it “stays” in the activated state - or you could program that the button changes the condition from off to on. Push once for out, push again for back in. Probably a bunch more programming options - like I said, that isn’t my specialty.
Here are two approaches:
-
Incorporate a feedback node to remember what your last choice was.
-
Embed the solenoid Set into two Cases, one for each button, so that it only gets Set when a button is pushed. The False Cases would be empty.
where is the feedback node?
Programming -> Structures
Would the feedback be inside the case, connecting button to feedback then case, or case to feedback to set?
(by the way thank you for putting up with my stupid questions)
It’s easier to show, so here’s an example (attachment 1) using a Select (found under Programming -> Comparison), and a Feedback node that remembers what the last value set was.
The second attachment shows the alternate method that just uses Case statements. The extra Case boxes at the bottom are just there to show what the False cases look like.



thank you for all the help, I was able to get it all to work. if you know anything about mecanum drive, http://www.chiefdelphi.com/forums/showthread.php?t=125051



