In a medical system and a method for operating such a system, the system includes an implantable medical device of a patient, a programmer device, and an extracorporeal stress equipment adapted to exert a physiological stress on the patient, for automatically determining settings of a sensor for sensing a physiological parameter of the patient or for automatically determining a pacing setting of the device over a broad range of workloads of the equipment. The ingoing units and/or devices of the medical system, i.e. the implantable medical device of the patient, the programmer device, and the extracorporeal stress equipment, communicate bi-directionally with each other and form a closed loop.