HP 8163A Programming Manual page 142

Lightwave measurement system
Hide thumbs Also See for HP 8163A:
Table of Contents

Advertisement

Programming Examples
How to Use VISA Calls
void main (void)
{
ViStatus
errStatus;
ViSession
defaultRM;
/
ViSession
vi;
ViChar
replyBuf[256]; /*buffer holding answers from the instrument*/
ViChar
c;
/* Initialize visa resource manger */
errStatus = viOpenDefaultRM (&defaultRM);
if(errStatus < VI_SUCCESS)
{
printf("Failed to open VISA Resource manager\n");
exit(errStatus);
}
/* Open session to HPIB 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);
142
/*return error code from visa call */
/*default visa resource manager variable*
/*current session handle */

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 8164a

Table of Contents