The purpose of this randomized controlled trial is to evaluate a fully automated algorithm for the establishment of glycemic control in diabetic patients and to compare the results with routine management of hyperglycemia in patients undergoing cardiopulmonary bypass surgery.