Programing(EasyC) Pneumatics Help

We have just started using pneumatics not too long ago and we are having a bit of a problem with the programming. We are now using a single-action piston with only one tank. We programmed it in easyC but the piston was fully extended till the tank ran out of air then it would retract.
The easyC program for the pneumatics command is
JoystickToDigitalOutput ( 1, 6 , 1 , 12 ) ;

Also when we turn on the robot, the solenoid would just release all the air.
Please help. Thanks!

I would suggest looking on YouTube for tutorials. There is a wide variety of videos that can probably help you.