Controlling 2 position double acting 24VDC solenoid

Does anyone know the proper signals to give the SMC SY3240 24VDC 2 position double acting solenoid? It has a 24VDC connector on both sides. I want to control a pneumatic actuator - be able to have the actuator extend and retract on signal. I am using 2 pins on the Arduino to control 2 relays that control the 24VDC input to the solenoids ( one relay for the extend side and one relay for the retract side of the double acting solenoid). I assumed that I would give a 24VDC pulse to the one side for 100 milliseconds or so and then when I want to change position, give a 24VDC pulse to other side. In practice I could get the actuator to extend with the first pulse, but it would not retract when I pulsed the solenoid on the other side. Any idea's.

link to datasheet?

http://www.smcpneumatics.com/americansmc/PCW_SQ_SZ_SX_SY_VQ/5_SY3000_and_SY5000_Series_Valves.pdf

All I have found - the one I am using is the base ported version of the SY3240

Thanks,

Dave

Nevermind, I wired up 24vdc directly using momentary switches and the double acting valve works like I thought it should - momentary pulse on one side swings the valve one way and a momentary pulse on the other side swings it the other way. I had tested the relay circuit and Arduino control pin with 5VDC prior to hooking up 24VDC and going live and it was able to light up test LED's I put in the circuit. Will go back to troubleshooting and figure out what changed.

Thanks.

hello ddailor,
why don't you just wire the solenoid directly to the arduino via a transistor or a mosfet. Basically, a solenoid is the same as a relay coil just without the contact. In terms of programming i would do something like this. activate a solenoid then use the blink without delay to turn it off. how about make a function of it to call it in maybe something like,

void Solenoid( Int Name)
{
 unsigned long previousMilis= millis();
 digitalWrite(Name,HIGH);
 unsigned long currentMillis = millis();
 if(currentMillis - previousMillis > 10) 
 {
  digitalWrite(Name,LOW);
 }}

@ ash901226:
That's rather a programming question,
but I fear your void Solenoid(int Pin) function won't work as is.

I understand you do not want to block your whole sketch with a delay ( that's why you use millis() )
Assuming it's called continuously, you'd have to tell when to trigger or how long it's already HIGH.
If you just call it to activate the solenoid, it will never go LOW.

You might create a small class to turn a trigger pulse into a fixed duration.
If you want, you can call that a Solenoid although it's a rather universal task.

class Solenoid
{
private:
  byte _pin;
  unsigned int  _duration;  
  unsigned long _tstart; // the millis() when triggered, or 0 when LOW

public:
  Solenoid (byte pin, unsigned int duration=250);  // constructor, needs a pin number. Optional: activation duration in msec 
  void trigger();  // to be called to activate
  void update();  // to be called regularly. Easiest solution to leave it to the user of this class, being responsible to call that once per instance. 
}

That's just a possible definition. Implementation missing here, but usage should be rather clear.
Now you can expand it to some double pin ( "2 position double acting " ) class, asserting that only one of the two positions can be triggered at a time.