|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: need Solenoid help
Are you doing pneumatics? If so, there are a number of ways to wire pneumatics. Assuming you hook the pneumatic valve to two Solenoid channels (DO channels). Here is the code to operate it.
Disclaimer: I am new to pneumatics, so this may not be the right way to do it, but it works for us. Another way to do it is to use a relay instead of two solenoid channels but it requires a relay. Code:
#define SOLENOID_EXTEND_CHANNEL 1
#define SOLENOID_RETRACT_CHANNEL 2
private:
Solenoid *m_solenoidExtend;
Solenoid *m_solenoidRetract;
...
// In some constructor
m_solenoidExtend = new Solenoid(SOLENOID_EXTEND_CHANNEL);
m_solenoidRetract = new Solenoid(SOLENOID_RETRACT_CHANNEL);
...
// To extend the pneumatics
m_solenoidRetract->Set(false);
m_solenoidExtend->Set(true);
// To retract the pneumatics
m_solenoidExtend->Set(false);
m_solenoidRetract->Set(true);
|
|
#2
|
||||
|
||||
|
Re: need Solenoid help
Forgot to mention a few more things: make sure your DO module is in the default slot 8 (or you have to specify the slot in the code). Also make sure the soloenoid bumper is powered with appropriate voltage. FIRST provided 24V valves this year, so you need to feed 24V to the bumper (not 12V).
|
|
#3
|
||||
|
||||
|
Re: need Solenoid help
BTW, forgot to mention one more thing: you need to create a compressor object too. The compressor power should be hooked to a Spike relay and the pressure switch should be hooked to a digital input channel.
Code:
#define PRESSURE_SWITCH_CHANNEL 1
#define RELAY_COMPRESSOR_POWER 1
private:
Compression *m_compressor;
...
// In some constructor
m_compressor = new Compressor(PRESSURE_SWITCH_CHANNEL, RELAY_COMPRESSOR_POWER);
m_compressor->Start();
Last edited by mikets : 24-02-2010 at 13:42. |
|
#4
|
||||
|
||||
|
Re: need Solenoid help
thanks that should be egood enough
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help with Festo Solenoid and Labview | Team2883 | General Forum | 3 | 17-02-2010 12:56 |
| Need help with SMC solenoid valves | Ed Law | Pneumatics | 6 | 04-02-2010 06:43 |
| Solenoid Help | aznbadboixx | Pneumatics | 0 | 15-02-2008 15:53 |
| Solenoid Help | Brigander | Programming | 2 | 14-02-2007 17:13 |
| Need instructions for SMC Single/Double solenoid | WHou | Pneumatics | 5 | 29-01-2005 08:17 |