We hypothesize that the trend of the Rapid Shallow Breathing Index or RSBI rate, is a better predictor of weaning outcome than the RSBI as a single value during the weaning trial. patients are recruited during a weaning trial on t-piece and the RSBI during what the RSBI is measured periodically. The outcome is ventilatory status at 24 hours after the weaning trial.