|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Double solenoid code
I've been trying to wrap my head around this code for two days now and I can't figure it out. I've got the declaration (DoubleSolenoid festo) and the port set ( festo(1, 2)) what is the code for teleop that gives me control of the solenoid, this is the only thing I can't get
|
|
#2
|
|||||
|
|||||
|
Re: Double solenoid code
http://wpilib.screenstepslive.com/s/...ders-solenoids should tell you what you need to know. Briefly, use the Set() method of the DoubleSolenoid class, passing it one of the constant values kOff, kForward, and kReverse.
|
|
#3
|
|||
|
|||
|
Re: Double solenoid code
My line of code for Set() looks like this
Code:
festo.Set(kForward); Code:
C:/windriver/workspace/SimpleTemplate/MyRobot.cpp: In member function `virtual void RobotDemo::OperatorControl()': C:/windriver/workspace/SimpleTemplate/MyRobot.cpp:58: error: `kForward' undeclared (first use this function) C:/windriver/workspace/SimpleTemplate/MyRobot.cpp:58: error: (Each undeclared identifier is reported only once for each function it appears in.) |
|
#4
|
|||
|
|||
|
Re: Double solenoid code
Because kForward is a member of the DoubleSolenoid class. Use DoubleSolenoid::kForward
|
|
#5
|
|||
|
|||
|
Re: Double solenoid code
Sorry, I am a bit new to C++ (recently switched from labview) where is it that I make the ::kForward, is it in the Teleop, or init?
|
|
#6
|
|||
|
|||
|
Re: Double solenoid code
In the set line that you posted, replace kForward with the text I posted above.
|
|
#7
|
|||
|
|||
|
Re: Double solenoid code
Thanks, the code built correctly I will try this out on the bot today!
|
|
#8
|
|||
|
|||
|
Re: Double solenoid code
Okay, tested the program but I still have an issue.
The code seems to be working, I can see the lights on the FESTO changing as I hit the button on the joystick, however, it seems that the solenoid will not fire. Is this a wiring or more code problem? And how can we get this fixed? |
|
#9
|
|||||
|
|||||
|
Re: Double solenoid code
Is it a 12 volt or a 24 volt solenoid? Are you providing it with the voltage it requires?
Do you have enough pneumatic pressure supplied to it for the pilot valve to activate? |
|
#10
|
|||
|
|||
|
Re: Double solenoid code
24 Volt, I have the wires running from the solenoid breakout board into the FESTO. And as for pressure we are building it up to 60 for testing, and nothing is firing.
|
|
#11
|
|||||
|
|||||
|
Re: Double solenoid code
Just to be certain: Are you feeding the Solenoid Breakout's power input with 24 volts?
|
|
#12
|
|||
|
|||
|
Re: Double solenoid code
Yes, we have a 20 amp fuse on it, should we be using a 30 amp?
|
|
#13
|
||||
|
||||
|
Running it through a breaker would only give it 12 volts. 24 volts has to come from the power supply at the bottom of the PDB.
|
|
#14
|
|||||
|
|||||
|
Re: Double solenoid code
Quote:
The cRIO only uses the first two terminals of the four on the 24v output of the Power Distribution Board. Use the second two to feed the Solenoid Breakout. (The black connectors show a NC on the third terminal, but the PDB itself provides 24v there.) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|