5
Application Programs
Example Program for C++ (GPIB IEEE 488)
142
E3632A User’s Guide
/* build the address needed to open communication with GPIB card */
/* address format looks like this; GPIB0::5::INSTR */
/* */
strcpy(GPIB_address, "5"); /****** Change GPIB address here *****/
strcpy(Visa_address, "GPIB0::");
strcat(Visa_address, GPIB_address);
/* 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 %s\n\n", reply_string);
/* Initialize Power Supply */
viPrintf (power_supply, "*RST\n"); /* Set power on condition */
viPrintf (power_supply, "Current 2\n"); /* Set Current limit to 2A */
viPrintf (power_supply, "Output on\n"); /* Turn output on */
printf("Voltage Current\n\n"); /* Print heading */
/* Step from 0.6v to 0.8 volt in .02volt steps */
for(voltage =.6;voltage <<=.8001;v=.02)
{
viPrintf (power_supply, "Volt %f\n",voltage); /*set voltage */
printf("%.3f",voltage); /* print power supply setting */
delay(500); /* allow output to settle for 500 msec */
viPrintf(power_supply,"Measure:Current?\n"); /*measure output current */
viScanf (power_supply, "%lf",¤t); /* retrieve reading */
printf(" %.3lf\n",current); /* print reading */
}
Summary of Contents for E3632A
Page 1: ...Keysight E3632A DC Power Supply User s Guide ...
Page 2: ......
Page 3: ......
Page 12: ...X E3632A User s Guide THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK ...
Page 20: ...XVIII E3632A User s Guide THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK ...
Page 22: ...XX E3632A User s Guide THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK ...