Keysight Technologies 8163A/B Programming Manual page 247

Table of Contents

Advertisement

8163A/B, 8164A/B & 8166A/B Mainframes Programming Guide
printf("#%02d power:%s
n",i,replyBuf,wavelength);
/* increase the wavelength */
wavelength += 10.0e-9;
if(wavelength > wavelength_max) break;
/*set the new wavelength*/
errStatus = viPrintf(vi,"SOURCE2:WAV %g\
n",wavelength);
/*
poll the instrument for completion of this command
because adjusting a new wavelength takes some time
*/
do
{
errStatus = viQueryf(vi,"*OPC?\n","%d",&cmdDone);
checkError(vi,errStatus);
} while (!cmdDone);
}
/* loop, until a key is pressed */
while(!scanf("%c",&c));
/* turn laser off */
errStatus = viPrintf(vi,"SOURCE2:CHAN1:POW:STATE 0\n");
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") ;
else
{
VISA Programming Examples
wavelength:%g\
6
247

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a/b8166a/b

Table of Contents