KEPCO KLR Series Developers Guide User Manual
Page 68

5-6
KLR-DEV 060713
FIGURE 5-2. EXAMPLE 2: USING THE POWER SUPPLY TO CREATE A VOLTAGE RAMP (SHEET 2 OF 2)
Kpklr_Set_Volt_Curr (KLR_Session, voltage, current); //voltage and current
/*
The above function sets both the voltage and current setpoint of the power supply
*/
Kpklr_OutputOnOff ( KLR_Session, 1); // output on
for (i=0;i<10;i++){
// generates the ramp ten times
for (voltage-voltage_start; voltage <=voltage_end; voltage+=voltage_change){
Kpklr_SetValue (KLR_Session, voltage,0); // set the voltage level only
Delay(500); // delay for 500 milliseconds
}
Kpklr_SetValue (KLR_Session, voltage_start,0); // set the voltage level only
delay (1000); // wait for unit to return to zero (no load)
} // end of all ramps
Kpklr_OutputOnOff ( KLR_Session, 0); // output off
Kpklr_close( KLR_Session); // free up memory and close VISA session
return (power_supply_status);
} // end of main
// if not created as a project, include the driver code at end of program
#include "Kp_KLR.c"