Visa Example In Visual Basic - Agilent Technologies InfiniiVision 3000 Programmer's Manual

X-series
Hide thumbs Also See for InfiniiVision 3000:
Table of Contents

Advertisement

39
Programming Examples
}
/* Handle VISA errors.
* --------------------------------------------------------------- */
void error_handler()
{
}

VISA Example in Visual Basic

To run this example in Visual Basic for Applications:
1
2
3
4
5
6
7
'
' Agilent VISA Example in Visual Basic
' -------------------------------------------------------------------
1140
strcat(str_out, str_err_val);
err = viQueryf(vi, ":SYSTem:ERRor?\n", "%t", str_err_val);
if (err != VI_SUCCESS) error_handler();
}
if (strcmp(str_out, "") != 0)
{
printf("INST Error%s\n", str_out);
err = viFlush(vi, VI_READ_BUF);
if (err != VI_SUCCESS) error_handler();
err = viFlush(vi, VI_WRITE_BUF);
if (err != VI_SUCCESS) error_handler();
}
char err_msg[1024] = {0};
viStatusDesc(vi, err, err_msg);
printf("VISA Error: %s\n", err_msg);
if (err < VI_SUCCESS)
{
exit(1);
}
Start the application that provides Visual Basic for Applications (for
example, Microsoft Excel).
Press ALT+F11 to launch the Visual Basic editor.
Add the visa32.bas file to your project:
Choose File>Import File....
a
b
Navigate to the header file, visa32.bas (installed with Agilent IO
Libraries Suite and found in the Program Files\IVI Foundation\VISA\
WinNT\include), select it, and click Open.
Choose Insert>Module.
Cut- and- paste the code that follows into the editor.
Edit the program to use the VISA address of your oscilloscope, and save
the changes.
Run the program.
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents