HP 8163A Series Programming Manual page 139

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

Advertisement

How Power Varies with Wavelength
ViSession
ViChar
ViChar
ViReal64 wavelength; /* used to hold the wavelength of the tunable laser source */
ViReal64 wavelength_max; /*used to hold the maximum wavelength of the tunable
laser source*/
ViInt32 i;
ViInt32 cmdDone;
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);
checkError(vi,errStatus);
errStatus = viPrintf(vi,"*CLS\n");
checkError(vi,errStatus);
/* read the minimum wavelength from the tunable laser source*/
errStatus = viQueryf(vi,"SOURCE2:WAV? MIN\n","%s",replyBuf);
checkError(vi,errStatus);
/* save this wavelength */
wavelength = atof(replyBuf);
/* set the minimum wavelength as initial wavelength in the tunable laser source */
errStatus = viPrintf(vi,"SOURCE2:WAV %s\n",replyBuf);
checkError(vi,errStatus);
/* set the power meter to same wavelength like the tunable laser source */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:WAV %s\n",replyBuf);
checkError(vi,errStatus);
/* read the maximum wavelength from the tunable laser source */
errStatus = viQueryf(vi,"SOURCE2:WAV? MAX\n","%s",replyBuf);
HP 8163A Lightwave Multimeter, HP 8164A Lightwave Measurement System,
& HP 8166A Lightwave Multichannel System User's Guide, E1299
vi;
/* current session handle */
replyBuf[256]; /*buffer holding answers of the instrument */
c;
/* used in the keyboard wait loop */
/* loop counter */
/* return value for OPC command */
Programming Examples
139

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a series8166a series

Table of Contents