The CNAO system to monitor and control hadron beams for therapy