HP 8163A Programming Manual page 146

Lightwave measurement system
Hide thumbs Also See for HP 8163A:
Table of Contents

Advertisement

Programming Examples
How to Set up a Fixed Laser Source
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
{
/* only errors should be displayed */
if(errMsg[0] != '+')
printf("error:%ld --> %s\n", err_status,errMsg) ;
}
146

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 8164a

Table of Contents