Basic PID examples which usually cover temperature control are going to be of minimal use in devising control of clamp movement, because that is position control.
Clamp position is normally tracked with a linear sensor (Temposonics, Baluff, etc.).
The goal is rapid movement until nearly closed, then slow down and stop smoothly at the fully closed position so that you only hear a very soft thud. On opening, it might be slow break, rapid retract, slow & stop at fully open position. All positions need to be variable to accommodate different moulds.
A simple method for achieving this would be to give a series of fixed outputs to the clamp's proportional hydraulic valve as clamp position crosses appropriate setpoints. Two or three levels are probably sufficient. Some machines don't use proportional valves but instead two on-off valves in parallel with individual flow restrictors for fast/slow speed control. I'm guessing that Peter's reference to open loop is about this type of control.
As Peter said, making a position controller with PID blocks is just the beginning. It will need to be a cascade loop (position & velocity), it will need to compensate for the differing characteristics of the ram when opening and closing. Finally, a 'profile generator' is required to supply the setpoint so that accel, peak velocity, and decel are controlled.
And then, of course, it would have to be tuned...