|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||||
|
|||||
|
Re: Our programmer left...
The Solenoid Set function's value input expects an enumerated value of Off, On, Forward, or Reverse. Those are mapped to integers 0-3, respectively. If you provide a boolean input, a single solenoid is supposed treat a false as Off and a true as On. I don't know if it would work right for a double solenoid. It's likely that you'll see the solenoid engaged as both forward and reverse at the same time, leading to an indeterminate state when the button is released.
The typical way to control a double solenoid from a button is to use a case block controlled by the button boolean value. In the true case, set the solenoid Forward, and in the false case set it Reverse. You can also use a Select (found in the Comparison subpalette) to choose between a Forward and a Reverse constant to feed to the Solenoid Set value. |
|
#17
|
|||
|
|||
|
Re: Our programmer left...
Quote:
|
|
#18
|
|||||
|
|||||
|
Re: Our programmer left...
Quote:
It would only work with a single solenoid. |
|
#19
|
|||
|
|||
|
Re: Our programmer left...
Crap, that's the only way I thought I could do it. How can I fix this?
|
|
#20
|
||||
|
||||
|
Re: Our programmer left...
First, disconnect the boolean from the solenoid set. Then hover over the port it was connected to. You will see that it is blue indicating either an integer or enum value is expected. Right click on this, and select create -> constant. This will make you an enum with the right values in it. Copy this so that you have two of them.
Now, use a Select from the comparisons palette (row three, icon 3 - looks like a big triangle with a ?, T, and F). Feed your button into the S port of that, wire one of the enums into each of the T and F ports, and set the value of the dropdowns to Forward and Reverse (in the appropriate places). Wire the output to the Solenoid Set. Last edited by vhcook : 26-02-2012 at 13:41. Reason: missed a step |
|
#21
|
|||||
|
|||||
|
Re: Our programmer left...
Because a picture is worth a thousand words...
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|