User`s guide

Building a VISA Application in Windows 2
Agilent VISA User’s Guide 19
Building a VISA Program (Visual Basic)
This section provides guidelines for building a VISA program
in the Microsoft Visual Basic (VB) language, including:
Visual Basic Programming Considerations
Sample VISA Program (Visual Basic)
Visual Basic Programming Considerations
Some considerations for programming in Visual Basic follow.
This information applies to Microsoft Visual Basic version
6.0; for information on building a VISA application in
Microsoft Visual Studio .NET, see the VISA Online Help.
Required Module for a Visual Basic VISA Program
Before you can use VISA specific functions, your application
must add the visa32.bas VISA Visual Basic module found
in C:\Program Files\VISA\winnt\include\ (assuming
default installation directories).
Adding the visa32.bas File to Your Project
To install visa32.bas:
1 Select Project > Add Module from the Visual Basic 6.0 menu.
2 Select the Existing tab.
3 Browse and select the visa32.bas file from the
applicable directory (by default, C:\Program
Files\
VISA\winnt\include\).
4 Click the Open button.
VISA Limitations in Visual Basic
VISA functions return a status code that indicates success or
failure of the function. The only indication of an error is the
value of a returned status code. The VB Error variable is not
set by any VISA function. Thus, you cannot use the ON
ERROR construct in VB or the value of the VB Error variable
to catch VISA function errors.