![Agilent Technologies E364XA Series User Manual Download Page 138](http://html1.mh-extra.com/html/agilent-technologies/e364xa-series/e364xa-series_user-manual_2868438138.webp)
Chapter 6 Application Programs
Example Program for C and C++
137
6
if(bGPIB){ /* For use with GPIB 7 address, use "GPIB::7::INSTR" address format */
strcpy(VISA_address,"GPIB::");
strcat(VISA_address,GPIB_Address);
strcat(VISA_address,"::INSTR");
}
else{ /* For use with COM2 port, use "ASRL2::INSTR" address format */
strcpy(VISA_address,"ASRL");
strcat(VISA_address,COM_Address);
strcat(VISA_address,"::INSTR");
}
/* Open communication session with the power supply */
ErrorStatus = viOpenDefaultRM(&defaultRM);
ErrorStatus = viOpen(defaultRM,VISA_address,0,0,&power_supply);
CheckError("Unable to open port");
if(!bGPIB)
SendSCPI("System:Remote");
}
void
SendSCPI(char* pString)
{
char* pdest;
strcpy(commandString,pString);
strcat(commandString,"\n");
ErrorStatus = viPrintf(power_supply,commandString);
CheckError("Can’t Write to Driver");
if (bGPIB == 0)
delay(1000);
/* Unit is milliseconds */
pdest = strchr(commandString, ’?’);
/* Search for query command */
if( pdest != NULL ){
ErrorStatus = viScanf(power_supply,"%s",&ReadBuffer);
CheckError("Can’t Read From Driver");
strcpy(pString,ReadBuffer);
}
}
void
ClosePort()
{
/* Close the communication port */
viClose(power_supply);
viClose(defaultRM);
}
Continued on next page
Summary of Contents for E364XA Series
Page 9: ...8...
Page 15: ...14 Contents Contents...
Page 16: ...1 Quick Start...
Page 26: ...2 General Information...
Page 38: ...3 Front Panel Operation and Features...
Page 70: ...4 Remote Interface Reference...
Page 122: ...5 Error Messages...
Page 133: ...Chapter 5 Error Messages Calibration Errors 132...
Page 134: ...6 Application Programs...
Page 145: ...Chapter 6 Application Programs Example Program for Excel 97 144...
Page 146: ...7 Tutorial...
Page 157: ...Chapter 7 Tutorial Remote Programming 156...
Page 158: ...8 Specifications...
Page 166: ...Appendix Service Information...
Page 175: ...Appendix Service Information General Disassembly 174 General Disassembly...
Page 207: ......
Page 208: ......
Page 209: ......
Page 210: ......
Page 211: ......
Page 212: ......
Page 213: ......
Page 214: ......
Page 215: ......
Page 216: ......
Page 217: ......
Page 218: ......