Download Print this page

Agilent Technologies E3632A User Manual page 137

Dc power supply
Hide thumbs Also See for E3632A:

Advertisement

Chapter 6 Application Programs
C++ Example for GPIB(IEEE 488)
...continued
/* Open communication (session) with power supply */
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, Visa_address, 0,0, &power_supply);
/* Query the power supply id, read response and print */
viPrintf (power_supply, "*IDN?\n");
viScanf (power_supply, "%s", &reply_string);
printf ("Instrument identification string:\n
/* Initialize Power Supply */
viPrintf (power_supply, "*RST\n");
viPrintf (power_supply, "Current 2\n");
viPrintf (power_supply, "Output on\n");
printf("Voltage
Current\n\n");
/* Step from 0.6v to 0.8 volt in .02volt steps */
for(voltage =.6;voltage <<=.8001;voltage +=.02)
{
viPrintf (power_supply, "Volt %f\n",voltage);
printf("%.3f",voltage);
delay(500);
viPrintf(power_supply,"Measure:Current?\n");
viScanf (power_supply, "%lf",&current);
printf("
%.3lf\n",current);
}
viPrintf (power_supply, "Output Off\n");
/* Close communication session */
viClose (power_supply);
viClose (defaultRM);
}
/* Pauses for a specified number of milliseconds. */
void delay( clock_t wait )
{
clock_t goal;
clock_t delay;
wait = wait/1000;
delay = (clock_t)wait * CLOCKS_PER_SEC;
goal = delay + clock();
while( goal > clock() );
}
End of Program
134
%s\n\n", reply_string);
/* Set power on condition
/* Set Current limit to 2A
/* Turn output on
/* Print heading
/*set voltage
/* print power supply setting */
/* allow output to settle for 500 msec */
/*measure output current
/* retrieve reading
/* print reading
/* turn off
*/
*/
*/
*/
*/
*/
*/
*/
output
*/

Advertisement

loading