Agilent Technologies 8163A Programming Manual page 191

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

Advertisement

How to Use VISA Calls
Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition
/* Initialize visa resource manger */
errStatus = viOpenDefaultRM (&defaultRM);
if(errStatus < VI_SUCCESS)
{ printf("Failed to open VISA Resource manager\n");
exit(errStatus);
}
/* Open session to GPIB device at address 20; the VI_NULL
parameters 3,4
are mandatory and not used for VISA 1.0*/
errStatus = viOpen (defaultRM, "GPIB::20::INSTR",
VI_NULL,VI_NULL,&vi);
if(errStatus < VI_SUCCESS)
{ printf("Failed to open instrument\n");
exit(errStatus);
}
/* set timeout to 20 sec; this should work for all commands except
for zeroing or READ commands with averaging times greater than the
timeout */
errStatus = viSetAttribute(vi,VI_ATTR_TMO_VALUE,20000);
checkError(vi,errStatus);
/* get the identification string of the instrument mainframe*/
errStatus = viQueryf(vi,"%s\n","%t","*IDN?",replyBuf);
if(errStatus < VI_SUCCESS)
{ checkError(vi,errStatus); }
else printf("%s",replyBuf);
/* identify the installed modules */
errStatus = viQueryf(vi,"%s\n","%t","*OPT?",replyBuf);
if(errStatus < VI_SUCCESS)
{ checkError(vi,errStatus); }
else printf("%s",replyBuf);
/* get information about the available options of a slot */
errStatus = viQueryf(vi,"%s","%t","SLOT1:OPT?\n",replyBuf);
if(errStatus < VI_SUCCESS)
{ checkError(vi,errStatus); }
else printf("%s",replyBuf);
/*loop, until a key is pressed */
while(!scanf("%c",&c));
/*close the session */
viClose(vi);
}
VISA Programming Examples
191

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

8166a8166b8163b8164a8164b

Table of Contents