Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Our programmer left... (http://www.chiefdelphi.com/forums/showthread.php?t=103707)

Alan Anderson 25-02-2012 23:12

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.

DeadlyJohny 26-02-2012 12:34

Re: Our programmer left...
 
Quote:

Originally Posted by Alan Anderson (Post 1134931)
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.

I get what your saying but is what I've done serve my purpose of pulling the trigger and releasing it causing the piston to fire and retract back?

Mark McLeod 26-02-2012 13:06

Re: Our programmer left...
 
Quote:

Originally Posted by DeadlyJohny (Post 1135074)
I get what your saying but is what I've done serve my purpose of pulling the trigger and releasing it causing the piston to fire and retract back?

No, what you wrote will not work, because it's a double solenoid.
It would only work with a single solenoid.

Team3417 26-02-2012 13:17

Re: Our programmer left...
 
Crap, that's the only way I thought I could do it. How can I fix this?

vhcook 26-02-2012 13:39

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.

Doc Wu 26-02-2012 19:38

Re: Our programmer left...
 
1 Attachment(s)
Because a picture is worth a thousand words...


All times are GMT -5. The time now is 22:11.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi