Agilent Technologies 8163A Programming Manual page 144

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

Advertisement

VISA Programming Examples
ViInt32 cmdDone;
/* First get initialized the visa library (see example 1) */
errStatus = viOpenDefaultRM (&defaultRM);
if(errStatus < VI_SUCCESS)
{
printf("Failed to open VISA Resource manager\n");
exit(errStatus);
}
/* Open session to GPIB device at address 20; */
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);
/* clear error queue */
errStatus = viPrintf(vi,"*CLS\n");
checkError(vi,errStatus);
/* read the wavelength from the laser source */
errStatus = viQueryf(vi,"SOURCE2:CHAN1:WAV?\n","%s",replyBuf);
checkError(vi,errStatus);
/* feed the source wavelength into the power meter making
sure to measure the maximum power of the source */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:WAV %s\n",replyBuf);
checkError(vi,errStatus);
/* turn auto range on */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:RANGE:AUTO 1\n");
checkError(vi,errStatus);
/* change the power unit of the power meter to dBm */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:UNIT 0\n");
checkError(vi,errStatus);
/*set the averaging time for measuring to 20 ms,
therefore no timeout needs to implemented */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:ATIME 0.02\n");
144
/* return value for OPC command */
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
How to Co-ordinate Two Modules

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents