How To Use Visa Calls - HP 8163A Programming Manual

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

Advertisement

Programming Examples

How to Use VISA Calls

6.1 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 HPIB 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) ;
}
}
141

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 8164a

Table of Contents