This paper presents an algorithm for designing dynamic compensator for infinite-dimensional systems with bounded input and bounded output operators using finite dimensional approximation. The proposed method was then implemented in order to find the control function for thin rod heating process. The optimal sampling time was found depending on discrete output measurements.