EasyManuals Logo

Agilent Technologies 8163B Programming Guide

Agilent Technologies 8163B
274 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #191 background imageLoading...
Page #191 background image
How to Use VISA Calls VISA Programming Examples
Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition 191
/* 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);
}

Table of Contents

Other manuals for Agilent Technologies 8163B

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies 8163B and is the answer not in the manual?

Agilent Technologies 8163B Specifications

General IconGeneral
BrandAgilent Technologies
Model8163B
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals