EasyManua.ls Logo

Keysight E3632A - Page 164

Keysight E3632A
196 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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;voltage +=.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",&current); /* retrieve reading */
printf(" %.3lf\n",current); /* print reading */
}

Table of Contents

Other manuals for Keysight E3632A

Related product manuals