EasyManuals Logo

Agilent Technologies 8164B Programming Guide

Agilent Technologies 8164B
274 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #193 background imageLoading...
Page #193 background image
How to Set up a Fixed Laser Source VISA Programming Examples
Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition 193
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);
/* close the session */
viClose(vi);
}
void checkError(ViSession session, ViStatus err_status )
{
ViStatus error;
ViChar errMsg[256];
error = viQueryf(session,"SYST:ERR?\n","%t",errMsg);
if (error == VI_ERROR_TMO)
{
printf("System Error!\n") ;
exit(1);
}
else

Table of Contents

Other manuals for Agilent Technologies 8164B

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies 8164B and is the answer not in the manual?

Agilent Technologies 8164B Specifications

General IconGeneral
BrandAgilent Technologies
Model8164B
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals