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 #190 background imageLoading...
Page #190 background image
VISA Programming Examples How to Use VISA Calls
190 Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition
How to Use VISA Calls
The following example demonstrates how to communicate using VISA
calls. Also, the use of instrument identification commands is
demonstrated.
#include <stdio.h>
#include <stdlib.h>
#include <visa.h>
/* This function checks and displays errors, using the error query of
the instrument;
Call this function after every command to make sure your commands
are correct */
void checkError(ViSession session, ViStatus err_status )
{
ViStatus error;
ViChar errMsg[256];
/* queries what kind of error occurred */
error = viQueryf(session,"%s\n","%t","SYST:ERR?",errMsg);
/*if this command times out, a system error is probable;
check the GPIB bus communication */
if (error == VI_ERROR_TMO)
{
printf("System Error!\n") ;
exit(1);
}
else
{
/* display the error number and the error message */
if(errMsg[0] != '+')
printf("error:%ld --> %s\n", err_status,errMsg) ;
}
}
void main (void)
{
ViStatus errStatus; /*return error code from visa call */
ViSession defaultRM; /*default visa resource manager variable*/
ViSession vi; /*current session handle */
ViChar replyBuf[256]; /*buffer holding answers from the
instrument*/
ViChar c;

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