EasyManuals Logo

Agilent Technologies B1500A User Manual

Agilent Technologies B1500A
208 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 #160 background imageLoading...
Page #160 background image
4-4 Agilent B1500 VXIplug&play Driver Users Guide, Edition 3
Programming Examples for C++ Users
Programming Basics
Table 4-1 Example Template Program Code for Visual C++
#include <stdio.h> /* 1 */
#include <stdlib.h>
#include <visa.h>
#include "agb1500.h"
void check_err (ViSession vi, ViStatus ret) { /* 6 */
ViInt32 inst_err;
ViChar err_msg[256];
if(VI_SUCCESS > ret) {
if ( agb1500_INSTR_ERROR_DETECTED == ret ) {
agb1500_error_query(vi, &inst_err, err_msg);
printf("Instrument Error: %ld\n %s\n", inst_err, err_msg);
}
else {
agb1500_error_message(vi, ret, err_msg);
printf("Driver Error: %ld\n %s\n", ret, err_msg);
}
}
} /* 20 */
void perform_meas (ViSession vi, ViStatus ret) { /* 22 */
/* insert program code */
}
ViStatus main ( ) /* 26 */
{
ViStatus ret; /* 28 */
ViSession vi;
ViChar err_msg[256]; /* 30 */
Line Description
1 to 4 Required to use the Agilent B1500 VXIplug&play driver. The header files contain various
necessary information such as function declaration and macro definitions.
You may add the include statements to call another header files that may be needed by the
codes you added. Also, the include statements may be written in a header file that will be
called by the source file (e.g. #include <stdio.h> may be written in the stdafx.h header file
that will be called by the source file).
6 to 20 Checks if the passed “ret” value indicates normal status, and returns to the line that called
this subprogram. If the value indicates an instrument error status or a device error status,
the error message will be displayed.
22 to 24 Complete the perform_meas subprogram to perform measurement.
26 Beginning of the main program.
28 to 30 Declares variables used in the main program.

Table of Contents

Other manuals for Agilent Technologies B1500A

Questions and Answers:

Question and Answer IconNeed help?

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

Agilent Technologies B1500A Specifications

General IconGeneral
BrandAgilent Technologies
ModelB1500A
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals