This animation shows a 4-way 2-port spool type air valve driving a single ended air cylinder. As each solenoid is activated, the valve moves to that side and the cylinder is then moved by the change in the air flow.