So far, the only way in Simscape to prescribe a mechanical motion is using a velocity source, while in Simscape Multibody, the only way is to prescribe the displacement. I suppose the best way to make sure the resulting displacement from a velocity source make sense is to do an integration of the signal, with an initial condition consistent with the cylinder initial position, and scale the velocity signal up or down to get the displacement you want.
Otherwise, it's possible that the piston will move beyond the limit. The hardstop force is likely huge, but the velocity source doesn't care, because it's "ideal" and will generate whatever force needed to get the prescribed velocity.