After an episode of acute respiratory failure requiring mechanical ventilation, weaning the patient from the ventilator may be difficult. Discontinuation of ventilation is estimated to take up to 40% of the total duration of ventilatory support. Approximately two- thirds of patients can be disconnected from the ventilator after a spontaneous breathing trial. Prolongation of mechanical ventilation may increase the risk of adverse events such as infections and can increase morbidity and mortality.