Keysight Technologies 8163A/B Programming Manual page 236

Table of Contents

Advertisement

6
VISA Programming Examples
236
}
/*set timeout to 20 sec; this should work for all commands
except zeroing */
errStatus = viSetAttribute(vi,VI_ATTR_TMO_VALUE,20000);
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* make sure that the reference is not used */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:REF:STATE 0\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* clear the error queue */
errStatus = viPrintf(vi,"*CLS\n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* turn auto range on */
errStatus = viPrintf(vi,"SENS1:CHAN1:POW:RANGE:AUTO 1\
n");
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* change the power unit to watt */
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);
8163A/B, 8164A/B & 8166A/B Mainframes Programming Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a/b8166a/b

Table of Contents