Agilent Technologies 8163A Programming Manual page 141

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

Advertisement

How to Measure Power using FETCh and READ
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:UNIT W\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/*set the averaging time for measuring to 0.5s*/
averagingTime = 0.5;
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:ATIME %f\n",averagingTime);
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* turn continous measuring off */
errStatus = viPrintf(vi,"INIT1:CHAN1:CONT 0\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* trigger a measurement */
errStatus = viPrintf(vi,"INIT1:CHAN1:IMM\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* read 10 values and display the result; */
for (i = 0; i < 10; i++)
{
/* Now because an averaged value is available, the value will be fetched*/
errStatus = viQueryf(vi,"%s","%s","FETCH1:CHAN1:POW?\n",replyBuf);
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* two consecutive values are compared; if they are equal it will be marked;
because no evaluation is triggered, all values will be the same*/
if(i)
{
if(!strcmp(compBuf,replyBuf))
{
printf("Same:%s\n",replyBuf);
}
else printf("New:%s\n",replyBuf);
}
else printf("First:%s\n",replyBuf);
strcpy(compBuf,replyBuf);
}
/* now the read command is used in the same manner to
demonstrate the difference between fetch and read*/
/* read also 10 values, compare them and display the result; */
for (i = 0; i < 10; i++)
{
/*
In comparision to the "FETCH" command, the "READ" command implies
triggering a measurement.
Make sure the timeout set is greater than the adjusted
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel
System, Third Edition
VISA Programming Examples
141

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents