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);