Agilent Technologies 8163A Programming Manual page 152

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

Advertisement

VISA Programming Examples
/* turn auto range on */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:RANGE:AUTO 1\n");
checkError(vi,errStatus);
/* send the command sequence for continuous logging */
slot = 1;
chan = 1;
noOfValues = 100;
averagingTime = 0.02; /* set averaging time to 20ms */
viPrintf(vi,"SENS%1d:CHAN%1d:FUNC:PAR:LOGG %d,%f\n",
/* start logging */
viPrintf(vi,"SENS%1d:CHAN%1d:FUNC:STAT LOGG,START\n",slot,chan);
/* to display the results, logging should be completed */
/* the instrument has to be polled about the progress of the logging */
do
{
errStatus = viQueryf(vi,"SENS%1d:CHAN%1d:FUNC:STATE?\n","%t",slot,chan,r
eplyBuf);
/* if an error occurs break the loop */
if (errStatus < VI_SUCCESS)
{
checkError(vi,errStatus);
break;
}
/* find the substring "COMPLETE" in the reply of the instrument */
replySubStr = replyBuf;
{
if(!strncmp(replySubStr,"COMPLETE",strlen("COMPLETE"))) break;
replySubStr ++;
}
}while (!*replySubStr); /*substring "COMPLETE" not found */
/* The instrument returns the logging result in the following format:
#xyyyffff...; the first digits after the hash denotes the
number of ascii digits following (y) ; y specifies the number of binary data
following; "ffff" represent the 32Bit floats as log result. */
152
/* log 100 values */
slot,
chan,
noOfValues,
averagingTime);
checkError(vi,errStatus);
checkError(vi,errStatus);
while(*replySubStr)
/*continue polling */
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
How to Log Results

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents