The device (1) has a control unit (15) for controlling a surgical instrument. A storage unit (23) stores configuration data i.e. control values, that describe a state machine in states. The control unit reads the configuration data, translates the state machine into a control program and controls the instrument according to the control program. A switching device assigns adjusting values of a real or virtual adjusting device to a mathematical function received during execution of the control program for obtaining a scaling factor for the control values. An independent claim is also included for a method for generating a control program for a supply device of a surgical instrument.