Agilent Technologies 8163A Programming Manual page 138

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

Advertisement

VISA Programming Examples
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);
/* first get the wavelength of the laser source; to address the second channel
of a dual laser source use "CHAN2" instead of "CHAN1"*/
errStatus = viQueryf(vi,"%s","%f","SOURCE2:CHAN1:WAV?\n",&wavelength);
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
else
{
printf("Source Wavelength:%g\n",wavelength);
}
/* to receive the maximum power the attenuation must be set to zero */
errStatus = viPrintf(vi,"SOURCE2:CHAN1:ATT 0\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* turn off amplitude modulation */
errStatus = viPrintf(vi,"SOURCE2:CHAN1:AM:STATE 0\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* turn the laser on */
errStatus = viPrintf(vi,"SOURCE2:CHAN1:POW:STATE 1\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* loop, until a key is pressed */
while(!scanf("%c",&c));
/* turn the laser off */
errStatus = viPrintf(vi,"SOURCE2:CHAN1:POW:STATE 0\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
138
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
How to Set up a Fixed Laser Source

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents