need help to limit stroke on a hydro cylinder

Hello all

Is there a way to limit the movement? I have a hydro cylinder all mated up and flexible so I cam move it in my main .SLDASM I would like to limit the movement of the cylinder so that it will stop at the top and bottom of the stroke. Any help would be great. Thank you.

Using SW2012

I want to stop this

and this

SolidworksAssemblies