EasyManua.ls Logo

Tektronix KEITHLEY 2200 Series - Page 87

Tektronix KEITHLEY 2200 Series
104 pages
Print Icon
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...
{
ErrorStatus = viPrintf(KI200, "INSTrument:NSELect %d\n", i+1); //Select the channel
CheckError("Unable to select the channel");
ErrorStatus = viPrintf(KI200,"Measure:voltage?\n"); // Measure the output voltage
CheckError("Unable to write the device");
ErrorStatus = viScanf(KI200,"%f",&query[i][0]); // Retrieve the reading
CheckError("Unable to read voltage");
ErrorStatus = viPrintf(KI200,"Measure:current?\n"); // Measure the output current
CheckError("Unable to write the device");
ErrorStatus = viScanf(KI200,"%f",&query[i][1]); // Retrieve the reading
CheckError("Unable to read current");
printf("Channel: %d, measured voltage(V):%f, current(A):%f \n", i+1,
query[i][0], query[i][1]);
}
return 0;
}
void OpenPort()
{
//Open communication session with the power supply
ErrorStatus = viOpenDefaultRM(&defaultRM);
ErrorStatus =viOpen(defaultRM,
"USB0::0X0699::0X0397::083001106673201002::INSTR",0,0,&KI200);
/*When using the GPIB interface, replace the above command line with
"GPIB0::21::INSTR". Note the argument "21" is an example and refers to the GPIB address.
Substitute the appropriate GPIB address in the command line.*/
CheckError("Unable to open the port");
SendSCPI("SYSTem:REMote");
}
void SendSCPI(char* pString)
{
char* pdest;
strcpy(commandString,pString);
strcat(commandString, "\n");
ErrorStatus = viPrintf(KI200, commandString);
CheckError("Can't Write to Power Supply");
pdest = strchr(commandString, '?'); // Search for the query command
if (pdest != NULL)
{
ErrorStatus = viBufRead(KI200, (ViBuf)ReadBuffer,
sizeof(ReadBuffer), VI_NULL);
CheckError("Can't read from driver");
strcpy(pString, ReadBuffer);
}
}
void ClosePort()
{
Series 2200 Programmable Multichannel DC Power Supplies Programmer Manual B-3

Related product manuals