Agilent Technologies 8163A Programming Manual page 140

Lightwave multimeter lightwave measurement system lightwave multichannel system
Hide thumbs Also See for 8163A:
Table of Contents

Advertisement

VISA Programming Examples
void checkError(ViSession session, ViStatus err_status );
void main (void)
{
ViStatus
ViSession
ViSession
ViChar
ViChar
ViChar
ViReal64 averagingTime; /* averaging time */
ViInt32 i;
errStatus = viOpenDefaultRM (&defaultRM);
if(errStatus < VI_SUCCESS)
{
printf("Failed to open VISA Resource manager\n");
exit(errStatus);
}
errStatus = viOpen (defaultRM, "GPIB::20::INSTR", VI_NULL,VI_NULL,&vi);
if(errStatus < VI_SUCCESS)
{
printf("Failed to open instrument\n");
exit(errStatus);
}
/*set timeout to 20 sec; this should work for all commands
except zeroing */
errStatus = viSetAttribute(vi,VI_ATTR_TMO_VALUE,20000);
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* make sure that the reference is not used */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:REF:STATE 0\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* clear the error queue */
errStatus = viPrintf(vi,"*CLS\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* turn auto range on */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:RANGE:AUTO 1\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* change the power unit to watt */
140
errStatus;
/* returned error code from visa call */
defaultRM;
/* default visa resource manager variable */
vi;
/* current session handle */
replyBuf[256]; /* buffer holding answers of the instrument*/
compBuf[256]; /* buffer used for comparsion */
c;
/* used in the keyboard wait loop */
/* loop counter */
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
How to Measure Power using FETCh and READ

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents