Agilent Technologies 8163A Programming Manual page 136

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

Advertisement

VISA Programming Examples
ViChar
/* 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);
}
136
c;
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
How to Use VISA Calls

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents